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

Recently, I am trying to add a default gateway to my ubuntu machine to be able to send/receive packets from an another LAN through the router. However, everything I do the result is the following:

    vag@ubuntu:~$ route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     1      0        0 eth0
    x.y.z.w     U     1000   0        0 eth0         UG    0      0        0 eth0

What I am trying to do (at least I think) is to create a line with the given information  xx     xxx xxxx        xxxx

I don't want to have connection on the internet and this is what I think Destination and gateway represent in the above table. I want just to connect to the LAN.

Any ideas?

share|improve this question

The command you have to run is:

sudo route add -net netmask gw
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.