Linux network problems about connect network is unreachable

Source: Internet
Author: User

Linux network problems regarding the solution to the connect network is unreachable problem some netizens found that the ping command encountered 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 CIDR block can not be) or directly edit vi/etc/sysconfig/network-scripts. service network restart 2. If there is no ifcfg-eth0, this file does not even exist under the/etc/sysconfig Directory network-script directory, then you need Ask you to create this directory and create the ifcfg-eth0 ifcfg-eth0 file with the following content: <! -- [If gte vml 1]> <v: shapetype id = "_ x1__t75" coordsize = "21600,21600" o: spt = "75" o: preferrelative = "t" path = "m @ 4 @ 5l @ 4 @ 11 @ 9 @ 11 @ 9 @ 5xe" filled = "f" stroked = "f"> <v: stroke joinstyle = "miter"/> <v: formulas> <v: f eqn = "if lineDrawn pixelLineWidth 0"/> <v: f eqn = "sum @ 0 1 0"/> <v: f eqn = "sum 0 0 @ 1"/> <v: f eqn = "prod @ 2 1 2"/> <v: f eqn = "prod @ 3 21600 pixelWidth"/> <v: f eqn = "prod @ 3 21600 pixelHeight"/> <v: f eqn = "Sum @ 0 0 1"/> <v: f eqn = "prod @ 6 1 2"/> <v: f eqn = "prod @ 7 21600 pixelWidth"/> <v: f eqn = "sum @ 8 21600 0"/> <v: f eqn = "prod @ 7 21600 pixelHeight"/> <v: f eqn = "sum @ 10 21600 0"/> </v: formulas> <v: path o: extrusionok = "f" gradientshapeok = "t" o: connecttype = "rect"/> <o: lock v: ext = "edit" aspectratio = "t"/> </v: shapetype> <v: shape id = "image _ x0020_1" o: spid = "_ x1__i1025" type = "# _ x1__t75" alt = "http://hi.csdn.net/ Attachment/201108/5/0_1312525844KUxd.gif "style = 'width: 150pt; height: 108.75pt; visibility: visible; mso-wrap-style: square '> <v: imagedata src =" file: /// C: \ Users \ lenovo \ AppData \ Local \ Temp \ msohtmlclip1 \ 01 \ clip_image001.jpg "o: title =" 0_1312525844KUxd "/> </v: shape> <! [Endif] --> <! -- [If! Vml] --> <! -- [Endif] --> 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.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.