Linux cannot ping the external network

王林
Release: 2019-11-02 15:58:27
Original
8941 people have browsed it

Linux cannot ping the external network

1. Check carefully to make sure the network card mode of the virtual machine is selected correctly. For the physical environment, use a router to select the bridge mode. For stand-alone or dial-up Internet access, select the NAT mode. If you do not want to use the virtual machine to access the Internet, select the host. Mode

Linux cannot ping the external network

2. Check whether the gateway is configured correctly

1. First perform dhclient and automatically obtain the ip address

Linux cannot ping the external network

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

Set ONBOOT=yes to automatically enable the network card, and change dhcp to static static configuration. Note

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

2) DNS is generally set to be the same as the gateway

3) Please refer to the real machine gateway configuration

Linux cannot ping the external network

3. Restart the network card and ensure that the DNS can be resolved.

# service network restart
Copy after login

Linux cannot ping the external network

4. Check the DNS resolution

# grep hosts /etc/nsswitch.conf
Copy after login

Linux cannot ping the external network

Recommended tutorial: linux tutorial

The above is the detailed content of Linux cannot ping the external network. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!