I have a server that has two ethernet cards, eth0 (64.94.46.199) and eth1 (66.28.98.52). eth0''s ISP has expensive, high quality bandwidth. eth1''s ISP has cheap, low quality bandwidth. I have the route set so that by default, all packets will go out through eth1: default via 66.28.98.34 dev eth1 However, I''d like to make it so that when I ssh to 64.94.46.199 (eth0, the expensive high quality ISP), the return traffic will go out through eth0. So, I typed this: $ echo "200 pnap" >> /etc/iproute2/rt_tables $ ip rule add from 64.94.46.199 lookup pnap $ ip route add default via 64.94.47.253 dev eth0 table pnap This correctly makes it route outgoing packets with source IP of 64.94.46.199 through eth0. However, the ping time suddenly goes up a lot on the last hop (you can traceroute 64.94.46.199 and see for yourself). Any idea what I did wrong? I have a hunch that my ISP''s router doesn''t like some settings in the packets I sent to it and is giving me low priority as a result, but I wouldn''t know how to tell if that was the case... (I e-mailed my ISP for help on Tuesday; still waiting.)
On Thu, Feb 14, 2002 at 04:06:19PM -0500, Philip Mak wrote:> I have a server that has two ethernet cards, eth0 (64.94.46.199) and > eth1 (66.28.98.52).Can you show what happens? So something like this: # ping some.ip.address.0 ms/ms/ms/ms # echo "200 pnap" >> /etc/iproute2/rt_tables # ip rule add from 64.94.46.199 lookup pnap # ip route add default via 64.94.47.253 dev eth0 table pnap # ping some.ip.address.0 ms/ms/ms/ms Preferably with tcpdumps illustrating where packets go out. Regards, bert -- http://www.PowerDNS.com Versatile DNS Software & Services http://www.tk the dot in .tk Netherlabs BV / Rent-a-Nerd.nl - Nerd Available - Linux Advanced Routing & Traffic Control: http://ds9a.nl/lartc
On Fri, Feb 15, 2002 at 05:16:33PM +0100, bert hubert wrote:> > I have a server that has two ethernet cards, eth0 (64.94.46.199) and > > eth1 (66.28.98.52). > > Can you show what happens? So something like this:I found out that even before I make the IP routing table changes that I mentioned in my previous message, there is already this problem. Check this out: [root@lina rc.d]# ping -r -b 64.94.47.255 WARNING: pinging broadcast address PING 64.94.47.255 (64.94.47.255) from 64.94.46.199 : 56(84) bytes of data. Warning: time of day goes back, taking countermeasures. 64 bytes from 64.94.46.199: icmp_seq=0 ttl=255 time=1.081 msec 64 bytes from 64.94.46.199: icmp_seq=1 ttl=255 time=109 usec 64 bytes from 64.94.46.35: icmp_seq=0 ttl=255 time=1.012 sec (DUP!) 64 bytes from 64.94.46.206: icmp_seq=0 ttl=255 time=1.013 sec (DUP!) 64 bytes from 64.94.46.197: icmp_seq=0 ttl=255 time=1.013 sec (DUP!) 64 bytes from 64.94.46.202: icmp_seq=0 ttl=255 time=1.013 sec (DUP!) 64 bytes from 64.94.46.200: icmp_seq=0 ttl=255 time=1.014 sec (DUP!) The above is a ping broadcast. I used the -r flag to make ping send directly to hosts on the local network, bypassing the routing tables (so that I know my routing tables are not an issue). But yet, the ping times are 1 second which is outrageous for hosts on a local network. Any ideas what I should try next? Would this be a problem with the ethernet card, network cable, switch, or any of the above?
I''m not sure what I did, but everything seems to be working correctly now. Well, I still have one problem: If the machine reboots, I lose all my settings. Can anyone point me to a good reference of how to make these settings take effect at boot time? I assume there''s a better way other than putting the commands into /etc/rc.d/rc.local. Script started on Fri Feb 15 13:34:13 2002 [root@lina route]# tail -1 /etc/iproute2/rt_tables 200 pnap [root@lina route]# ip route show 66.28.98.32/27 via 66.28.98.34 dev eth1 66.28.98.32/27 dev eth1 scope link 64.94.46.0/23 dev eth0 scope link 64.94.46.0/23 via 64.94.47.253 dev eth0 127.0.0.0/8 dev lo scope link default via 66.28.98.34 dev eth1 [root@lina route]# ip rule show 0: from all lookup local 32765: from 64.94.46.199 lookup pnap 32766: from all lookup main 32767: from all lookup 253 [root@lina route]# ip route show table pnap default via 64.94.47.253 dev eth0 [root@lina route]# Script done on Fri Feb 15 13:34:40 2002