Hi,
I normally access the internet via a gateway on my network via my ethernet card, however, I have recently had a few occasions when I needed to temporarily access an alternative ISP using a modem. To keep things simple I thought I would use kppp to setup the dial-up connection.
The modem connects to the dial-up ISP ok, establishes a ppp link, and correctly modifies /etc/resolv.conf to point at the dial-up ISP nameservers, however I cannot ping, or reach anything over the link. If I run tcpdump I instead see that the data is still being routed through my ethernet card rather than now going through the modem.
i.e: [ian@swan ian]$ ping 80.225.253.50 PING 80.225.253.50 (80.225.253.50) from 192.168.1.232 : 56(84) bytes of data. --- 80.225.253.50 ping statistics --- 90 packets transmitted, 0 packets received, 100% packet loss
If I run netstat I see:
[ian@swan ian]$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 80.225.252.38 0.0.0.0 255.255.255.255 UH 40 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo 0.0.0.0 192.168.1.1 0.0.0.0 UG 40 0 0 eth0
192.168.1.1 is my ethernet network's internet gateway machine. If I manually delete this gateway entry in the routing table and add my ptp partner I get:
[ian@swan ian]$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 80.225.252.38 0.0.0.0 255.255.255.255 UH 40 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo 0.0.0.0 80.225.252.38 0.0.0.0 UG 40 0 0 ppp0
and can happily access the internet:
[ian@swan ian]$ ping www.bbc.co.uk PING www.bbc.net.uk (212.58.224.56) from 80.40.6.31 : 56(84) bytes of data. 64 bytes from www10.thdo.bbc.co.uk (212.58.224.56): icmp_seq=0 ttl=250 time=178.495 msec
I noticed that the kppp dial-up configuration screens have a "gateway" tab. I have set this to "Default Gateway" rather than "Static Gateway" and have also selected "Assign the default route to this gateway".
Question: What silly thing am I doing wrong (or have misconfigured) to prevent kppp changing the default gateway route from the ethernet card to the modem?
Thanks,
Ian.
PS: In case it is relevant the PC involved is running Mandrake 8.2 and kppp version 2.0.9.
You have to tinker with your routing tables.
There are several cases to consider. 1.1. Your ppp route exists, even if only as a dummy, all the time, 1.2. Your ppp route does not exist at all when you are not using it, 2.1. When the ppp route exists you use it for all traffic, 2.2. When the ppp route exists you use it only for some traffic.
In all cases, define your ethernet routes as having a cost of 2 (or more). When you create the ppp connection do a 'route' command that adds it with a cost of 1. This may be for specific hosts or a default, depending on what you want.
I used to have a similar situation when most of my traffic was ethernet, but Usenet downloads had to go over a modem.
The routing algorithm in the kernel has changed somewhat since I used to do this. You might find that for case 2.2 you still want your default route to have a cost of 1 rather than 2 and to point to the ethernet.
On 17-Jan-2003 Ian Douglas wrote:
Hi,
I normally access the internet via a gateway on my network via my ethernet card, however, I have recently had a few occasions when I needed to temporarily access an alternative ISP using a modem. To keep things simple I thought I would use kppp to setup the dial-up connection.
The modem connects to the dial-up ISP ok, establishes a ppp link, and correctly modifies /etc/resolv.conf to point at the dial-up ISP nameservers, however I cannot ping, or reach anything over the link. If I run tcpdump I instead see that the data is still being routed through my ethernet card rather than now going through the modem.
i.e: [ian@swan ian]$ ping 80.225.253.50 PING 80.225.253.50 (80.225.253.50) from 192.168.1.232 : 56(84) bytes of data. --- 80.225.253.50 ping statistics --- 90 packets transmitted, 0 packets received, 100% packet loss
If I run netstat I see:
[ian@swan ian]$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 80.225.252.38 0.0.0.0 255.255.255.255 UH 40 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo 0.0.0.0 192.168.1.1 0.0.0.0 UG 40 0 0 eth0
192.168.1.1 is my ethernet network's internet gateway machine. If I manually delete this gateway entry in the routing table and add my ptp partner I get:
[ian@swan ian]$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 80.225.252.38 0.0.0.0 255.255.255.255 UH 40 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo 0.0.0.0 80.225.252.38 0.0.0.0 UG 40 0 0 ppp0
and can happily access the internet:
[ian@swan ian]$ ping www.bbc.co.uk PING www.bbc.net.uk (212.58.224.56) from 80.40.6.31 : 56(84) bytes of data. 64 bytes from www10.thdo.bbc.co.uk (212.58.224.56): icmp_seq=0 ttl=250 time=178.495 msec
I noticed that the kppp dial-up configuration screens have a "gateway" tab. I have set this to "Default Gateway" rather than "Static Gateway" and have also selected "Assign the default route to this gateway".
Question: What silly thing am I doing wrong (or have misconfigured) to prevent kppp changing the default gateway route from the ethernet card to the modem?
Thanks,
Ian.
PS: In case it is relevant the PC involved is running Mandrake 8.2 and kppp version 2.0.9.
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On Sunday, January 19, 2003 10:41 AM, Raphael Mankin wrote:
You have to tinker with your routing tables. ... define your ethernet routes as having a cost of 2 (or more). When you create the ppp connection do a 'route' command that adds it with a cost of 1. This may be for specific hosts or a default, depending on
what
you want.
I used to have a similar situation when most of my traffic was ethernet, but Usenet downloads had to go over a modem.
Thanks for sharing your experience Raphael.
I have noticed that when I boot the machine without the ethernet cable attached kppp works as expected and I can access the internet via my modem without problems. It is only once my machine has experienced a much faster route to the internet via my ethernet port that it refuses to send packets through the much slower modem. I think you may have therefore hit the nail right on the head by suggesting I look at modifying the costs of the two routes. I think your "case 2.1" covers my situation (i.e. I use the fast ethernet route to the internet all the time except when I need to temporarily access an alternative ISP for a few minutes (such as to send this email) during which time I want all internet traffic to be temporarily routed out via the modem to this secondary ISP). Thanks again for sharing this tip Raphael.
Could anyone recommend any simple guide texts about modifying routing tables suitable for a Linux beginner like myself?
Thanks,
Ian.
That is correct. If there is no cable the kernel cannot initialise the interface and so creates no routes on it. Al you are left with then is the ppp route.
On 19-Jan-2003 Ian Douglas wrote: [snip]>
I have noticed that when I boot the machine without the ethernet cable attached kppp works as expected and I can access the internet via my modem without problems. It is only once my machine has experienced a much faster route to the internet via my ethernet port that it refuses to send packets through the much slower modem. I think you may have therefore hit the nail right on the head by suggesting I look at modifying the costs of the two routes.