[NTLUG:Discuss] routing to temp dial up connection and permanent connection
Kyle_Davenport@compusa.com
Kyle_Davenport at compusa.com
Mon May 15 10:34:37 CDT 2000
>
> Seth Daniel wrote:
> >
> > All,
> >
> > I have a permanent connection to the internet via ADSL. I also dial-in
> > occasionally to work using a 56k modem w/ ppp.
> >
> > Whenever I have to dial-in I need to take down my eth0 interface otherwise
> > the routing becomes messed up. My question is this: how do I have this
> > temporary dial-up *and* still be able to access the outside world through
the
> > DSL while I'm dialed up?
> >
> > Something related to this is the pppd usepeerdns option. From what I can
tell
> > it makes a backup of /etc/resolv.conf and then proceeds to make a new
resolv.conf
> > file with the dns ip numbers for the dial-up. Is there anyway to tell pppd
to
> > append this information to the current resolv.conf? Otherwise I'll need to
make
> > some script which does this for me.
> >
> > Pertinant info:
> > --this is the routing before I dial-up:
> > Kernel IP routing table
> > Destination Gateway Genmask Flags Metric Ref Use
Iface
> > 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
> > 0.0.0.0 10.0.0.1 0.0.0.0 UG 1 0 0 eth0
> >
> > --this is the routing after dial-up if I have not brought down eth0
> > Kernel IP routing table
> > Destination Gateway Genmask Flags Metric Ref Use
Iface
> > 192.168.134.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
> > 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
> > 0.0.0.0 10.0.0.1 0.0.0.0 UG 1 0 0 eth0
>
>
> You have a route entry for the ppp dialup server (put there by pppd),
> now you need an entry for TI's internal network. At the moment I can't
> think of how to do set it up upon dialup (need sleep), but you should be
> able to do it manually with the command:
>
> route add -net 192.0.0.0 netmask 255.0.0.0 gw 192.168.134.1 ppp0
>True, but I am looking for an automatic way to do all of this in case
>it ever changes in the future.
>
> >
> > --relavent pppd options
> > defaultroute
> > noipdefault
> > usepeerdns
>
Mine works great. I let it set the defaultroute, because that can change, then
delete it. I know the subnets and nameserver at work at work so I add those:
GW=`netstat -rn|grep ppp0|awk '{print $1}'`
route del default gw $GW
route add -net 172.0.0.0 netmask 255.0.0.0 gw $GW dev ppp0
route add -net 10.9.0.0 netmask 255.255.0.0 gw $GW dev ppp0
cp /etc/resolv.conf /etc/resolv.conf.orig
sed '2i\^@nameserver 10.9.99.22' < /etc/resolv.conf.orig > /etc/resolv.conf
My ppp-off restores the original settings.
More information about the Discuss
mailing list