先安装uml-utilities,该工具包含建立虚拟网络设备(所谓的“TAP interfaces”)的工具:
sudo apt-get install uml-utilities
安装 桥接工具 bridge-utils
#sudo apt-get install bridge-utils
#sudo gedit /etc/network/interfaces
在后面加上这个:
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 192.168.1.104
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
(上面的ip和网络地址等改成你需要的就行了)
启动网桥
sudo /sbin/ifup br0
sudo /etc/init.d/networking restart (或 sudo restart network-manager)