When I establish the VPN connection, I would like only the IP addresses 158.42.0.0/16 to go through it, and the rest of addresses to go throught my old default route instead of through the VPN. The Debian package of vpnc contains a patched version of vpnc-connect that reads an option in /etc/vpnc/default.conf which allows you to do this. This option is "Target networks", and works in the form of "Target networks 158.42.0.0/16". Below is the portion of vpnc-connect that reads it.

Is it possible to do this with Kvpnc? I haven't found a way to do it. If it's not possible, are there any plans on implementing something like this? If you don't use Debian I could send you the full vpnc-connect script. Perhaps you might find it useful.

Thanks.


-----------------------

networks="$(getvar "${config}" "Target networks")"

ip route add $(ip route get $VPNGATEWAY | fix_ip_get_output)
echo "$VPNGATEWAY" > "$gateway"

if [ -z "$networks" ]; then
   ip route | grep '^default' | fix_ip_get_output > "$defr"
   networks=default
fi
for network in $networks; do
   ip route del $network 2>/dev/null
   ip route add $network dev $TUNDEV
done



--
Víctor Fernández Martínez
Gabinete de prensa de PoLinux [www.polinux.upv.es]. Usuario de Linux registrado 
#312284 en http://counter.li.org.


Reply via email to