2
As a development environment for my production server I have setup a Virtualbox guest.
However I am failing to setup an OpenVPN Server. I can connect to my VPN without problems using (KDE NetworkManager) but I cannot even ping the VPN host afterwards.
It is my understanding that this is a routing issue. Before I connect to my VPN the routing table looks like this:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.64.64.64 0.0.0.0 UG 0 0 0 ppp0
10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
33.33.33.0 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
The table looks like this after I connected to the VPN:
$ sudo route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.64.64.64 0.0.0.0 UG 0 0 0 ppp0
10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0
10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
33.33.33.0 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet0
33.33.33.24 10.64.64.64 255.255.255.255 UGH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
Please note: I do not want to use my VPN as a gateway, so I don't bother about forwarding packages. I only want to be able to access the server (e.g. apache) on a VPN address besides its public address, so I do not set it as a default gw.
The problem seems to me is that the address 33.33.33.24 cannot be reached on interface ppp0 as it is a local address reachable on vboxnet0
$ ping 10.8.0.1
PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data.
^C
--- 10.8.0.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
The exact same setup works as expected when I run it on a real server which gateway can be accessed by ppp0:
$ sudo route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.64.64.64 0.0.0.0 UG 0 0 0 ppp0
10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0
10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
33.33.33.0 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet0
<real_gw_ip> 10.64.64.64 255.255.255.255 UGH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
$ ping 10.8.0.1
PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data.
64 bytes from 10.8.0.1: icmp_seq=1 ttl=64 time=782 ms
64 bytes from 10.8.0.1: icmp_seq=2 ttl=64 time=122 ms
^C
--- 10.8.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
I I'm kinda stuck because I can't wrap my head around how to correctly setup routing or NAT to achieve what I want, i.e.: access the VMBox on 33.33.33.24 on VPN via 10.8.0.1.
Any help is much appreciated. I didn't include further configs (ifconfig, syslog) for now to keep the post shorter, because they seem ok to me (IP addresses assigned, iptables all flushed for testing etc.) and as outlined above I think I got a nutch on what causes the problem so please correct me if I'm wrong.