maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   how to sustain openvpn even when changing wifi connection (https://talk.maemo.org/showthread.php?t=52316)

mikkov 2010-05-11 14:19

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

niv 2010-05-11 14:32

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

TA-t3 2010-05-11 15:46

Re: how to sustain openvpn even when changing wifi connection
 
Quote:

Originally Posted by Joorin (Post 651937)
That's something else, I'd say. And much easier, if I were to guess.

I'll have to disagree. Just to clarify - when there's an OpenVPN reconnect OpenVPN is able (as it should) to keep this hidden from the application layer (which just sees a connection through a TUN device). And if you look at the openvpn log messages (all this should be easier to monitor if you do it on a desktop computer) then you'll see that when this happens OpenVPN goes through the whole connection protocol again.

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.

Joorin 2010-05-11 15:53

Re: how to sustain openvpn even when changing wifi connection
 
Quote:

Originally Posted by TA-t3 (Post 653681)
I'll have to disagree. Just to clarify - when there's an OpenVPN reconnect OpenVPN is able (as it should) to keep this hidden from the application layer (which just sees a connection through a TUN device). And if you look at the openvpn log messages (all this should be easier to monitor if you do it on a desktop computer) then you'll see that when this happens OpenVPN goes through the whole connection protocol again.

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.

I'm suspecting a case of miscommunication here.

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".

niv 2010-05-16 08:02

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:

Originally Posted by TA-t3 (Post 653681)
I'll have to disagree. Just to clarify - when there's an OpenVPN reconnect OpenVPN is able (as it should) to keep this hidden from the application layer (which just sees a connection through a TUN device). And if you look at the openvpn log messages (all this should be easier to monitor if you do it on a desktop computer) then you'll see that when this happens OpenVPN goes through the whole connection protocol again.

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.


bobgm 2010-08-13 17:25

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:

#!/bin/sh

OPENVPN=/etc/init.d/openvpn

if [ ! -x $OPENVPN ]; then
exit 0
fi

$OPENVPN restart client
in /etc/network/if-up.d/openvpn - if you have multiple vpns, you could do a loop as shown earlier in the thread - but I only have one, called 'client' and this works perfectly for me. I keep it up whilst on my home wifi, I don't have any routing loops ;-) I f you do have such issues, again an earlier post shows how you can decide which network you've just landed on and decide there.

You don't need anything in /etc/networks/if-down.d at all


All times are GMT. The time now is 10:39.

vBulletin® Version 3.8.8