Announcement

Collapse
No announcement yet.

add static route

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    add static route

    Hi,

    I need to have a permanent route to a network in the routing table. If I put in the console the command

    route add -net 16.1.0.0 netmask 255.255.0.0 dev eth0

    everythin works fine but when I reboot the system I have to do it again!!! and I need to do it automatically!

    I tried putting one script in /etc/init.d with a link in /etc/rc2.d but it's not working. I also modified the /etc/rc.local file but it was the same...

    Where do I have to modify to succeed

    Greetings,
    Samuel.

    #2
    Re: add static route

    Originally posted by filete_lecter
    Hi,

    I need to have a permanent route to a network in the routing table. If I put in the console the command

    route add -net 16.1.0.0 netmask 255.255.0.0 dev eth0

    everythin works fine but when I reboot the system I have to do it again!!! and I need to do it automatically!

    I tried putting one script in /etc/init.d with a link in /etc/rc2.d but it's not working. I also modified the /etc/rc.local file but it was the same...

    Where do I have to modify to succeed

    Greetings,
    Samuel.

    edit the "/etc/rc.local" file and add:

    /sbin/route add -net 16.1.0.0 netmask 255.255.0.0 dev eth0

    just before the "exit 0"

    be sure to put the full path ( /sbin/route instead of route ) and check the execution bit. Should work ..

    Comment


      #3
      Re: add static route

      thinking a bit more, there a more "elegant" way.

      Edit the interface file:

      heres a howto that describe how:

      http://www.cyberciti.biz/tips/config...x-systems.html

      Comment

      Working...
      X