0 preface
Disable the eth0 on graphical interfaces if it exist
1 Acknowledge
sudo /etc/init.d/networking restart # configure network based on /etc/network/interfaces
sudo ifdown net_card_name # setdown the net_card
sudo ifup net_card_name # setup the net_card
2 Refrence
http://wiki.ubuntu.org.cn/Kvm_%E7%BD%91%E7%BB%9C%E6%A1%A5%E6%8E%A5%E6%96%B9%E6%A1%88
3 The content of /etc/network/interfaces in my host
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
auto tap0
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user xzl
auto tap1
iface tap1 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user xzl
auto tap2
iface tap2 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user xzl
auto br0
iface br0 inet static
bridge_ports eth0 tap0 tap1 tap2
address 192.168.3.8
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
gateway 192.168.3.215
dns-nameservers 202.114.0.242
4 File /etc/network/interfaces in guest
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.3.160
netmask 255.255.255.0
gateway 192.168.3.215
dns-nameservers 202.114.0.242