[CentOS] ip route and nexthop: the "CentOS" way

Thu Feb 2 10:28:05 UTC 2012
Nick <oinksocket at letterboxes.org>

On 01/02/12 21:06, Les Mikesell wrote:
>> Hmm...
>>
>> I just tried this and besides needing ip route "add" default
>>
>> It does not seem to work when I unplug the cable on my primary link.

Well, I should disclose that is an experiment, and I may not have explained the
config fully - see the pages I referenced for more authoritative information. I
did think I had it working but I am less sure now, and caching looks like it may
be a problem.

I should emphasise that the main question I have here is: is RHEL's scheme for
configuring routing flexible enough to accommodate such configurations?

And if it isn't, is there anything I should bear in mind when hacking a script
to do this sort of thing, in order to avoid breaking my system or generally
fighting against the system's assumptions?


> I don't think CentOS is smart enough to automatically drop routes
> associated with a NIC that is down like a Cisco would.  If you put
> routes in /etc/sysconfig/network-scripts/routes-eth? to match the
> device names, the ifup and ifdown scripts will add/remove routes when
> you manually run time to enable/disable a particular NIC,

Right; and then one NIC's state controls the routing configuration for both.  I
can't see an easy way around that.


> but that doesn't get you automatic failover.
> And with ethernet type devices it
> is pretty rare for the link to go away at the same time the packets
> stop getting through anyway.

Just to clarify, by "that" do you mean custom "routes in [..]/routes-eth?" or
the nexthop configuration I mentioned?  It'd guess the former, but I'm more
interested in the latter.

Based on some tests I suspect it works initially, then if things change, the
routing cache will keep the old non-working config until someone flushes it.
Note, I'm not sure about this either (due to the general fog of fatigue), and
I'm thinking I should try a an entirely different approach.

Thanks,

N