Linux network problems about connectnetworkisunreachable
Source: Internet
Author: User
For linux network problems, the connectnetworkisunreachable problem was solved. some netizens asked the ping command about the problem of connect: networkisunreachable. This is usually because the IP address is not set correctly. Solution: to solve the problem of connect network is unreachable after ensuring the improvement of the NIC driver and... linux network problems, some netizens asked the ping command to see the problem of connect: network is unreachable. This is usually because the IP address is not set correctly. Solution: After the NIC driver is improved and the NIC driver is compiled into the kernel, check ls/etc/sysconfig/network-script/ifcfg-eth0 1. see if the ifcfg-eth0 file exists under the preceding Directory. if so, follow these steps: 1. manually configure the ip address to see if you can configure ifconfig eth0 172.18.128.143 netmask 255.255.255.0 broadcast protocol add default gw 172.18.128.1 (the same network segment can not be) or directly edit vi/etc/sysconfig/network-scripts/ifcfg-eth0. service network restart 2. if there is no ifcfg-eth0 file or even the network-script directory does not exist under the/etc/sysconfig directory, you need to create this directory, and create a ifcfg-eth0 ifcfg-eth0 file with the following content: You only need to modify the device hwaddr netmask ipaddr items as needed. Then ping the service network restart and try again. If you ping a wan instead of a LAN, then you must make sure that the gateway and DNS are correctly set. you can set the Gateway by following the steps below. then you can set the route add default gw 192.168.1.1 and that is your gateway. Now route the Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.1.0 * 255.255.255.0 U 0 0 0 eth0default my. router 0.0.0.0 UG 0 0 0 eth0 if not added, only the first one above. The second is newly added. If you still cannot access it, your situation may be a bit special. In this way, it will be unavailable after restart. Modify/etc/network/interfaces add gateway 192.168.1.1 DNS records in the resolv. conf file under/etc. You can modify DNS in the format of resolv. conf. Create one without resolv. conf. Then try ping the service network restart command.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service