1.在vmware中选择编辑-->虚拟网络编辑器。
1.1 按下面1,2,3顺序操作,分别修改子网IP:192.168.5.0,子网掩码:255.255.255.0,这里的子网ip为什么是192.168.5.0呢,因为物理机器的关网是192.168.5.1,见物理机ip图
1.2圈3设置图

1.3物理机器ip

2虚拟机设置-->网络适配器选择NAT模式。

3.配置虚拟机ip
首先进去root中,然后进入vim编辑器中
(1)su - root
(2) vim /etc/sysconfig/network-scripts/ifcfg-ens33

8,在VIM编辑器中修改并添加如下信息(一定要和之前配置的虚拟机在同一个网段下,IP地址只要在5网段下就行,网关和上面设置的网关一样,DNS1(域名解析服务器)和网关一样)
9,重启网关
systemctl stop network
systemctl start network
10,使用ipconfig查询IP,IP已经修改过来了,并且现在的iP已经是固定IP了