1

I have a virtual machine running on a public ip (eth0) and an internal IP (eth1/192.168.22.50).

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
address 217.22.52.79
netmask 255.255.255.192
gateway 217.22.52.65

auto eth1
iface eth1 inet static
address 192.168.22.51
netmask 255.255.255.0

If I add gateway 192.168.22.1, 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

1 Answer 1

2

After the eth1 block, add the line:

up route add -net 192.168.110.0 netmask 255.255.255.0 gw 192.168.22.1 dev eth1

This will set up a static route for the 192.168.110.0/24 network via 192.168.22.1.

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.

0

You must log in to answer this question.

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