Centos cannot get online

Source: Internet
Author: User

I still used it well yesterday. Today I can't get online, so I'm depressed. However, it's just a good opportunity to learn about Linux network configuration. This will make it easy, this article is written in a Linux Browser!

First, check whether the network settings in the virtual machine are normal. Because my local system uses windows2008, I can only use bridging to enable the virtual machine to access the Internet.

Let's take a look at edit-> Virtual Network editor)

If all others are deleted, a vmnet0 is left, and the bridge method is used. You must specify the bridging method and the NIC;

Configure the network on Linux as follows:

No matter how many NICs exist in this area, all of them are deleted. Here is the NIC that I see after I have configured it;

Go to the command line, modify the ifcfg-eth0 file, I don't know if it is because I have deleted all the networks in the above, in short there is no such file, okay
Enter the Directory:/etc/sysconfig/network-scripts/check the file here, there is an ifcfg-Lo file, this is the backup file, copy a copy, renamed ifcfg-eth0, open the file and modify the content in it. I will not elaborate on how to change it. Because of the bridging mode used, let's just put it bluntly. In this mode, the virtual machine and the physical machine are under the same network segment, what does it mean, that is, both the physical machine and the virtual machine are connected to the same vro, but the technology implemented here is using a virtual switch, that is, there is a virtual switch, the physical machine is connected to this switch, and the virtual machine is also connected to this switch. This is how it is implemented!

After modifying the ifcfg-eth0 file, re-import the ifcfg-eth0 configuration file: #/etc/init. d/network reload
If the device not managed by NetworkManager problem occurs when executing this command, disable the NetworkManager service first: # service NetworkManager stop. then run #/etc/init. d/network reload # ifdown eth0 # IFUP eth0
Shut down Linux, restart the virtual machine, and then start Linux. If there is no network connection symbol in the upper right corner, it is because the NetworkManager service is disabled, turn it on and you will be able to see this icon. The local machine and the virtual machine can ping each other. After that, ping the Internet and access the internet. OK. You can access the Internet!

 

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: info-contact@alibabacloud.com 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.