Alternative Title: OpenVPN Test Setup with VMs turned out not to be a good idea
I have two hosted servers rented in a data center which are running a couple of VMs. Both of them have their internal network on something like 192.168.0.*. Both of them are connected to the internet (of course) and the VMs have ports forwarded to the internet such as http on some or ssh on most.
Now I want to connect those two internal networks with an openVPN tunnel. Background is, that one of the VMs is running a LDAP which should be accessed by all others. Because there may be other services shared between both root servers in the future, it's probably easier to handle encryption separately by the vpn and not by each individual application.
To try the configuration in a test scenario, I set up 4 VMs locally on my desktop using VirtualBox (Bridged Mode). There are two subnets, each with two VMs. There is also a third subnet connecting one VM of each subnet.
The problem is, I can ping from VM 3 to VM 4 and the other way around even without the VPN running. There is nothing in the routing tables except the default gateway (tested with "route"). This works as soon as VM 1 and VM 2 are both up. Emptying the arp cache ("ip neigh flush") did not help. So this scenario is certainly not a good idea to test an example configuration. Has anyone a better idea?
-------------------------- -----------------
| VM 2 | | VM 3 |
|OVPN-Server | Network 1 |IP: |
|eth1: 192.168.177.20----|--------------------------|192.168.177.30 |
|eth1:0: 192.168.179.20 | 192.168.177.0/24 |Gateway: |
|tun0: 10.0.0.1 | |192.168.177.20 |
|Gw: 192.168.177.20 | | |
-------------------------- -----------------
| | Internet
| |
| |
| | Network 2: OpenVPN
| | 10.0.0.0/24
| |
| |
-------------------------- -----------------
| VM 1 | | VM 4 |
|OVPN-Client | Network 3 | |
|eth2: 192.168.178.10--|--------------------------|192.168.178.40 |
|eth2:0: 192.168.179.10 | 192.168.178.0/24 |Gateway: |
|tun0: 10.0.0.6 (dhcp) | |192.168.178.10 |
|Gw: 192.168.178.10 | | |
-------------------------- -----------------
VM1,3 and 4 are running debian6, VM2 is running debian7. VPN is not running for this problem to occur. (See last paragraph above the scheme)