Network map

  localnet  +-------------------------------------+  vmnet  +--------------------+
------------|eth0          gateway            eth1|---------|eth0            vm  |
            |192.168.1.44           192.168.56.101|         |192.168.56.102      |
            +-------------------------------------+         +--------------------+

IP forwarding

Check that IP forwarding is active:

a)

_$: sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0

b)

_$: cat /proc/sys/net/ipv4/ip_forward
0

To do our tests, we will make a temporary change:

a)

_$: sysctl -w net.ipv4.ip_forward=1

b)

_$: echo 1 > /proc/sys/net/ipv4/ip_forward

If our tests work, we can make it permanent:

/etc/sysctl.conf:
-----------------
...
net.ipv4.ip_forward = 1

We must restart the service for the changes to take effect:

_$: sysctl -p /etc/sysctl.conf

In Debian/Ubuntu this can also be achieved by restarting the procps service:

_$: /etc/init.d/procps.sh restart   # Debian
_$: service procps restart          # Ubuntu