编辑下面文件保存成net81.xml
<network> <name>net81</name> <bridge name='net81' stp='on' delay='0' /> </network>
应用设定并启动
virsh net-define net81.xml virsh net-start net81
使用ifconfig查看配置好的网卡
net81 Link encap:Ethernet HWaddr 52:54:00:84:92:2E UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
配置VLAN ID
<interface type='bridge'> <source bridge='br2'/> <vlan> <tag id='304'/> </vlan> <virtualport type='openvswitch'> </virtualport> <model type='virtio'/> </interface>