I've searched and tried a few suggestions but I haven't been able to get this to work, yet...

My host is running Ubuntu. I installed VirtualBox, created a host-only adapter, set the host IP to, and I switched off the adapter's DHCP server. Then I created the guest (Win XP), and set the IP to and set the DG to I can ping from the Host to the Guest and vice versa.

Then I installed OpenVPN on the host. Created my own CA, server certs/key and client cert/key. Set the OpenVPN server conf to PUSH the route to any VPN clients. I set my router to forward UDP 1194 to the OpenVPN server and tested the connection.

The OpenVPN client is Debian running on another laptop. Once the VPN tunnel is established the VPN Client ( can ping the VPN Host ( and vice versa. The Client can also ping the Hosts 'host-only' IP at with no issues.

My problem is getting the Open VPN Client ( talking to the VM Guest ( I don't think the VM Guest (XP) is aware that the VPN Client exists, it has no way to route traffic/responses to

Can you 1) tell me what step(s) I'm missing and 2) how to fix this?


IPTABLES output from the OpenVPN server / VirtualBox host...

root@xxxxxxxxxxxx:~# iptables -L -nv
Chain INPUT (policy ACCEPT 48 packets, 53304 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 35 packets, 2992 bytes)
 pkts bytes target     prot opt in     out     source               destination

SOLUTION The missing piece was ip forwarding. I needed to edit /etc/sysctl.conf and change this:

# Uncomment the next line to enable packet forwarding for IPv4

to this

# Uncomment the next line to enable packet forwarding for IPv4

Thanks Hauke Laging!

  • What does "talking to the VM Guest" mean, ping only? This problem may have nothing to do with both VirtualBox and OpenVPN but only with Windows firewall settings. But in order to make that clear add the output of iptables -L -nv to your question. Commented Mar 29, 2014 at 14:39
  • Yes, by "talking to the VM Guest" i mean a working ping between the XP VM running on the OpenVPN server and the OpenVPN client. (OpenVPN clinet and server can communicate with one another no problem.) I'll edit the original post with the IPTABLES output... Commented Mar 29, 2014 at 15:07
  • OK, the firewall does not block the routing (it is disabled). But is the system configured for routing? Is the output of cat /proc/sys/net/ipv4/ip_forward 0 or 1? Commented Mar 29, 2014 at 18:57
  • Thanks a million! It's working now. IP forwarding was not set I ran "sysctl net.ipv4.ip_forward=1" and it works fine now. Commented Mar 29, 2014 at 21:08
  • I have made this information an answer now which you can accept in order to show the users of this site that your question has been answered. Commented Mar 29, 2014 at 22:39

1 Answer 1


You have to check whether the firewall configuration allows forwarding:

iptables -L -nv

But it is not enough to configure the firewall to allow routing. The routing feature itself must be enabled in the kernel. If the kernel does not even try to route then it does not matter whether the firewall would let the packets through or not. You can check the routing state with

cat /proc/sys/net/ipv4/ip_forward

That returns either 1 (routing enabled) or 0 (routing disabled) with the latter usually being the default. You can change this setting with

echo 1 >/proc/sys/net/ipv4/ip_forward

A permanent change can be made e.g. via /etc/sysctl.conf.

You must log in to answer this question.

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