5656 questions

6864 answers


6947 members

0 votes
152 views 0 comments
Hello, we use the RUT240 in a vehicle.

It is connected to a wireless LAN when it is parked in its garage.

Now we want to connect it via IPSec-VPN (AVM Fritz) when it is outside of the garage.

Is there any possibility to only start the connection, if the WiFi is disconnected?


1 Answer

0 votes


our router does not have this functionality, but you can use uci commands to enable and disable the IPsec tunnel when switching WAN interfaces. How to use uci command you can read here:


In your case, the configuration should be as follows:
  • Go to Network -> WAN and click edit on WiFi WAN.
  • Select Execute command at the bottom of the page.
  • In the Command box, type uci command: uci set strongswan.<your_tunel_name>.enabled='0'
  • Do the same with a mobile WAN. In the Command box, type the following uci command: uci set strongswan.<your_tunel_name>.enabled='1'
With this configuration, the IPsec tunnel will turn on when the router uses the mobile WAN interface. When the router switches to WiFi WAN, then the IPsec tunnel will shut down.