Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i need to execute the following command on every startup

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

so i add it to rc.local

touch /var/lock/subsys/local

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

but i realise it is not being executed. Anyone knows what should it be.

share|improve this question
1  
Maybe this would be better in /etc/network/interfaces? –  Kerrek SB Apr 2 '12 at 9:03
add comment

migrated from stackoverflow.com Apr 3 '12 at 2:20

This question came from our site for professional and enthusiast programmers.

1 Answer

What happens when you run same command from command line?

There are three reasons I can guess why it may not be working. 1) route is not in the sys path on bootup....try specifying full path to route command on your system. 2) eth0 is not available at the point in time rc.local is running .... Trying adding a print ifconfig in cr.local to test. 3) the route statement is invalid, and the route program is ignoring it...running from command line should tell you

share|improve this answer
    
There's also 4) The route add ... line is added after the line exit 0 in /etc/rc.local –  Didier Trosset Apr 2 '12 at 9:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.