Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Oct 31, 2005 1:41 pm 
Offline
Senior Newbie

Joined: Mon Oct 31, 2005 1:30 pm
Posts: 7
Website: http://www.petmystone.com/
Location: MD and DE
Back from IRC, now just looking for the confidence that I did it right. :) A lot of the samples and posts on the board look geared toward Debian.

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
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
64.x.x.0        *               255.255.255.0   U         0 0          0 eth0
70.x.x.0        *               255.255.255.0   U         0 0          0 eth0
169.x.0.0       *               255.255.0.0     U         0 0          0 eth0
default         gateway         0.0.0.0         UG        0 0          0 eth0
default         gateway1        0.0.0.0         UG        0 0          0 eth0


Another view using route:
Code:
[user@host ~]$ /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
64.x.x.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
70.x.x.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.x.0.0       0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         64.x.x.1        0.0.0.0         UG    0      0        0 eth0
0.0.0.0         70.x.x.1        0.0.0.0         UG    0      0        0 eth0


Last edited by javafueled on Wed Nov 02, 2005 10:26 pm, edited 4 times in total.

Top
   
PostPosted: Tue Nov 01, 2005 5:53 am 
Offline
Senior Member

Joined: Sat Dec 04, 2004 5:36 pm
Posts: 145
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
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
64.x.x.0        *               255.255.255.0   U         0 0          0 eth0
70.x.x.0        *               255.255.255.0   U         0 0          0 eth0
169.x.0.0       *               255.255.0.0     U         0 0          0 eth0
default         gateway         0.0.0.0         UG        0 0          0 eth0
default         gateway1        0.0.0.0         UG        0 0          0 eth0


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. :) But networking in general, can give pointers.


Top
   
 Post subject:
PostPosted: Tue Nov 01, 2005 7:04 pm 
Offline
Senior Newbie

Joined: Mon Oct 31, 2005 1:30 pm
Posts: 7
Website: http://www.petmystone.com/
Location: MD and DE
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. :) Now, that noted, the problem I'm having is that FC2 (and RHL and FC[1-4] for that matter) have serious documentation and legacy configuration issues, that I'm finding very hard to navigate. It's frustrating to no end. Putting the directives in rc.local was the only way to make it work, because, as Linode notes, "the right way" (for [insert distro]) does not seem to behave at all.

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.

_________________
--
Witty tag line here.


Top
   
 Post subject: And now for the LARTC
PostPosted: Wed Nov 02, 2005 10:40 pm 
Offline
Senior Newbie

Joined: Mon Oct 31, 2005 1:30 pm
Posts: 7
Website: http://www.petmystone.com/
Location: MD and DE
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
64.x.x.0/24 dev eth0  proto kernel  scope link  src 64.x.x.x
70.x.x.0/24 dev eth0  proto kernel  scope link  src 70.x.x.x
169.254.0.0/16 dev eth0  scope link
default
        nexthop via 70.x.x.1  dev eth0 weight 1
        nexthop via 64.x.x.1  dev eth0 weight 1


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.

_________________
--

Witty tag line here.


Top
   
PostPosted: Sat Nov 05, 2005 3:25 pm 
Offline
Senior Newbie

Joined: Mon Oct 31, 2005 1:30 pm
Posts: 7
Website: http://www.petmystone.com/
Location: MD and DE
I just documented my findings in the linode wiki. Constructive criticism welcome.

Multiple IPs

_________________
--

Witty tag line here.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group