![]() |
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:. |
Re: how to sustain openvpn even when changing wifi connection
latest openvpn-applet (0.6.1) should handle openvpn reconnection as long as your openvpn configuration doesn't drop root permissions
|
Re: how to sustain openvpn even when changing wifi connection
but I also need openvpn to stop when at home . so lan routing wont have loops
|
Re: how to sustain openvpn even when changing wifi connection
Quote:
So, I believe that _technically_ it shouldn't be difficult for OpenVPN to disconnect the physical layer and re-connect through another physical layer (i.e. when you disconnect from one AP and reconnect via another): The re-connect phase should be the same. But that doesn't mean there's actual support for it. |
Re: how to sustain openvpn even when changing wifi connection
Quote:
Initially, I interpreted OP as wanting to be able to keep his TCP/IP connections alive even if the IP address for wlan0 changed. I still think this is really hard to do. After getting more details, OP wants the VPN to do an ordinary reconnect which is much easier to do since it's part of "normal procedures". This is what I'm commenting with "much easier". |
Re: how to sustain openvpn even when changing wifi connection
as a resault of this discution I came up with this http://talk.maemo.org/showthread.php?p=658789 solution , see post 2.
I now ask this: how should I use udhcpc? should I use it with --now, so it will quit after establishing an IP? or should I leave it alive updating the IP while changing physical connections? Quote:
|
Re: how to sustain openvpn even when changing wifi connection
So in order to maintain openvpn even when changing from 3G to wifi and back agin, I just have
Quote:
You don't need anything in /etc/networks/if-down.d at all |
All times are GMT. The time now is 12:03. |
vBulletin® Version 3.8.8