LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 04-15-2007, 04:15 AM   #1
Jongi
Senior Member
 
Registered: Aug 2003
Distribution: Debian Sid 32/64-bit, F10 32/64-bit
Posts: 1,070

Rep: Reputation: 45
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

Last edited by Jongi; 04-15-2007 at 04:37 AM.
 
Old 04-15-2007, 05:35 AM   #2
Jongi
Senior Member
 
Registered: Aug 2003
Distribution: Debian Sid 32/64-bit, F10 32/64-bit
Posts: 1,070

Original Poster
Rep: Reputation: 45
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.

Last edited by Jongi; 04-15-2007 at 05:38 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about route add default ppp0??? marsh58 Linux - Networking 3 06-26-2006 08:59 AM
pppoe dialed twice - I got ppp0 and ppp1 carboncopy Linux - Networking 1 10-23-2005 01:15 AM
routing ppp0 & ppp1 hariiyer Linux - Networking 1 09-09-2005 05:48 AM
ppp0 default route jjj0001 Linux - Networking 1 04-08-2005 12:45 AM
ppp0/route problem. Noryungi Slackware 2 07-08-2003 04:51 PM


All times are GMT -5. The time now is 10:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration