Centos 7 cannot access the Internet. centos Solution

Source: Internet
Author: User

Centos 7 cannot access the Internet. centos Solution

 

  1.  

    First, right-click the desktop and click "open in terminal ".

  2.  

    Enter su, press enter, and enter your root password, as shown in. Note that the password area does not display anything when you enter the password, if you enter an error, you can press the backspace several times. After the result is successful, the symbol before the command is changed #.

  3.  

    As shown in, enter ls/etc/sysconfig/network-scripts/. Pay attention to the red line. You may not be the same as mine. Remember or copy it, the following steps are used multiple times. Replace "eno16777736" in the following steps with your own one.

  4.  

    Then input cat/etc/sysconfig/network-scripts/ifcfg-eno16777736, here the "eno16777736" is changed to your own, the following steps are also true.

  5.  

    Note the red circle below. If you are displaying "ONBOOT = no", you cannot access the Internet. Next, change it to "yes ".

  6.  

    Enter vi/etc/sysconfig/network-scripts/ifcfg-eno16777736, or change vi to gedit for easier modification.

  7.  

    Change "no" to "yes" Under vi, and then enter ": w". If no change is made, change vi to gedit as prompted above, which is easy to modify, save the modification.

  8.  

    Then, the part in the red coil appears under the vi editing, and the operation is successful.

  9. 9

    Then enter the terminal and use the root account, enter "shutdown-r now", and then the system restarts. After the device is started, enter the operating system with the password, and change the root account to the terminal.

    Now the computer will be able to access the Internet normally, you need to continue to see below, set a fixed IP address below.

  10. 10

    Enter "ip add". After the command is complete, pay attention to the REDLINE part. Remember or copy it and set it to a fixed IP address.

  11. 11

    Enter gedit/etc/sysconfig/network-scripts/ifcfg-eno16777736 on the terminal, for example, add the following four lines of parameters at the end of the text. The first line is the IP address, and the second line is as good as I do. The third and fourth lines change the last part of the IP address to "1.

    After the configuration is complete, enter "shutdown-r now" on the terminal.

  12.  

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.