Solve the problem that VMware cannot connect to the Internet when installing CentOS Server

Installing CentOSlater, CentOSthe default is not activate the card, so there is no way the new network after you install, the solution is relatively simple, configured to activate the boot on the line.

Activation steps:

1. Enter the network configuration directory

cd /etc/sysconfig/network-scripts/

# 查看该目录下的文件
ls

Insert picture description here

2. Edit the configuration file

Use vi(the system comes) / vim(to be installed) to edit ifcfg-ensXXor ifcfg-ethXXfile information word, and then save it.

[Note] ifcfg- XXXXX: XXXXXis the network card device name.

ifcfg-l0It is a local loopback interface, which is equivalent to 127.0.0.1don't care about it. Generally, it is booted by default.

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
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=ens33
UUID=b0415e92-70fe-4b13-9344-c8f0f6d73d7d
DEVICE=ens33
ONBOOT=no

The ONBOOT=nochange ONBOOT=yescan be.

[Note] It ONBOOTis to configure whether to activate the network card when the system is started. Only the network card in the activated state can connect to the network normally.

3. reboot

After the configuration is complete, you need to restart reboot.

Personal blog: Roc's Blog

Guess you like

Origin blog.csdn.net/peng2hui1314/article/details/109133832