[lug] ppp and eth0

Paul E Condon pecondon at mesanetworks.net
Wed Apr 28 15:07:15 MDT 2004

Many pre-built ppp configurations assume that they can lay claim to
the 192.168.0.x subnet, and that is the default route. 
But your eth0 is already using it. You can easily work around this
by changing instrument setup to use 192.168.1.x 

Sharing 192.168.0.x as you are doing may work today, and maybe not
tomorrow. And then again your ppp scripts may probe for an available
subnet. In which case these comments are irrelevant to your situation.


On Wed, Apr 28, 2004 at 10:55:21AM -0600, Gary Hodges wrote:
> rm at fabula.de wrote:
> >On Wed, Apr 28, 2004 at 09:28:54AM -0600, Gary Hodges wrote:
> > 
> >
> >>Do I need to bring eth0 down when making a ppp connection?  I've had a 
> >>student working on a task for me and he believes that eth0 needs to be 
> >>brought down before the ppp connection is established.  This doesn't 
> >>make sense to me, but it wouldn't be the first time he proved me wrong.
> >>
> >>Gray
> >>
>        ^^^^^
> That would be "Gary," but Gray sounds like a decent nickname....
> >>I might be able to help more if you can provide a bit more information.
> >>
> Thanks for the offer.  My configuration is an isolated machine connected 
> to an instrument with CAT5 cable, and a modem on /dev/ttyS1 with ppp 
> used to connect to the internet when needed.
> eth0:  (PC: -> (Instrument:
> ppp: Dials an ISP (NIST) to connect to the internet to upload data, set 
> time, etc.
> I have to confess an almost total lack of knowledge with Linux and PPP.  
> I've let another person deal with this totally and I'm now just sticking 
> my nose in because some things don't make sense.  My problem is that 
> when PPP is active, I don't get data through eth0.  Also, if I fail to 
> connect with PPP than I'm left with no connection to my instrument.  I 
> actually just commented out the portions of the scripts that bring eth0 
> down and it seemed to work, so maybe I'm fine now.
>  Of course, I ship this computer to Mississippi tomorrow so everything 
> has to be bullet proof today. :-)  I'd like to have the simplest scripts 
> to accomplish the task.
> The current scripts with my latest comments:
> --------------
> gwn-tsi:/home/tsi# more /etc/ppp/ppp-on
> #!/bin/sh
> #/sbin/ifconfig eth0 down
> cp /etc/ppp/options.bak /etc/ppp/options
> exec /usr/sbin/pppd /dev/ttyS1  57600
> ---------------
> gwn-tsi:/home/tsi# more /etc/ppp/ppp-off
> #!/bin/sh
> DEVICE=ppp0
> #
> # If the ppp0 pid file is present then the program is running. Stop it.
> if [ -r /var/run/$DEVICE.pid ]; then
>    kill -INT `head -1 /var/run/$DEVICE.pid`
> #
> # If the kill did not work then there is no process running for this
> # pid. It may also mean that the lock file will be left. You may wish
> # to delete the lock file at the same time.
>         if [ ! "$?" = "0" ]; then
>             rm -f /var/run/$DEVICE.pid
>             echo "ERROR: Removed stale pid file"
>             exit 1
>         fi
> #
> # Success. Let pppd clean up its own junk.
> echo "PPP link to $DEVICE terminated."
> /sbin/route delete default
> mv /etc/ppp/options /etc/ppp/options.bak
> #/sbin/ifconfig eth0 up
> #/sbin/route add -net netmask dev lo
> #/sbin/route add default gw
> exit 0
> fi
> #
> # The PPP process is not running for ppp0
> echo "ERROR: PPP link is not active on $DEVICE"
> exit 1
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug

Paul E Condon           
pecondon at mesanetworks.net

More information about the LUG mailing list