配置文件:
vim /etc/network/interfaces
auto lo
iface lo inet loopback
auto virbr1
iface virbr1 inet dhcp #这里的dhcp可以改为static静态获取
bridge_ports eth0
address 192.168.0.72
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254
编写好后重启网卡:
/etc/init.d/networking restart