ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Weblog:   PPTP VPNs in Jaguar
Subject:   If only i could choose default routes
Date:   2003-03-31 23:26:45
From:   anonymous2
Response to: If only i could choose default routes

After setting up the VPN connection, try running the following script. You will of course need to change the IP addresses to fit your needs. In the example below, 192.168.100.0/24 is the local network, and 192.168.1.0/24 is the remote network we are vpn'd to. This is self-healing; when the vpn is disconnected the routes will fix themselves.


#!/bin/sh
# delete the broken default route
sudo route delete default


# add the route to the vpn network
# via the pptp interface
sudo route add -net 192.168.1.0 \
-netmask 255.255.255.0 -interface ppp0


# set the new default route
sudo route add default 192.168.100.254


1 to 1 of 1
1 to 1 of 1