Solve the problem that centos 7 cannot access the external network

One, set to dynamically obtain IP

The dhclient command uses the dynamic host configuration protocol to dynamically configure the network parameters of the network interface.

Syntax
dhclient (option) (parameter)

Option 0:
Specify the port number that the dhcp client listens to;

  • -d: always run the program in the foreground;
  • -q: Quiet mode, no error message is printed;
  • -r: Release the ip address. Parameter network interface: the operating network interface.

Instance

dhclient -r     #释放IP
dhclient        #获取IP

Insert picture description here
Second, reconfigure the static IP address

Guess you like

Origin blog.csdn.net/weixin_44763595/article/details/109900274