vmware中虚拟机centos7配置静态IP上网的方法总结如下:
一、环境主机:win10, 可以上网,wifi
虚拟机:centos7,可以通过DHCP上网
二、设置主机1、首先设置主机的网络适配器VMnet8:
2. 设置主机wifi网络的共享
二、设置vmware1. 设置vmnet0
2. 设置vmnet8
3. 更改vmware虚拟机网络适配器设置(关键点)
三,设置centos 7虚拟机点击apply后,centos7系统生成配置文件ifcfg-Wired_connection_1
HWADDR=00:0C:29:97:2A:14 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none IPADDR=192.168.200.190 PREFIX=24 GATEWAY=192.168.200.2 DNS1=192.168.200.2 DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=no NAME="Wired connection 1" UUID=1374ef6a-9ff1-3b97-9d87-605fa0f63738 ONBOOT=yes AUTOCONNECT_PRIORITY=-999四,验证
1. 从centos7ping外网、主机
[root@localhost network-scripts]# service network restart
Restarting network (via systemctl): [ OK ]
[root@localhost network-scripts]# ping www.baidu.com
PING www.baidu.com (39.156.66.14) 56(84) bytes of data.
64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=1 ttl=128 time=117 ms
64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=2 ttl=128 time=116 ms
^C
--- www.baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms[root@localhost network-scripts]# ping 192.168.200.201
PING 192.168.200.201 (192.168.200.201) 56(84) bytes of data.
64 bytes from 192.168.200.201: icmp_seq=1 ttl=128 time=0.718 ms
64 bytes from 192.168.200.201: icmp_seq=2 ttl=128 time=0.731 ms
64 bytes from 192.168.200.201: icmp_seq=3 ttl=128 time=0.715 ms
64 bytes from 192.168.200.201: icmp_seq=4 ttl=128 time=0.672 ms
^C
--- 192.168.200.201 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 0.672/0.709/0.731/0.022 ms
2 从主机ping 虚拟机centos7
C:Usersyanfeng>ping 192.168.200.190
正在 Ping 192.168.200.190 具有 32 字节的数据:
来自 192.168.200.190 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.200.190 的回复: 字节=32 时间=1ms TTL=64192.168.200.190 的 Ping 统计信息:
数据包: 已发送 = 2,已接收 = 2,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 1ms,平均 = 0ms



