vmware 16 pro configures static network under centos7

1. Use ip addr to view the network

Don't worry about lo, look at the beginning of ens

2. Use the vi /etc/sysconfig/network-scripts/ifcfg-ens33 command to view the file. The name of the ens33 file is the name checked in the first step. For details, see the name on your computer. If there is no such file, create a new one

3. Edit the content of the file as follows

HWADDR=00:0C:29:90:46:3F
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
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="Wired connection 1"
UUID=f59fa7ea-d456-4cb3-8787-707f49fb627b
ONBOOT=yes
IPADDR=192.168.7.106 #静态IP
GATEWAY=192.168.7.1 #默认网关
NETMASK=255.255.255.0 #子网掩码
DNS1=192.168.7.1 #DNS 配置


The main configuration and these two items.

4. After the configuration is complete, restart the network configuration, the command is as follows:

systemctl restart network

5. Set the ip address of the host after the restart is successful

After configuration, use ipconfig to view the host network settings

Seeing that the above settings are the same as those just set, it proves that the network configuration of the virtual machine on the host is successful

6. Configure vmware's virtual network editor, as shown below:

After configuration, click Apply to save

7. So far, the networks of the virtual machine and the host can ping each other, and the virtual machine can access the Internet. Every time it is turned on, it will use the default configured static ip to access the Internet.

The virtual machine pings Baidu

The host pings the virtual machine

The virtual machine pings the host:

At this point, the network between the virtual machine and the host has been connected, and you can play happily! !

Guess you like

Origin blog.csdn.net/weixin_42767099/article/details/118568858
Recommended