I have a lot of different Virtualbox VMs created that I use for testing different things. A while back I created a VM image to act as a PPPoE server (Debian squeeze guest running on a lenny host). For reasons that made sense to me at the time, I created VLANs on the guest operating system rather than on the host system (and attaching virtual network adaptors to the guest VM). I hadn't used this VM in several months until today; when I fired up the VM for some PPPoE testing. Unsurprisingly, the VM didn't have any network connectivity on boot. I figured it would probably take some finagling to get things working exactly the way they were working before. However the topology was correct, the switch set up properly, and still no PPPoE.
After several hours of screwing around with different VirtualBox versions, different combinations of host/guest VLAN configurations, etc. I identified the following behaviors:
- On a clean reboot of the host, the VLANs on the virtual machine work fine.
- As soon as I add a VLAN to the ethernet interface on the host, connectivity to the guest fails.
- If I remove the VLAN from the host, guest connectivity is restored.
- Add a bridge interface br0 to the host.
- Add ethernet adaptor eth0 to bridge br0.
- Add the host VLAN interfaces to bridge br0.
- Configure appropriate IP addressing for the host to br0.
- Attach the VirtualBox VM network interface to eth0.
Could you post a sample configuration files for both host and guest.
ReplyDeleteThanks
Unfortunately I don't have easy access to my configuration anymore as I changed jobs. IIRC, there wasn't anything too tricky in the configuration, you'll just need the standard bridge and vlan utilities. On debian-based distributions, install the following packages.
ReplyDelete*bridge-utils (provides brctl utility)
*vlan (provides vconfig utility)
I believe that some of the configuration, like setting up vlans on the host, was done by adding the relevant commands to /etc/rc.local.
It worked for me like this , set network type to bridge mode with paravirtualized driver. Load the module in the linux host with command "modprobe 8021q" . This gets the vlan trunk ready on the bridged interface. To access a vlan in the trunk, you might used command "vconfig IF VLAN_ID" and then "ifconfig IF.VLAN_ID IP_OF_VLAN" . Thats it. Thanks, Arpan Dubey.
ReplyDelete