- 一、查看虚拟机ip地址
- 二、编辑network配置文件
- 三、重启网关
- 四、检查有无修改成功,VMware工具中看一下配置
- 五、windows系统ping虚拟机
ifconfig
看ens33的ip,我的是192.168.174.128
[root@localhost node_exporter-1.2.2.linux-amd64]# ifconfig ens33: flags=4163二、编辑network配置文件mtu 1500 inet 192.168.174.128 netmask 255.255.255.0 broadcast 192.168.174.255 inet6 fe80::5d3f:3a15:daa9:4384 prefixlen 64 scopeid 0x20 ether 00:0c:29:30:c3:e0 txqueuelen 1000 (Ethernet) RX packets 51042 bytes 51676690 (49.2 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 25864 bytes 40717619 (38.8 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 4 bytes 352 (352.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4 bytes 352 (352.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost node_exporter-1.2.2.linux-amd64]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
1-下图①,将no改成static
2-下图②,添加这4行内容
IPADDR=我在第一步查到的ip地址 NETMASK=子网掩码 GATEWAY=网关,最后一位写2,不要写1 DNS1=8.8.8.8域名三、重启网关
systemctl restart network四、检查有无修改成功,VMware工具中看一下配置
结束~



