(E-Mail Removed) wrote:
> To expand on my question, this is an excerpt from a site a saw and i
> think i understand it a bit better:
> [QUOTE]d#!/bin/sh
> # pppd ip-up script for all-to-tunnel routing
> # name of primary network interface (before tunnel)
> PRIMARY=eth0
> # address of tunnel server
> SERVER=tunnel.example.com
> # provided by pppd: string to identify connection aka ipparam option
> CONNECTION=$6
> if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi
> # provided by pppd: interface name
> TUNNEL=$1
> if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi
> # if we are being called as part of the tunnel startup
> if [ "${CONNECTION}" = "tunnel" ] ; then
> # direct tunnelled packets to the tunnel server
> route add -host ${SERVER} dev ${PRIMARY}
If the tunnel "goes down" then this host route should allow it to be
reestablished without replacing the tunnel routing with the primary
network routing. Note that the host route is not removed in ip-down.
> # direct all other packets into the tunnel
> route del default ${PRIMARY}
> route add default dev ${TUNNEL}
> fi
> Note: if you need the network connection to work again after the
> tunnel is taken down but before the main connection is terminated, you
> will need to restore the default route. Use an ip-down script for the
> tunnel, as follows:
> #!/bin/sh
> # pppd ip-down script for all-to-tunnel routing
> # name of primary network interface (before tunnel)
> PRIMARY=eth0
> # provided by pppd: string to identify connection aka ipparam option
> CONNECTION=$6
> if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi
> # provided by pppd: interface name
> TUNNEL=$1
> if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi
> # if we are being called as part of the tunnel shutdown
> if [ "${CONNECTION}" = "tunnel" ] ; then
> # direct packets back to the original interface
> route del default ${TUNNEL}
> route add default dev ${PRIMARY}
> fi
>>From that i can see before the ppp0 link is alive, eth0 will be the
> default route thus the connection to the ppp server can be
> established. Once the link is up ppp0 will be set as the default
> route. After the ppp0 link is lost the eth0 will be restored as the
> default gateway. From my understanding, if eth0 were not restored as
> default gateway it would be impossible to bring the ppp0 link back up?
No, I think that the access to ${SERVER} through the Internet as provided
by the host route in ip-up should be enough to restore the tunnel and
so the PPP link.
>>From windows route print, i understand this compeletly as it
> explicitly shows the route to the pptp server 100.200.100.200
And I don't understand windows routing at all.
....
> Now i know this isnt a windows forum, but how is linux able to route
> data to the pptp server when it doesnt have a route to it? Under Linux
In the context of the ip-up script above it does have a route to the
pptp server.
> is ppp0 interally remembering the route over which it was established,
> and thus sending packets over eth0 creating the encapsulated tunnel we
> know as a vpn.
I think there is a question here and the answer should be no. The ppp0
interface will only "remember" the local and remote PPP addresses.
> How does this sound, or am i still miles off understanding the inner
> workings?
My own understanding of PPTP is somewhat limited so I'll pass on this.
--
Clifford Kite
/* Domain names are for water/carbon units that don't think in binary.
--Allen Kistler */