Home  >  Article  >  Operation and Maintenance  >  Linux cannot connect to the Internet

Linux cannot connect to the Internet

angryTom
angryTomOriginal
2019-11-19 16:45:206872browse

Linux cannot connect to the Internet

Linux cannot connect to the Internet

The solution to Linux cannot connect to the Internet is as follows:

1. Check the network card configuration

Check the network card settings. The configuration file of the network card under Linux is in/etc/sysconfig/network-scripts/

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

Linux cannot connect to the Internet

After using vim to open the file, you will see the configuration of the network card

Linux cannot connect to the Internet

Among them DEVICE is the name of the network card, whether 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. For example, the gateway is 192.168.229.2, and then ping the gateway to see if it can be pinged. .

Linux cannot connect to the Internet

If other hosts in the LAN can access the Internet, but you cannot access the Internet, unless the gateway or server has made relevant access restrictions, it can only be the local computer. For configuration issues, check DNS

2. Configure DNS

Linux cannot connect to the Internet

## Let’s verify whether this DNS is resolved Success

ping can be accessed through Baidu

Linux cannot connect to the Internet

Recommendation: [

Linux Video Tutorial]

The above is the detailed content of Linux cannot connect to 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