Home >Operation and Maintenance >Linux Operation and Maintenance >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
After using vim to open the file, you will see the configuration of the network card
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. .
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
## Let’s verify whether this DNS is resolved Successping can be accessed through Baidu 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!