Toggle VPN tunnel for specific device on CLI rather than webgui

Hello - My computer is dual boot windows and linux. When in windows I want traffic to go through clearnet. When in linux I want traffic to go through mullvad. Right now I manually toggle “Use VPN Tunnel” on the gui each time I change OS. I would like to automate this using a script on linux: when I log into to linux, ssh into the router and turn on mullvad, and then I log out of linux have it ssh into the router and turn off mullvad.

I’ve got the scripts working: the enable script adds my computers MAC address to the src_mac10 ipset, and the disable script removes my computers MAC address from the src_mac10 ipset.

The only thing I haven’t been able to figure out is how to update the GUI display so it will properly show the VPN tunnel is active/inactive. Does anyone know where that is done?

I would recommend just changing the MAC address inside Linux and then using a MAC policy for the VPN. Much easier and more convenient. Changing VPN via CLI is painful.

1 Like

:exploding_head: I’m so mad at myself for not thinking of that. Thanks so much!

1 Like