VMware workstations 虚拟机Centos 8下的网络配置 问题
Posted Johnny*
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VMware workstations 虚拟机Centos 8下的网络配置 问题相关的知识,希望对你有一定的参考价值。
yum换国内镜像源
国内镜像源
更换完之后使用yum 命令安装,发生了如下问题:
Errors during downloading metadata for repository ‘AppStream
CentOS-Linux-
centos8使用NAT与主机互通上网
Centos8 重启网卡方法
VMware配置centos8使用NAT与主机互通上网
VMware以NAT模式配置CentOS8网络
按照上面文章进行配置,对 物理机的VMware Virtual Ethernet Adapter for VMnet8 #2网卡进行如下配置:
虚拟网络编辑器配置如下:
/etc/sysconfig/network-scripts/ifcfg-ens33配置:
配置 完成后发现
ping不通外网和网关
[johnny@localhost ~]$ ping www.baidu.com
ping: www.baidu.com: 未知的名称或服务
[johnny@localhost ~]$ ping 192.168.89.2
ens33网卡没有启动
[johnny@localhost ~]$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:0c:29:6c:59:8b brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:9e:18:58 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:9e:18:58 brd ff:ff:ff:ff:ff:ff
使用
使用nmcli查看网卡状态:
[johnny@localhost ~]$ nmcli
virbr0: 未托管
"virbr0"
bridge, 52:54:00:9E:18:58, 软件, mtu 1500
ens33: 未托管
"Intel 82545EM"
ethernet (e1000), 00:0C:29:6C:59:8B, 硬件, mtu 1500
lo: 未托管
"lo"
loopback (unknown), 00:00:00:00:00:00, 软件, mtu 65536
virbr0-nic: 未托管
"virbr0-nic"
tun, 52:54:00:9E:18:58, 软件, mtu 1500
使用nmcli device status查看网卡设备状态
[johnny@localhost ~]$ nmcli device status
DEVICE TYPE STATE CONNECTION
virbr0 bridge 未托管 --
ens33 ethernet 未托管 --
lo loopback 未托管 --
virbr0-nic tun 未托管 --
查看NM托管
[johnny@localhost ~]$ nmcli n
disabled
使用 nmcli n on 开启托管
[johnny@localhost ~]$ nmcli n on
[johnny@localhost ~]$ nmcli n
enabled
重启
[johnny@localhost ~]$ systemctl restart NetworkManager
再次查看,发现ens33出现了ip说明网卡和配置都生效了
[johnny@localhost ~]$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:6c:59:8b brd ff:ff:ff:ff:ff:ff
inet 192.168.59.123/24 brd 192.168.59.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::9428:bac8:10a2:12da/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:9e:18:58 brd ff:ff:ff:ff:ff:ff
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:9e:18:58 brd ff:ff:ff:ff:ff:ff
注意,centos8之后网卡相关命令不是service network 了,相关可以查看
CentOS 8系统网卡启动命令
知乎 NetworkManager设置
VMware虚拟机NAT模式的配置方法
以上是关于VMware workstations 虚拟机Centos 8下的网络配置 问题的主要内容,如果未能解决你的问题,请参考以下文章
vmware workstation15 虚拟机启动和停止(7)
vmware workstation无法连接到虚拟机 怎么解决