HowTo: Add a Persistent Static Route in Redhat Enterprise Linux

11 Comments

  1. Apparently your syntax is also supported, but the latest search I did of the RHEL4 support documentation yields the following URL for persistent static routes and the syntax of the route-ethX file:

    http://kbase.redhat.com/faq/FAQ_45_9670.shtm

    The Redhat recommended syntax is:
    10.0.1.0/24 via 192.168.2.4 dev eth0
    or
    default via 192.168.2.4 dev eth0

  2. how to add permant route in RHEL4 is any file in that i need to change any conf

  3. I have one problem. I need add static route under /etc/sysconfig/network-scripts/route-eth0.2 and
    /etc/sysconfig/network-scripts/route-eth0.3.

    route-eth0.2
    GATEWAY0=192.168.1.1 ( this is vlan 2 ip address configured in router)
    NETMASK0=255.0.0.0
    ADDRESS0=10.0.0.0

    route-eth0.3
    GATEWAY0=192.168.2.1( this is vlan 3 ip address configured in router)
    NETMASK0=255.0.0.0
    ADDRESS0=10.0.0.0

    the problem is destination IP address is same. the different is gateway address. because, VLAN2(etho.2) and VLAN 3(eth0.3) are routed by different paths( i mean different layer-3 devices)

    once i add those and restart the network services, it shows only one route for that destination

    could you please help me to figure out the problem

  4. it worked for me by using the following command:
    route add [ipadd] netmask [mask] gw [gateway] interface name

  5. Hii, Its work for me with route-dev file, Thanks man

  6. Hi, thanks a lot for your article is very helpful for me, thanks a lot man

  7. freaking RHEL… what a pain.
    can just add a -p switch or something to the route add command like solaris does… no, you have to go in and edit some obscure file and add three stanzas

  8. freaking RHEL… what a pain.
    can’t just add a -p switch or something to the route add command like solaris does… no, you have to go in and edit some obscure file and add three stanzas

  9. Gr8..It works!

  10. Thanks.

    It’s works very well on my Red Hat Linux Server release 5

Leave a Reply

Your email address will not be published. Required fields are marked *