Set network connection after CentOS Installation

Source: Internet
Author: User

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 cannot be parsed.

CentOS version:

# Rpm-q centos-release


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"

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.


Enter the yum list to connect to the network and list all the software that can be installed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.