|
I need to setup more than one PPPOE connection
I assume that installing pppoeconf via yum will take care of the pppoe connections. however i ned a script to run when ppp1 is called. The script is
Code:
#!/bin/sh -e
# Called when a new interface comes up
# add custom routing for zanet (local South Africa) on ppp1 device
if [ "$PPP_IFACE" = "ppp1" ]
then
cat /etc/ppp/localroutes4.txt | sed s/'\$LOCAL'/$PPP_IFACE/ | while read localroute
do
# Change net to host for /32 addresses
# This is a bug workaround - Armin must fix his list script.
if [[ $localroute =~ "/32" ]]
then
localroute=`echo $localroute | sed s/net/host/`
$localroute
else
$localroute
fi
done
fi
# We need to route DNS lookups via ppp0 (SAIX) instead of ppp1 (IS)
# The static routing will cause the DNS lookups to be made through the local IS
# connection and the SAIX network will block the lookups because they don't originate
# from their network.
if [ "$PPP_IFACE" = "ppp0" ]
then
cat /etc/resolv.conf | sed s/nameserver// | sed s/' '// | while read nameserver
do
route add -host $nameserver $PPP_IFACE
done
fi
This above script works in Debian (Etch/Lenny/Sid)
__________________
Desktop (64-bit) - F12, Debian Sid, OpenSUSE 11.2, ArchLinux
|