define static routes at boot

I'm running Ubuntu desktop 10.04 and on every boot the machine cannot be accessed from outside the LAN. after running sudo route add default gw 192.168.1.1 everything works as expected. Is there any way to make this happen on boot? I've tried adding a cron job but that didn't work. any ideas?

1 Answer

Add the above command to /etc/rc.local

 route add default gw 192.168.1.1

You need to remove sudo part since /etc/rc.local running as root. Anything added to this file will be executed after all other startup programs.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like