Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 a virtual machine running on a public ip (eth0) and an internal IP (eth1/

From my place (192.168.110.x), I VPN to that network.

The problem is that I am unable to access any services running on that server (including ICMP) from the internal IP.

This is /etc/network/interfaces:

auto eth0
iface eth0 inet static

auto eth1
iface eth1 inet static

If I add gateway, the public IP is no longer accessible but the internal IP works.

I'm guessing I need to route all traffic from 192.168.22.x and 192.168.110.x through eth1 instead of eth0? How can I edit the interfaces file to fix this issue?

Kind regards, Tuinslak

share|improve this question
up vote 2 down vote accepted

After the eth1 block, add the line:

up route add -net netmask gw dev eth1

This will set up a static route for the network via

As written, this route will get added the next time you start the interface. If you want to add the route while the interface is live, just execute (with root permissions) everything after the up.

share|improve this answer
That worked -- thanks ! – Tuinslak Dec 13 '10 at 13:38

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.