Home  >  Article  >  Operation and Maintenance  >  The centos6.5 system cannot ping the external network

The centos6.5 system cannot ping the external network

王林
王林Original
2020-03-16 11:38:344015browse

The centos6.5 system cannot ping the external network

Problem:

After configuring CentOS, I found that I could not access the Internet internally and could not ping the external IP.

Solution:

Check whether there is any problem with the network card settings and ensure that the IP address and GATEWAY are in the same network segment. Command: vim /etc/sysconfig/network-scripts/ifcfg-eth*.

The centos6.5 system cannot ping the external network

(Recommended tutorial: centos usage tutorial)

Check whether the routing settings are correct. If there is no problem in the first step, then your IP and gateway can be pinged at this time. Use the command: route -n to view the routing settings of the system. For example: the IP address of my eth0 is 192.168.1.156 and the gateway is 192.168.1.2. If you want to connect to the external network address, there will be a route set as shown in the figure. The Destination is 0.0.0.0 at this time, indicating any address.

The centos6.5 system cannot ping the external network

Check whether iptables (firewall) is configured correctly. If it is your own machine and there are no security requirements, you can turn off the firewall and run the command: service iptables stop

The centos6.5 system cannot ping the external network

to set up a dns server. Command: vim etc/resolv.conf, add the following content: nameserver 8.8.8.8.

The centos6.5 system cannot ping the external network

Finish!

Recommended related video tutorials: linux video tutorial

The above is the detailed content of The centos6.5 system cannot ping the external network. 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