第一步:确认本地网关地址
第二步选择桥接模式:
我比较幸运,桥接到“自动”,就已经连接成功。不用逐个试错。
修改 ifcfg-ens33 和 新建 ifcfg-br0
[root@localhost network-scripts]# pwd /etc/sysconfig/network-scripts [root@localhost network-scripts]# cat ifcfg-br0 DEVICE="br0" NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Bridge" BOOTPROTO=none IPADDR="192.168.0.105" NETMASK="255.255.255.0" GATEWAY="192.168.0.1" DNS1="192.168.0.1" [root@localhost network-scripts]# cat ifcfg-ens33 TYPE="Ethernet" PROXY_METHOD="none" BROWSER_ONLY="no" BOOTPROTO="none" DEFROUTE="yes" IPV4_FAILURE_FATAL="no" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" IPV6_ADDR_GEN_MODE="stable-privacy" NAME="ens33" UUID="76f5068e-0ab4-4318-8c4b-eaea86805c65" DEVICE="ens33" ONBOOT="yes" IPV6_PRIVACY="no" PEERDNS="no" BRIDGE="br0"
重启网络服务和连通性测试
systemctl restart network.service 或 /etc/init.d/network restart 或 service network restart