在CentOS 7的安装过程中如果有选择相关虚拟化的的服务安装系统后,启动网卡时会发现有一个以网桥连接的私网地址的virbr0网卡,这个是因为在虚拟化中有使用到libvirtd服务生成的,如果不需要可以关闭后去掉:
一、查看IP及网桥设备
[root@Node1 ~]# ip -4 addr //查看IP地址
1: lo:
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens33:
inet 192.168.11.7/24 brd 192.168.11.255 scope global ens33
valid_lft forever preferred_lft forever
3: virbr0:
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_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
Created symlink from /etc/systemd/system/libvirtd.service to /dev/null.
四、验证
[root@Node1 ~]# ip -4 add
1: lo:
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens33:
inet 192.168.11.7/24 brd 192.168.11.255 scope global ens33
valid_lft forever preferred_lft forever