I am trying to setup Ubuntu 12.10 running in a VirtualBox 4.2.12 VM as a router between a number of VBox VMs running Win7. The VBox host OS is Win7.
My setup looks something like this:
Code:
======================
|| UbuntuVM ||
----- ------ ------ -----
|VMa|---internal1---|Eth1| |Eth3|----internal3--------|VMc|
----- ------ ------ | -----
|| || |
----- ------ || | -----
|VMb|---internal2---|Eth2| || ----|VMd|
----- ------ || -----
|| ||
======================
UbuntuVM:
Eth0: VBox bridged network. Will be used for SSH.
Eth1: VBox internal network ‘internal1’. IP: 192.168.100.2 Mask 255.255.255.0
Eth2: VBox internal network ‘internal2’. IP: 192.168.101.2 Mask 255.255.255.0
Eth3: VBox internal network ‘internal3’. IP: 192.168.10.2 Mask 255.255.255.0
VMa:
VM with Win7.
VBox internal network ‘internal1’. IP: 192.168.100.3 Mask 255.255.255.0
Should only be able to communicate with VMc and should use OpenVPN running in VMc for internet connection.
VMb:
VM with Win7.
VBox internal network ‘internal2’. IP: 192.168.101.3 Mask 255.255.255.0
Should only be able to communicate with VMd and should use OpenVPN running in VMd for internet connection.
VMc:
VM with Win7.
VBox internal network ‘internal3’. IP: 192.168.10.3 Mask 255.255.255.0
Manages VMa and provides internet connection for VMa via OpenVPN and a VBox Bridged networking adapter (not show).
VMd:
VM with Win7.
VBox internal network ‘internal3’. IP: 192.168.10.4 Mask 255.255.255.0
Manages VMb and provides internet connection for VMb via OpenVPN and a VBox Bridged adapter.
I can ping:
VMa <-> Eth1 (both directions)
VMb <-> Eth2 (both directions)
VMc <-> Eth3 (both directions)
VMd <-> Eth3 (both directions)
But I can NOT ping:
VMa <-> Eth3 or VMa <-> VMc or VMc <-> Eth1
VMb <-> Eth3 or VMb <-> VMd or VMd <-> Eth2
Looks like routing in UbuntuVM is not working.
On Ubuntu, sysctl -p returns "net.ipv4.ip_forward=1".
This is Ubuntu /etc/network/interfaces:
Code:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo eth0 eth1 eth2 eth3
iface lo inet loopback
iface eth0 inet static
address 10.0.0.200
netmask 255.255.255.0
iface eth1 inet static
address 192.168.100.2
netmask 255.255.255.0
iface eth2 inet static
address 192.168.101.2
netmask 255.255.255.0
iface eth3 inet static
address 192.168.10.2
netmask 255.255.255.0
~$ route gives this:
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth3
192.168.100.0 * 255.255.255.0 U 0 0 0 eth1
192.168.101.0 * 255.255.255.0 U 0 0 0 eth2
I have not defined any rules for iptables.
Without the Ubuntu router, VMa can use the OpenVPN connection in VMc. But I have no way of controlling who or what VMa communicates with, which is what I need.
What should I do to make the routing VMa <-> VMc and VMb <-> VMd work?
Bookmarks