Centos7 configuration network can be on Baidu

1. DHCP assigns IP

# cd /etc/sysconfig/network-scripts

# vi / ifcfg-en *

I am here ifcfg-ens33


Change onboot=no to yes


restart network service

# service network restart


Found that you can visit Baidu


Note that the command to view the network IP in the centos7 system is ip addr

Note that the virtual machine must select the network as bridge mode


2. Fixed IP

Edit ifcfg-ens33

Modify the IP address mode to fixed IP, IP address, subnet mask, gateway, DNS address

As shown below

QQ screenshot 20180426221147.png

restart network service


Found that you can visit Baidu


Guess you like

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