Get the App
SLTechnology News&Howtos  ›  Servers  › 

The solution to the inability of linux to connect to the Internet

Shulou Source: shulou.com Published: 2022-06-03 00:18:51 09月22日 Update

This article will explain in detail the solutions to the inability of linux to connect to the Internet, and the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

First, check the configuration of the network card

Check the settings of the network card. 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 opening the file with vim, you will see the configuration of the network card.

Where DEVICE is the name of the network card, BOOTPROTO is static or dynamic, IPADDR is the IP address, MASK is the subnet mask, GATEWAY is the gateway, and ONBOOT is the switch status of the network card, for example, the gateway is 192.168.229.2, then come to the ping gateway to see if ping can be reached.

If other hosts in the local area network can access the Internet, but when you cannot access the Internet, excluding the relevant access restrictions made by the gateway or server, it can only be the configuration problem of the local computer. Check DNS.

2. Configure DNS

Let's verify that the DNS is parsed successfully.

Baidu can already get through under ping.

This is the end of the solution to the inability of linux to connect to the Internet. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Network card configuration gateway method content file article more knowledge article good successful host dynamic address local area local area network situation server status Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Linux MariaDB Xiaomi Docker