
alon.barlev at gmail
Jul 3, 2012, 12:56 PM
Post #3 of 3
(424 views)
Permalink
|
This enables persist tun device to be reused in future connections. ipv6 is not tested. Maybe it would be cleaner to define functions for address manipulation, not sure. To be simple, this patch only handles iproute2. Signed-off-by: Alon Bar-Lev <alon.barlev [at] gmail> --- vpnc-script | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/vpnc-script b/vpnc-script index f206dfd..e3cd4db 100755 --- a/vpnc-script +++ b/vpnc-script @@ -661,6 +661,20 @@ do_disconnect() { if [ -n "$INTERNAL_IP4_DNS" ]; then $RESTORERESOLVCONF fi + + if [ -n "$IPROUTE" ]; then + if [ -n "$INTERNAL_IP4_ADDRESS" ]; then + $IPROUTE addr del "$INTERNAL_IP4_ADDRESS/255.255.255.255" peer "$INTERNAL_IP4_ADDRESS" dev "$TUNDEV" + fi + # If the netmask is provided, it contains the address _and_ netmask + if [ -n "$INTERNAL_IP6_ADDRESS" ] && [ -z "$INTERNAL_IP6_NETMASK" ]; then + INTERNAL_IP6_NETMASK="$INTERNAL_IP6_ADDRESS/128" + fi + if [ -n "$INTERNAL_IP6_NETMASK" ]; then + $IPROUTE -6 addr del $INTERNAL_IP6_NETMASK dev $TUNDEV + fi + fi + destroy_tun_device } -- 1.7.8.6 _______________________________________________ vpnc-devel mailing list vpnc-devel [at] unix-ag https://lists.unix-ag.uni-kl.de/mailman/listinfo/vpnc-devel http://www.unix-ag.uni-kl.de/~massar/vpnc/
|