I've installed OpenVPN Settings and I am very happy with it. Thanks for your hard work. I use Android 2.3.6 connecting to my Tomato router running OpenVPN server.
I use "dhcp-option DNS <my.vpn.ip>,redirect-gateway def1" settings pushed from the server and "Use VPN DNS Server" option in the application. It works if I start the tunnel after getting the wifi connection. However, it seems that every time I (re-)join a wifi network, it wipes the DNS server settings (forces its own DNS to net.dns1). I know I can use the "Fix DNS" option of OpenVPN Settings but that is unsustainable. I go in and out of range often (2-3 times per hour). If I forget to check, I essentially lose connectivity because I am redirecting all traffic via the tunnel and my DNS server (pushed by the wifi network) is inaccessible when using the tunnel.
Is there an easy solution? Ideally, the OpenVPN Settings application could register/listen to the wifi network change and apply/force its DNS server every time the wifi network is connected. I learned that the equivalent command is "setprop net.dns1 <new.ip.address>". I saw a few Java examples on how to get notified about wifi network notifications.
However, I'd be happy with any workaround, for example using some logical equivalent of up or down script like OpenVPN (I am fully aware that this would be not in OpenVPN but in the wireless app/settings). Are there some custom/different wireless setting apps that would let me plug in custom action/command when I connect to certain network?
Another possibility would be for me to tweak the routing tables to add route for the DNS server (route all but DNS traffic via the tunnel). I have no idea if/how that would be possible.
I am pretty new to this; I would appreciate any advice/pointers.
Bonus: a feature request: I only need/use OpenVPN for this one wifi network (it is inside corporate firewall so I need OpenVPN to access IMAP, SMTP, VoIP ports). It would be great if I could connect/link OpenVPN to a single wifi network - so connecting to that network would automatically start the tunnel; disconnecting from the wifi would turn it off.
Thank you for your time and help,
Peter