Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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?

share|improve this question
up vote 2 down vote accepted

Add the above command to /etc/rc.local

 route add default gw

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.

share|improve this answer
Thanks! I'll try that and report back. It may be a while since I'm away from the server and, because of this problem, am reluctant to restart it remotely. – edc1591 Mar 31 '11 at 23:30
it worked! thanks – edc1591 Apr 5 '11 at 16:31

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.