Set network connection after CentOS Installation
A CentOS virtual machine was installed in Windows 7. Since it was the smallest installation at that time, many software, such as gcc, were unavailable. If you want to install the SDK through the network, use yum list to check whether the server can connect to the Internet. However, you are always prompted that the list.centos.org cannot be parsed.
CentOS version:
# Rpm-q centos-release
Centos-release-6-6.e16.centos.12.2.x86_64
I do not know whether the system of each netizen is different. For another reason, I checked a lot of information on the Internet and tried many methods, which is hard to solve. Until I found a method, as shown below:
"Are you using a virtual machine or a real system? If the virtual machine is in NAT mode, as long as the host machine can access the Internet, the virtual machine system can also be installed, but if you are installing a mini pure version of centos, you need to make some configuration, because the default network service is disabled, use this command to change the configuration: vi/etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO = "dhcp"
ONBOOT = "yes"
NM_CONTROLLED = "no"
Then restart the network service: service network restart
Ping here and try to get online"
Original article link
Combine the method of this netizen to sort out the setting points:
1. Set the Virtual Machine network connection mode to NAT.
2. Two services in the window system, VMwareDHCP Service and VMware NAT Service, must be started.
3. Use vi to edit the file/etc/sysconfig/network-scripts/ifcfg-eth0 without double quotation marks in my system, as shown below:
BOOTPROTO = dhcp (not changed)
ONBOOT = yes (no before modification)
NM_CONTROLLED = no (yes before modification)
After modification, ZZ is saved and exited.
4. Enter service network restart.
Done!
Enter the yum list to connect to the network and list all the software that can be installed.