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!