Solve the problem that CentOS7 cannot obtain the ip address


foreword

安装CentOS7后无法获取ip地址问题


1. Virtual machine settings

1. Select the network connection mode as bridge mode

insert image description here

Two, solve

Before it is set, the ip address cannot be obtained through the ip addr command

insert image description here

1. Modify the configuration file

# vi /etc/sysconfig/network-scripts/ifcfg-ens33

Change ONBOOT=NO to ONBOOT=YES, save and exit
insert image description here

2. Restart the virtual machine

# reboot

3. Reacquire the ip address

insert image description here

3. Turn off the firewall

1. Check the firewall

# firewall-cmd --list-all

insert image description here

2. Turn off the firewall

single close

# systemctl stop firewalld

permanently closed

# systemctl disable firewalld

Restart the virtual machine

# reboot

3. Firewall off

insert image description here

Summarize

Tip: The above steps can solve the problem that the virtual machine cannot obtain the IP address.

Guess you like

Origin blog.csdn.net/SmallCat0912/article/details/126657406