Centos 7 cannot access the Internet. centos Solution
-
First, right-click the desktop and click "open in terminal ".
-
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 #.
-
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.
-
Then input cat/etc/sysconfig/network-scripts/ifcfg-eno16777736, here the "eno16777736" is changed to your own, the following steps are also true.
-
Note the red circle below. If you are displaying "ONBOOT = no", you cannot access the Internet. Next, change it to "yes ".
-
Enter vi/etc/sysconfig/network-scripts/ifcfg-eno16777736, or change vi to gedit for easier modification.
-
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.
-
Then, the part in the red coil appears under the vi editing, and the operation is successful.
- 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
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
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.