Jongi |
04-15-2007 04:15 AM |
Can't route traffic between ppp0 and ppp1
I have setup two pppoe connections using kubuntu based instructions. It looks like everything is fine until the Kubuntu instructions say I must
Code:
Let's make the necessary changes to /etc/network/interfaces.
sudo kedit /etc/network/interfaces
If you scroll down to the bottom of the file you should see a block that looks like the following :
auto dsl-provider
iface dsl-provider inet ppp
provider dsl-provider
What we're going to do is duplicate the block and replace the interface names with ppp0 and ppp1 for the international and local accounts respectively.
Simply replace the block with the following :
auto ppp0
iface ppp0 inet ppp
provider international
auto ppp1
iface ppp1 inet ppp
provider local
It seems however that this is not working properly as what is meant to be ppp1 is showing up as ppp0 after boot. And what is meant to be ppp0 is not being loaded at all. This leads to the script below that routes traffic not running. I also can't shutdown ppp0 with (as root) ifdown ppp0, but have to instead run poff local. After I have shutdown ppp0 and then run ifup ppp0 and [b]ifup ppp1/b], the routing below then works.
Code:
[root:~#] cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
auto ppp0
iface ppp0 inet ppp
provider international
auto ppp1
iface ppp1 inet ppp
provider local
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
I have setup the file /etc/ppp/ip-up.d/zanet which looks like
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
|