Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
SDN 101: An Introduction to Software Defined Networking
Discover the advantages of SDN.
SDN has quickly become one of the hottest trends in IT. But not all SDN solutions offer real software-defined functionality. As more enterprises consider SDN, they want to know, “What is SDN? And what are the real benefits?” If you're ready to explore the advantages of SDN, and want to know how it should be implemented within your enterprise, start by reading our introductory white paper.
Click Here to receive this Complete Guide absolutely free.
I've been thinking about it. I think the command I posted will not work... not even if it's taken as the default route.
That's because packets will be sent out throw a given device... but won't be sent to the gateway. In other words, I have to include the GWs addresses in the commmand (nexthop via x dev y). Do you agree?
eth0 = 192.168.1.200 (Sprint)
eth2 = 192.168.0.200 (Telus)
In /etc/iproute2/rt_tables, add:
ip route add 192.168.1.0/24 dev eth0 src 192.168.1.200 table Sprint
ip route add default via 192.168.1.1 table Sprint
ip route add 192.168.0.0/24 dev eth2 src 192.168.0.200 table Telus
ip route add default via 192.168.0.1 table Telus
ip route show table Telus
ip route show table Sprint
ip rule add from 192.168.1.200 table Sprint
ip rule add from 192.168.0.200 table Telus
ip route add default scope global nexthop via 192.168.1.1 dev eth0 weight 1 \
nexthop via 192.168.0.1 dev eth2 weight 1
[root@wifi root]# ip route
192.168.1.0/24 dev eth0 scope link
192.168.0.0/24 dev eth2 proto kernel scope link src 192.168.0.200
127.0.0.0/8 dev lo scope link
nexthop via 192.168.1.1 dev eth0 weight 1
nexthop via 192.168.0.1 dev eth2 weight 1
[root@wifi root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth2
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
[root@wifi root]# ip rule
0: from all lookup local
32764: from 192.168.0.200 lookup Telus
32765: from 192.168.1.200 lookup Sprint
32766: from all lookup main
32767: from all lookup default
[root@wifi root]# traceroute -m 5 google.ca
traceroute: Warning: google.ca has multiple addresses; using 126.96.36.199
traceroute to google.ca (188.8.131.52), 5 hops max, 38 byte packets
1 674895464.globetrotter.net (184.108.40.206) 1.642 ms 1.379 ms 1.363 ms
2 220.127.116.11 (18.104.22.168) 18.712 ms 18.588 ms 16.905 ms
3 22.214.171.124 (126.96.36.199) 19.910 ms 17.179 ms 17.939 ms
4 mtrlpqfbgr00.bb.telus.com (188.8.131.52) 103.860 ms 122.291 ms 104.239 ms
MPLS Label=202 CoS=3 TTL=1 S=0
5 MTRLPQFBBR00.bb.telus.com (184.108.40.206) 105.419 ms 110.047 ms 102.544 ms
MPLS Label=297 CoS=3 TTL=1 S=0
[root@wifi root]# traceroute -m 5 wificountry.ca
traceroute to wificountry.ca (220.127.116.11), 5 hops max, 38 byte packets
1 6bdfug980..dedicated.sprintdsl.ca (18.104.22.168) 2.182 ms 1.780 ms 2.135 ms
2 mtl149-99-189-69.dedicated.sprintdsl.ca (22.214.171.124) 14.238 ms 9.683 ms 10.541 ms
3 g8-0-3-S1.bb1.mtl1.sprint-canada.net (126.96.36.199) 9.241 ms 12.278 ms g8-0-4-S1.bb1.mtl1.sprint-canada.net (188.8.131.52) 13.762 ms
4 g7-0-S1.bb2.mtl1.sprint-canada.net (184.108.40.206) 13.472 ms 11.159 ms 8.969 ms
5 as15290gw.mtl1.sprint-canada.net (220.127.116.11) 10.347 ms 13.975 ms 18.451 ms
1st: Good you got it working... I hope to say the same in a short time.
2nd: I tried to follow those instructions yesterday, but didn't get it working. I later realized it was because the kernel I was using (knoppix's, because we were just testing) didn't have multipath support (I later tried with mdk, which did have it... and was succesful at trying a single default route with two nexthops). What distribution are you using?
3rd: There's another level of difficulty for my problem. You got static routes.... and that's cool. But I depend on addresses provided by dhcp.... therefore I guess I'll just have to make scripts to handle setting the addresses of the nexthop's via and so on whenever there's a change in the addresses.