FAQ
Greetings!

I have defined a few routes and rules with:

ip route add ...
ip rule add ...

And now I'd like to persist those so they're loaded when the system boots up.

I'm doing this by means of calling a specific script from
/etc/rc.d/rc.local but I believe there must be something cleaner than
that, like another existing file.

Thanks in advance,
Diogo

Search Discussions

  • Justin Yao at Sep 11, 2009 at 8:35 pm
    you can add the routes to:
    /etc/sysconfig/network-scripts/route-eth0
    /etc/sysconfig/network-scripts/route-eth1
    etc.

    check script /etc/sysconfig/network-scripts/ifup-routes for details

    On Fri, Sep 11, 2009 at 2:06 PM, Diogo Sperb Schneider wrote:

    Greetings!

    I have defined a few routes and rules with:

    ip route add ...
    ip rule add ...

    And now I'd like to persist those so they're loaded when the system boots
    up.

    I'm doing this by means of calling a specific script from
    /etc/rc.d/rc.local but I believe there must be something cleaner than
    that, like another existing file.

    Thanks in advance,
    Diogo
    _______________________________________________
    CentOS mailing list
    CentOS at centos.org
    http://lists.centos.org/mailman/listinfo/centos
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.centos.org/pipermail/centos/attachments/20090911/3b1483be/attachment.html
  • David Hrbáč at Sep 12, 2009 at 8:29 pm

    Diogo Sperb Schneider napsal(a):
    Greetings!

    I have defined a few routes and rules with:

    ip route add ...
    ip rule add ...

    And now I'd like to persist those so they're loaded when the system boots up.

    I'm doing this by means of calling a specific script from
    /etc/rc.d/rc.local but I believe there must be something cleaner than
    that, like another existing file.

    Thanks in advance,
    Diogo
    Hi,

    --[ File: /etc/sysconfig/static-routes ]--(0644, root, root,
    122)---------------
    any net 192.168.36.0 netmask 255.255.255.0 gw 192.168.38.254
    any net 192.168.37.0 netmask 255.255.255.0 gw 192.168.38.253

    David Hrb??
  • John R Pierce at Sep 12, 2009 at 9:32 pm

    David Hrb?? wrote:
    Diogo Sperb Schneider napsal(a):
    I have defined a few routes and rules with:

    ip route add ...
    ip rule add ...
    --[ File: /etc/sysconfig/static-routes ]--(0644, root, root,
    122)---------------
    any net 192.168.36.0 netmask 255.255.255.0 gw 192.168.38.254
    any net 192.168.37.0 netmask 255.255.255.0 gw 192.168.38.253
    but how do you add

    ip rule ...

    with that? AFAIK, that file is processed with the legacy route(8)
    command, which has somewhat different syntax than the newer ip(8) command
  • Barry Brimer at Sep 13, 2009 at 4:11 am

    I have defined a few routes and rules with:

    ip route add ...
    ip rule add ...
    but how do you add

    ip rule ...
    /etc/syscontfig/network-scripts/rule-ethX
    /etc/syscontfig/network-scripts/route-ethX

    Check out /etc/sysconfig/network-scripts/ifup-routes to see exactly how
    things are processed.

    Barry
  • Diogo Sperb Schneider at Sep 14, 2009 at 10:18 am

    /etc/syscontfig/network-scripts/rule-ethX
    Check out /etc/sysconfig/network-scripts/ifup-routes to see exactly how
    things are processed.
    Sorry, but I can't see how ifup-routes will ever process rule-ethX. A
    quick search for "rule" on ifup-routes (on any file in the
    network-scripts directory) gets no results.

    Routes are OK, though.
  • Diogo Sperb Schneider at Sep 14, 2009 at 10:23 am

    Sorry, but I can't see how ifup-routes will ever process rule-ethX. A
    quick search for "rule" on ifup-routes (on any file in the
    network-scripts directory) gets no results.
    Are we running the same version? Mine is CentOS release 4.8 (Final).
  • Filipe Brandenburger at Sep 14, 2009 at 2:22 pm
    Hi,

    On Mon, Sep 14, 2009 at 06:23, Diogo Sperb Schneider
    wrote:
    Sorry, but I can't see how ifup-routes will ever process rule-ethX. A
    quick search for "rule" on ifup-routes (on any file in the
    network-scripts directory) gets no results.
    Are we running the same version? Mine is CentOS release 4.8 (Final).
    AFAIR, the rule-ethX files (and maybe also route-ethX files) work in
    CentOS 5 only. If you're doing that on CentOS 4, I believe the way for
    you to load those rules during reboot is adding them to
    /etc/rc.local...

    HTH,
    Filipe
  • Diogo Sperb Schneider at Sep 14, 2009 at 5:49 pm

    2009/9/14 Filipe Brandenburger <filbranden at gmail.com>:
    Hi,

    AFAIR, the rule-ethX files (and maybe also route-ethX files) work in
    CentOS 5 only. If you're doing that on CentOS 4, I believe the way for
    you to load those rules during reboot is adding them to
    /etc/rc.local...
    I see there are commands for route-ethX files, but not for rule-ethX,
    so I'll keep those in rc.local as you suggested. Thanks!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedSep 11, '09 at 8:06p
activeSep 14, '09 at 5:49p
posts9
users6
websitecentos.org
irc#centos

People

Translate

site design / logo © 2018 Grokbase