Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to solve the problem that linux can't ping the extranet?

Shulou Source: shulou.com Published: 2022-06-02 21:27:04 10月03日 Update

How to solve the problem that linux can't ping the extranet? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

First, check carefully to determine whether the network card mode of the virtual machine is selected correctly, the physical environment uses the router to choose the bridging mode, the stand-alone or dial-up Internet access chooses the NAT mode, and if you do not want to use the virtual machine to access the Internet, choose the host mode.

Second, check whether the gateway is configured correctly

1. Dhclient first to obtain the ip address automatically.

2. Check the configuration through # vi / etc/sysconfig/network-scripts/ifctg-eth0

Set ONBOOT=yes to turn on the network card automatically, and change dhcp to static static configuration, pay attention to

1) ip and gateway must be in the same network segment

2) the DNS is generally the same as the gateway

3) refer to the configuration of real machine gateway

3. Restart the Nic to ensure that the DNS can be parsed

# service network restart

4. Check the resolution of DNS

# grep hosts / etc/nsswitch.conf after reading the above, have you mastered the solution that linux is unable to ping the extranet? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Mode gateway configuration content method more network card problem choice same helpless for this host stand-alone reason address this situation skill physics Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Apple Linux Shulou Technology macOS