[CentOS] Re: Re: How to create static routes on startup with CentOS4?

Eric B. ebenze at hotmail.com
Tue Apr 15 20:36:08 UTC 2008


"Filipe Brandenburger" <filbranden at gmail.com> 
wrote in message 
news:e814db780804151317j1e3a9e15td960d074f37a6978 at mail.gmail.com...
> On Tue, Apr 15, 2008 at 3:48 PM, Eric B. 
> <ebenze at hotmail.com> wrote:
>>  The last question then is if there is a way to add "ip rule" rules to
>>  specify which routing table to use based on packet information.
>>  ex:  ip rule add fwmark 3 table 3
>>
>>  Are any of the network scripts able to handle this as well?
>
> If you look at the end of the same script (ifup-routes), you'll see
> that it reads rules from file
> /etc/sysconfig/network-scripts/rule-eth0. For each line in that file,
> it will run "/sbin/ip rule add $line". It's unfortunate that this
> isn't all better documented somewhere. But on Linux you can always...
> Use the source, Luke!

Really?  I looked through ifup-routes but I don't see anything that searches 
for rule-<ifname> anywhere.  All my ifup-routes looks for is files called 
route-$2.  Further more a quick "grep rule /etc/sysconfig/network-scripts/*" 
finds nothing.

My last two lines in ifup-routes (unless I don't know how to read them 
properly) are:
# Red Hat network configuration format
NICK=${2:-$1}
CONFIG="/etc/sysconfig/network-scripts/$NICK.route"
[ -f $CONFIG ] && handle_file $CONFIG $1

And if I look at handle_file method, I see all it does is call /sbin/ip 
route add $line.

Am I missing something obvious somewhere?  Or do you have a different 
version of ifup-routes?  I'm running CentOS4 with the latest patches....

Thanks again!

Eric






More information about the CentOS mailing list