桥接模式下没有IP不能联网的问题
程序员文章站
2022-05-01 15:55:38
...
桥接模式下没有ip,不能联网
ifconfig 命令
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::371b:3139:1d2b:d5cf prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:fa:d0:6a txqueuelen 1000 (Ethernet)
RX packets 17 bytes 1740 (1.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 54 bytes 9569 (9.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:c0:c6:75 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
可以先关闭防火墙
systemctl status firewalld
查看防火墙状态
systemctl stop firewalld
关闭防火墙
systemctl start firewalld
开启防火墙
检查Linux的配置文件
命令
vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
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="da32cd0f-3c80-44bb-9840-74a28efd2940"
DEVICE="ens33"
ONBOOT="yes"
确认是否是dhcp
模式,BOOTPROTO="dhcp"
,以及系统启动时是否执行dhcp
模式,ONBOOT="yes"
。
然后检查VMware的网络配置
最后重新启动网卡
Centos 8 中nmcli connection reload 网卡名
[我是用的这个]
nmcli connection up
网卡名
nmcli device reapply
网卡名
nmcli device connect
网卡名
方法二:ifconfig 网卡名 down
关闭网卡
ifconfig 网卡名 up
启动网卡
上一篇: Xshell 5常见问题及相关配置
下一篇: Github无法显示图片问题解决方案