在CentOS 7的安装过程中如果有选择相关虚拟化的的服务安装系统后,启动网卡时会发现有一个以网桥连接的私网地址的virbr0网卡,这个是因为在虚拟化中有使用到libvirtd服务生成的,如果不需要可以关闭后去掉:
一、查看IP及网桥设备
[root@Node1 ~]# ip -4 addr //查看IP地址
1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft forever
2: ens33: mtu 1500 qdisc pfifo_fast state UP qlen 1000 inet 192.168.10.7/24 brd 192.168.10.255 scope global ens33 valid_lft forever preferred_lft forever
3: virbr0: mtu 1500 qdisc noqueue state DOWN qlen 1000 inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0valid_lft forever preferred_lft forever
[root@Node1 ~]# brctl show //查看网桥
bridge name bridge id STP enabled interfaces
virbr0 8000.5254005caf00 yes virbr0-nic
[root@Node1 ~]#
二、删除网桥
[root@Node1 ~]# ifconfig virbr0 down
[root@Node1 ~]# brctl delbr virbr0 //删除网桥
三、禁用开机服务
[root@Node1 ~]# systemctl disable libvirtd.service //禁用libvirtd服务开机自启动
Removed symlink /etc/systemd/system/multi-user.target.wants/libvirtd.service.
Removed symlink /etc/systemd/system/sockets.target.wants/virtlockd.socket.
Removed symlink /etc/systemd/system/sockets.target.wants/virtlogd.socket.
[root@Node1 ~]# systemctl mask libvirtd.service //注销 unit,注销后你就无法启动这个 unit 了
Created symlink from /etc/systemd/system/libvirtd.service to /dev/null.
四、重启服务器验证
[root@Node1 ~]# ip -4 add
1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens33: mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 192.168.10.7/24 brd 192.168.10.255 scope global ens33
valid_lft forever preferred_lft forever
*****经过验证,发现virbr0已经删除****