[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens33.bak (将原始的网卡配置文件备份,不用还原的话这步可以忽略)
[root@localhost network-scripts]# vim ifcfg-br0 (这里是零不是欧)
TYPE=Bridge
NAME=br0
DEVICE=br0
ONBOOT=“yes”
BOOTPROTO=static
IPADDR=192.168.125.18
GATEWAY=192.168.125.1
NETMASK=255.255.255.0
DNS1=192.168.125.1
DNS2=8.8.8.8
[root@localhost network-scripts]# vim ifcfg-ens33
DEVICE=“ens33”
ONBOOT=“yes”
BRIDGE=br0
重启服务:
[root@localhost ~]#systemctl restart libvirtd (重启libvirtd服务)
[root@localhost ~]#systemctl restart network (重启network服务)
[root@localhost ~]#ip a | grep br0
附加:
删除桥接网卡步骤:
1.删除br0的配置文件
2.修改正常网卡的配置文件
3.重启系统