Home  >  Article  >  Operation and Maintenance  >  Solution to Linux unable to access the Internet

Solution to Linux unable to access the Internet

(*-*)浩
(*-*)浩Original
2019-11-07 13:25:126906browse

The simplest one is described in one sentence, ifconfig checks the current system's IP, subnet mask and gateway.

Solution to Linux unable to access the Internet

Ping, for example, ping www.baidu.com, but it doesn’t work.

Here are two solutions: First, check the network card configuration Second, configure DNS (Recommended learning: linux operation and maintenance)

View Network card settings, the configuration file of the network card under Linux is in /etc/sysconfig/network-scripts/

Solution to Linux unable to access the Internet

Use ls to view and then use vi or vim to edit ifcfg-eth0

Here DEVICE is the network card name, BOOTPROTO is static or dynamic, IPADDR is the IP address, MASK is the subnet mask, GATEWAY is the gateway, and ONBOOT is the network card switch status

If there are other hosts in the LAN When you can access the Internet but cannot access the Internet, unless the gateway or server has made relevant access restrictions, it may only be a configuration problem on the machine. Check DNS

Solution to Linux unable to access the Internet

Enter the Baidu URL, but no relevant information is output, so it is said that the parsing was not successful.
Solution to Linux unable to access the Internet
You can see the prompt that the connection has timed out, so there is still a problem with DNS parsing. Then edit the DNS configuration file and configure In the file, the two lines of commands are preceded by #, so they become comments. After deleting the #, save and exit

Solution to Linux unable to access the Internet

The above is the detailed content of Solution to Linux unable to access the Internet. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn