Figure 4: Startup files for Linux routers
/etc/rc.local startup script, both machines:
#! /bin/sh
### "router" stuff 6/95 jf
setserial /dev/ttyS0 spd_hi
sh /etc/ppp/ppplogin
/etc/rc.inet2 modifications, both machines:
#! /bin/sh
...
if [ -f ${NET}/gated ]
then
echo -n " gated"
${NET}/gated
fi
...
/etc/ppp/ppplogin script, local machine:
#!/bin/sh
## Token-ring with proxyarp
/usr/lib/ppp/pppd crtscts netmask 255.255.255.0 proxyarp passive
:167.195.160.115 /dev/ttyS0 38400
echo "Point-to-point network started."
sleep 3
exit
/etc/ppp/ppplogin script, remote machine:
#!/bin/sh
/usr/lib/ppp/pppd /dev/ttyS0 38400 netmask 255.255.255.0 passive defaultroute
echo "Point-to-point network started."
sleep 3
exit
/etc/ppp/rc.inet1 modifications, local machine:
...
# Edit for your setup. Please use your own IP addresses and networks!
IPADDR="167.195.160.6"
NETMASK="255.255.255.0"
NETWORK="167.195.160.0"
BROADCAST="167.195.160.255"
GATEWAY="167.195.160.1" # Internet router
...
/sbin/route add default gw ${GATEWAY} metric 1
...
/etc/ppp/rc.inet1 modifications, remote machine:
...
#### JF: CHANGED eth0 to tr0, for obvious reasons ;-) , got rid of GATEWAY
#### stuff because ppp does its own default route.
# Edit for your setup.
IPADDR="167.195.166.1"
NETMASK="255.255.255.0"
NETWORK="167.195.166.0"
BROADCAST="167.195.166.255"
# GATEWAY="167.195.160.6" # ppp will handle gateway
...
# /sbin/route add default gw ${GATEWAY} metric 1
...
|