You will need to set the network device on your virtualbox machine to whatever you call your tap interface. tap1 in this case. Specify in the network adapter options for your virtualbox that you want to use host interface and enter the tap interface.
If anyone needs help with turning something like this into a startup script or something similar let me know.
Personally, I am adding some service scripts for daemontools because I use that to manage services on my boxes.
- Code: Select all
#!/bin/bash
echo "Creating TAP interface (tap1)"
tunctl -t tap1 -u <MACHINE_NAME>
echo "TAP interface Created (tap1)"
echo "Creating Bridge Interface (br0)"
brctl addbr br0
echo "Created Bridge Interface (br0)"
echo "Making promiscuous (eth0)"
ifconfig eth0 0.0.0.0 promisc
echo "Oh Baby!"
echo "Link Bridge Interface and Host Interface (br0 and eth0)"
brctl addif br0 eth0
echo "DHCP for Bridge Interface (br0)"
dhclient br0
echo "Turning on the TAP (tap1)"
brctl addif br0 tap1
ifconfig tap1 up
echo "Lets make sure we can use what we need"
chmod 0666 /dev/net/tun
echo "Go Vici, it's your birthday!"
vboxmanage startvm ViciDialNow
you can then control it with:
vboxmanage controlvm ViciDialNow
pause|resume|reset|poweroff|savestate|acpipowerbutton|setlinkstate<1-4> on|off