| Linode Forum https://forum.linode.com/ |
|
| Multple IPs on FC2, route table sample (and the LARTC) https://forum.linode.com/viewtopic.php?f=19&t=1935 |
Page 1 of 1 |
| Author: | javafueled [ Mon Oct 31, 2005 1:41 pm ] |
| Post subject: | Multple IPs on FC2, route table sample (and the LARTC) |
Back from IRC, now just looking for the confidence that I did it right. I followed the members.cfm notes. Googled. Got it, finally, working...I think. Can anyone provide a sample netstat -r? I have two IPs on different subnets. I have alias one IP to eth0:0. I have added route add default gw 64.x.x.x and route add default gw 70.x.x.x to my /etc/rc.local (because I could not get it work any other way; even FC4 seems conflicted in how this should be done between legacy formats and generally no documentation on the distro way of doing it, but I digress). My route table looks like this now: Code: Kernel IP routing table Another view using route: Code: [user@host ~]$ /sbin/route -n |
|
| Author: | tronic [ Tue Nov 01, 2005 5:53 am ] |
| Post subject: | Re: Multple IPs on FC2, route table sample |
javafueled wrote: I have two IPs on different subnets. I have alias one IP to eth0:0. I have added route add default gw 64.x.x.x and route add default gw 70.x.x.x to my /etc/rc.local (because I could not get it work any other way; even FC4 seems conflicted in how this should be done between legacy formats and generally no documentation on the distro way of doing it, but I digress).
My route table looks like this now: Code: Kernel IP routing table Not a bad start. Wanted to make sure you understood something. You can't have two default gateways active at the same time. Concept of 'default gateway' is: 'if nothing else matches, send packets here'. There can only be one default gateway active, because if you think about it, 'if nothing else matches' means there can be only ONE remaining match. Linux allows you to have two default gateways listed because, if the first gateway is completely down, it will attempt to use the next listed default gateway instead. One gateway is active at a time, even though two are listed. If that is how you intended to use the multiple default gateways, then great. If this was not how you planned it, then you'll need to rethink your goal and arrangement. What exactly is your goal? Are you doing this as a failover scenario of some sort? You want to route certain traffic out of a specific interface only? (If so, shouldn't need the default route for diverting a specific subnet through a particular interface.) I'm afraid I'm not much help with distro-specific stuff like for Debian or FC4, since I'm more familiar with Gentoo. Sorry. |
|
| Author: | javafueled [ Tue Nov 01, 2005 7:04 pm ] |
| Post subject: | |
Quote: You can't have two default gateways active at the same time. Concept of 'default gateway' is: 'if nothing else matches, send packets here'. You know, I thought that too. But the linode documentation implies other. https://www.linode.com/members/netinfo.cfm (login required). The relevant part being: Quote: You can add these commands to your rc startup script to have the IPs configured at boot time. Or, use your distribution's configuration tools to do it 'the right way'. If you have IPs in different subnets, make sure to do "route add default gw x.x.x.x" for each Gateway listed in the table above. So, that's what I did. Clearly Debian has the advantage here with it's interface configuration scripts. Those scripts clearly imply that each interface can have a gateway. Supposedly, FC[1-4] can too, but I can't for the life of me get /etc/sysconfig/network-scripts/(route-eth0||route-eth0:0) to load, /etc/init.d/network does not call or source these scripts, and if it supposed to work some particular way, someone show me because its a charlie-foxtrot. But I digress... Quote: If that is how you intended to use the multiple default gateways, then great. If this was not how you planned it, then you'll need to rethink your goal and arrangement.
What exactly is your goal? Are you doing this as a failover scenario of some sort? You want to route certain traffic out of a specific interface only? (If so, shouldn't need the default route for diverting a specific subnet through a particular interface.) I believe my goal was the latter, but I believe I really was trying to follow the Linode documentation. :/ My plans include an Apache server with an IP for NameVirtualHosts and an IP for SSL (an IP-based host). Many thanks for your reply. Maybe you can shed some light on what Linode is trying to say, versus what is implemented in practice. |
|
| Author: | javafueled [ Wed Nov 02, 2005 10:40 pm ] |
| Post subject: | And now for the LARTC |
Learning a lot about Linux routing. So this is how I've settled out my configuration, flames to /dev/null, constructive criticism welcome. From LARTC, sect. 4.2.2, "Routing for multiple uplinks/providers: Load Balancing" Code: [root@host root]# ip route show I added this to /etc/rc.local: ip route add default scope global \ nexthop via 70.x.x.1 dev eth0 weight 1 \ nexthop via 64.x.x.1 dev eth0 weight 1 This effectively meets the recommendations of Linode's notes on adding additional IPs without a confusing "second default" route. |
|
| Author: | javafueled [ Sat Nov 05, 2005 3:25 pm ] |
| Post subject: | See wiki for more information |
I just documented my findings in the linode wiki. Constructive criticism welcome. Multiple IPs |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|