![]() |
how to sustain openvpn even when changing wifi connection
Did anyone managed to have openvpn stay connected even after changing wifi access points?
did anyone managed to sustain openvpn after switching to 3G connection? Niv |
Re: how to sustain openvpn even when changing wifi connection
Take some time and think about what OpenVPN is doing and I think it will be hard to make this work if you change WiFi connection or switch to 3G.
The interface that is the endpoint on your device is a virtual one that sends its traffic through your real one, the wlan0 interface. If the wlan0 interface is reconfigured the remote end will not be able to send data to the same IP address and this is the base for the tunnel that is created. Perhaps there is some way to restart the lower levels of the OpenVPN connection without disturbing established TCP/IP connections, but I doubt it. |
Re: how to sustain openvpn even when changing wifi connection
But as long as the clients are running sessions that are attached to the virtual interface, a vpn reconnection shouldn't reset their connection, no?
|
Re: how to sustain openvpn even when changing wifi connection
Quote:
As far as I know, applications running on the client machine that access services on the inside via VPN can't pick a special interface. This is done via the kernel routing table that after the creation of the VPN connection gets a new entry pointing at the virtual interface for all traffic in that subnet. When it comes to established TCP/IP connections, any packet that's sent over the VPN connection has to be encrypted and sent to the receiver (client or server) using the normal connection. If this mapping were to break, I'd guess all established TCP/IP connections would be orphaned and removed by the connection tracking in the TCP/IP stack, possibly after some timeout. If you only look at new connections, like clicking a new link in your browser, it might work even if you just reconnected the lower levels of the VPN system. But, to me, this is of limited use since that's not saving established connections. |
Re: how to sustain openvpn even when changing wifi connection
I was basicly looking for script that will restart the openvpn service , whenever it senses that a new connection was established. just like my sip account registers again whenever I switch access point connection.
Niv |
Re: how to sustain openvpn even when changing wifi connection
Technically there shouldn't really be any problem. Just as the openvpn connection itself can go down and get re-established, and the only thing you would notice would be a pause in your remote access. But this doesn't mean that there's actual support for moving sessions between different physical layers. I haven't done any experiments on this.
|
Re: how to sustain openvpn even when changing wifi connection
That's something else, I'd say. And much easier, if I were to guess.
I'm sure there are dbus messages sent when a new connection is established. If you register to listen for them, you can (re)start the VPN connection when you want to. |
Re: how to sustain openvpn even when changing wifi connection
Quote:
how can I know if there is actually still a connection to the WAN? |
Re: how to sustain openvpn even when changing wifi connection
Quote:
So, if you've moved from "not connected" to "connected" with the attribute set to "wifi", and get a message from the 3G module, you can just ignore that. Or am I missing something here? |
Re: how to sustain openvpn even when changing wifi connection
Quote:
Code:
#! /bin/sh Code:
Stopping virtual private network daemon:. |
All times are GMT. The time now is 09:33. |
vBulletin® Version 3.8.8