如何添加虚拟网卡,在重启之后不会消失的那种?

Kvm、VMware、Virtualbox、Xen、Qemu 等
回复
头像
Feeriswheel
帖子: 38
注册时间: 2008-06-21 18:30
来自: Beijing

如何添加虚拟网卡,在重启之后不会消失的那种?

#1

帖子 Feeriswheel » 2008-12-02 21:54

RT
:em01
mrguo
帖子: 129
注册时间: 2007-05-28 5:27

Re: 如何添加虚拟网卡,在重启之后不会消失的那种?

#2

帖子 mrguo » 2008-12-05 12:03

在文件 /etc/network/interfaces 中加。

例如(只是例子,参数要改成你自己的):
===================================
#auto eth0
#iface eth0 inet dhcp

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
mtu 1492

auto tap0
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user lenovo

auto br0
iface br0 inet static
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.1
bridge_ports eth0 tap0
回复