Centos7 network configuration in virtual machine

Bridge mode selected for the network adapter

Then you can set up the network on the linux side

Type the command vi /etc/sysconfig/network-scripts/ifcfg-ens33

According to the host's address, configure the network, generally need to change are

BOOTPROTO=static

IPADDR = IP address (refer to your host IP address, just modify the last paragraph)

PREFIXO = subnet mask

GATEWAY = gateway

DNS1 = 8.8.8.8

ONBOOT = yes

Save after setting

Then restart the network sudo service network restart

Then ping www.baidu.com to see if there is any success.

The view IP address of centos 7 is ip addr

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324452863&siteId=291194637