環境:Ubuntu
命令腳本:
#!/bin/sh
sudo tunctl -t vb02 -u martin
sudo brctl addbr br0
sudo chmod 777 /dev/net/tun
sudo ifconfig eth0 0.0.0.0 promisc
sudo ifconfig vb02 0.0.0.0 promisc
brctl addbr br0
sudo brctl addif br0 eth0
sudo ifconfig br0 up
sudo dhclient br0
sudo brctl addif br0 vb02
sudo ifconfig vb02 up
sudo chmod 777 /dev/net/tun
sudo VBoxAddIF vb02 martin br0