Super User is a question and answer site for computer enthusiasts and power users. 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 have an Ubuntu server with only one NIC and an address x.x.31.82 configured on it, the default gateway for it is x.x.31.81 and the mask is x.x.31.80/29.

The problem is that I'm trying to configure another address x.x.20.210 – the default gateway is supposed to be x.x.20.209 but I'm unable to configure it on the server.

After I've configured x.x.20.210 as an alias on the NIC, I've used the command

route add -net x.x.20.208 netmask gw x.x.20.209

The route was added to the routing table but but I still can't access x.x.20.210 from the outside.

Can anybody help me please?

share|improve this question

To use multiple IP on the same interface, the best way in my opinion is to add in /etc/network/interfaces something like that for the 2nd IP:

auto eth0:0
iface eth0:0 inet static
    address x.x.20.210
    broadcast x.x.20.255
    network x.x.20.0
    gateway x.x.20.209

And you shouldn't need to configure a route manually. If you want to access it from the outside, don't forget to add this 2nd IP to /etc/hosts and if needed, to configure a DNS record for it.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .