LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Can't route traffic between ppp0 and ppp1 (https://www.linuxquestions.org/questions/debian-26/cant-route-traffic-between-ppp0-and-ppp1-546169/)

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


Jongi 04-15-2007 05:35 AM

Thius is what I need to do after login to ensure the interfaces are setup properly

Code:

[root:~#] ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:85:F8:D2:F9
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::214:85ff:fef8:d2f9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:37 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3907 (3.8 KiB)  TX bytes:6621 (6.4 KiB)
          Interrupt:185 Base address:0xc400

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:101 errors:0 dropped:0 overruns:0 frame:0
          TX packets:101 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:26173 (25.5 KiB)  TX bytes:26173 (25.5 KiB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:196.209.xxx.xxx  P-t-P:196.209.xxx.xxx  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:122 (122.0 b)  TX bytes:183 (183.0 b)

[root:~#] poff local
[root:~#] poff international
/usr/bin/poff: No pppd is running.  None stopped.
[root:~#] ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:85:F8:D2:F9
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::214:85ff:fef8:d2f9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4087 (3.9 KiB)  TX bytes:6741 (6.5 KiB)
          Interrupt:185 Base address:0xc400

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:107 errors:0 dropped:0 overruns:0 frame:0
          TX packets:107 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:27997 (27.3 KiB)  TX bytes:27997 (27.3 KiB)

[root:~#] ifup ppp0
ifup: interface ppp0 already configured
[root:~#] ifup ppp1
ifup: interface ppp1 already configured
[root:~#] ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:85:F8:D2:F9
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::214:85ff:fef8:d2f9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4087 (3.9 KiB)  TX bytes:6741 (6.5 KiB)
          Interrupt:185 Base address:0xc400

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:110 errors:0 dropped:0 overruns:0 frame:0
          TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:28097 (27.4 KiB)  TX bytes:28097 (27.4 KiB)

[root:~#] ifdown ppp0
/usr/bin/poff: No pppd is running.  None stopped.
[root:~#] ifdown ppp1
/usr/bin/poff: No pppd is running.  None stopped.
[root:~#] ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:85:F8:D2:F9
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::214:85ff:fef8:d2f9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4087 (3.9 KiB)  TX bytes:6741 (6.5 KiB)
          Interrupt:185 Base address:0xc400

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:116 errors:0 dropped:0 overruns:0 frame:0
          TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:29921 (29.2 KiB)  TX bytes:29921 (29.2 KiB)

[root:~#] ifup ppp0
Plugin rp-pppoe.so loaded.
[root:~#] ifup ppp1
Plugin rp-pppoe.so loaded.
[root:~#] ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:85:F8:D2:F9
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::214:85ff:fef8:d2f9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:69 errors:0 dropped:0 overruns:0 frame:0
          TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6280 (6.1 KiB)  TX bytes:8806 (8.5 KiB)
          Interrupt:185 Base address:0xc400

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:122 errors:0 dropped:0 overruns:0 frame:0
          TX packets:122 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:31745 (31.0 KiB)  TX bytes:31745 (31.0 KiB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:41.244.xxx.xxx  P-t-P:41.241.xxx.xxx  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:587 (587.0 b)  TX bytes:287 (287.0 b)

ppp1      Link encap:Point-to-Point Protocol
          inet addr:196.209.xxx.xxx  P-t-P:196.209.xxx.xxx  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:122 (122.0 b)  TX bytes:122 (122.0 b)

[/code]

What is also strange is that after a while (5 or so minutes), I lose internet connectivity and I have to do ifdown pp0 and ifdown ppp1 and then redo ifup ppp0 and ifup ppp1.


All times are GMT -5. The time now is 07:26 AM.