Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 trying to perform an update using the normal sudo apt-get update. However my main ethernet does not have access to the outside world (long story I think I purposely did this and forgot how I did it to undo it). I have another network card in there that I plug in for just to get internet. When I ping using the second network card I can ping and with the first I can not. So after that long story, apt-get will only try to use the first network card and fail to get a reply back from the internet. I was wondering if there was a way to force apt-get to use a certain eth to retrieve updates?

share|improve this question
Also please note I can not take the first eth down because it is used in a bridge to virtual machines – dko May 1 '11 at 23:02
in terminal enter route, then post the values here or just tell us which interface is used for "default", this is the default gateway if it shows eth0 it's wrong if it's eth1 it's ok – DemonWareXT May 2 '11 at 13:46
up vote 1 down vote accepted

If the default gateway does not point to eth1 (or what is used for internet) enter this in the terminal:

sudo route add default gw dev eth1

where the x's are your gateway, your router at home or if you only have a modem the gateway designated by your internet service provider

share|improve this answer

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.