Code: Select all
--VM-- ------------- HOST -------------- ---- SWITCH ----
eth0 ---- tap0 --- br0 -----------+- eth1 ---> port0 (trunk)
eth1 ---- tap1 --- br1 -- eth1.2 -| port1 (VLAN2)
eth2 ---- tap2 --- br2 -- eth1.3 -| port2 (VLAN3)
Subnets:
VLAN1 (default): 192.168.1.0/24
VLAN2: 192.168.2.0/24
VLAN3: 192.168.3.0/24
I'm trying to configure a CentOS virtual machine with three interfaces (eth0, eth1 and eth2). Each of them is bridged to one interface in the host (tap0,tap1 and tap2), with these IPs:
eth0 (in the VM): 192.168.1.5/24 bridged to tap0 (in the host)
eth1 (in the VM): 192.168.2.1/24 bridged to tap1 (in the host)
eth2 (in the VM): 192.168.3.0/24 bridged to tap2 (in the host)
The host has one physical network interface (eth1) and two more virtual interfaces (eth1.2 and eth1.3) which are bridged using bridge interfaces (br0, br1 and br2). This host is running Ubuntu 8.04
The /etc/network/interfaces file is configured as shown:
Code: Select all
auto lo
iface lo inet loopback
#physical interface: eth1
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
#virtual interfaces: VLANs
#eth1.2 (VLAN2)
auto eth1.2
iface eth1.2 inet static
address 192.168.2.2
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
mtu 1500
vlan_raw_device eth1
#eth1.3 (VLAN3)
auto eth1.3
iface eth1.3 inet static
address 192.168.3.2
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.2.255
mtu 1500
vlan_raw_device eth1
# tap interfaces (VBox interfaces)
auto tap0
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user austin
auto tap1
iface tap1 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user austin
auto tap2
iface tap2 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user austin
# bridge interfaces (links VM's taps interfaces with eth interfaces)
# br0 (tap0 --> eth1)
auto br0
iface br0 inet manual
bridge_ports eth1 tap0
# br1 (tap1 --> eth1.2)
auto br1
iface br1 inet manual
bridge_ports eth1.2 tap1
# br2 (tap2 --> eth1.3)
auto br2
iface br2 inet manual
bridge_ports eth1.3 tap2
Testing conection from VM to outside:
The point is that I can only ping hosts on the 192.168.1.0/24 network (i.e. VM's eth0 which it's bridged to eth1 in the host) and I can't access to the rest VLAN hosts connected to the switch using VLANs 2 and 3. Neither to say, the VLAN configuration on the switch is OK.
Testing conection from outside to the VM:
I can ping from all the hosts that are not conected to a VLANs to the 192.168.1.5 IP (which belongs to VM's eth0). It's like if the VLAN interfaces weren't working at all.
Anyone could help me? I've been trying for more than a week and a half and I'm really confused about this behaviour.I've also tried to use VBoxAddIF command instead of adding manually tap interfaces, but I haven't got the bridge to the eth1.2 and eth1.3 ifs working.
If you need further explanation, please ask for it. I tried to explain it as clear as I know.
Thanks![/code]