Can establish connection, but still get «connect: Network is unreachable»
I have an Asus E402NA laptop. I installed Ubuntu 16.04 on it. At the end of the installation the installer crashed, but I am still able to boot and start up Ubuntu (not sure if this is helpful information, but that is not the problem I am concerned with right now). I can see wifi networks, I can connect (and it detects if I use an incorrect password). I see a connection when it gets established. However, when I try to go online, I cannot reach any sites and I cannot ping anything:
$ ping 192.168.0.1 connect: Network is unreachable $ ping 8.8.8.8 connect: Network is unreachable
I tried connecting using ethernet, but the effect is the same. It tells me a connection has been established, but I get the same results for any ping attempts. The same happens when I boot to a live usb, so I don’t think it has anything to do with the installation. I tried to run Debian 9.5.0 live usb and the same thing happened when I connected via ethernet. Similarly for running Ubuntu 16.04 live usb. Here are the outputs of a few commands I ran on the installed Ubuntu 16.04: I ran netstat while connected to a wifi network.
$ netstat -natp Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1336/cupsd tcp6 0 0 ::1:631 . * LISTEN 1336/cupsd $ ifconfig -a enp1s0f2 Link encap:Ethernet HWaddr 60:45:cb:bf:bd:2e UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:6836 errors:0 dropped:0 overruns:0 frame:0 TX packets:6836 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:507456 (507.4 KB) TX bytes:507456 (507.4 KB) wlp2s0 Link encap:Ethernet HWaddr f0:03:8c:8f:5d:15 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface $ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN $ cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback
$ sudo dhclient -v Internet Systems Consortium DHCP Client 4.3.3 Copyright 2004-2015 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/wlp2s0/f0:03:8c:8f:5d:15 Sending on LPF/wlp2s0/f0:03:8c:8f:5d:15 Listening on LPF/enp1s0f2/60:45:cb:bf:bd:2e Sending on LPF/enp1s0f2/60:45:cb:bf:bd:2e Sending on Socket/fallback DHCPDISCOVER on wlp2s0 to 255.255.255.255 port 67 interval 3 (xid=0x995990e) Unable to set up timer: out of range If you think you have received this message due to a bug rather than a configuration issue please read the section on submitting bugs on either our web page at www.isc.org or in the README file before submitting a bug. These pages explain the proper process and the information we find helpful for debugging.. exiting.
connect: Network is unreachable
There are probably lots of situation when this can happen, but this is a big mistery for me. Some tools can use the network just fine (wget, dig, apt-get, . ), but some tools are just failing (ping, traceroute, the browser, . ). For example, I can download a file with wget :
gonvaled@pegasus ~ » wget archive.ubuntu.com --2014-10-02 10:52:34-- http://archive.ubuntu.com/ Resolving archive.ubuntu.com (archive.ubuntu.com). 2001:67c:1360:8c01::18, 2001:67c:1360:8c01::19, 91.189.91.14, . Connecting to archive.ubuntu.com (archive.ubuntu.com)|2001:67c:1360:8c01::18|:80. connected. HTTP request sent, awaiting response. 200 OK Length: 671 [text/html] Saving to: ‘index.html.2’ 100%[========================================================================================================================================================>] 671 --.-K/s in 0s 2014-10-02 10:52:34 (30,8 MB/s) - ‘index.html.2’ saved [671/671]
gonvaled@pegasus ~ » dig archive.ubuntu.com ; > DiG 9.9.5-3-Ubuntu > archive.ubuntu.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER
But I can not ping the site (not because the site is not replying to pings, but because Network is unreachable ):
gonvaled@pegasus ~ » ping archive.ubuntu.com connect: Network is unreachable
gonvaled@pegasus ~ » traceroute archive.ubuntu.com traceroute to archive.ubuntu.com (91.189.88.149), 30 hops max, 60 byte packets connect: Network is unreachable
gonvaled@pegasus ~ » ifconfig eth0 eth0 Link encap:Ethernet HWaddr 2c:76:8a:e0:b0:6b inet addr:10.11.44.84 Bcast:10.11.255.255 Mask:255.255.0.0 inet6 addr: 2001:4dd0:fff4:11:2c3f:5f86:f975:579f/64 Scope:Global inet6 addr: fe80::2e76:8aff:fee0:b06b/64 Scope:Link inet6 addr: 2001:4dd0:fff4:11:2e76:8aff:fee0:b06b/64 Scope:Global UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:37502 errors:0 dropped:0 overruns:0 frame:0 TX packets:14119 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:13558552 (13.5 MB) TX bytes:3533448 (3.5 MB) gonvaled@pegasus ~ » route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.11.0.0 * 255.255.0.0 U 0 0 0 eth0 link-local * 255.255.0.0 U 1000 0 0 eth0
EDIT
There seem to be two things at play here: IPv6 and default gateway. Whenever I enable wlan, I get these routes:
gonvaled@pegasus ~ » route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 10.11.0.1 0.0.0.0 UG 0 0 0 wlan0 10.11.0.0 * 255.255.0.0 U 0 0 0 eth0 10.11.0.0 * 255.255.0.0 U 9 0 0 wlan0 link-local * 255.255.0.0 U 1000 0 0 eth0
- Why don't I get a default gateway with my eth0? (this is the real issue at hand)
- Why does IPv6 does not need a default gateway? (this is what was confusing me all along)
Arch Linux - connect: Network is unreachable
After five unsuccessful Arch Linux installations, I've got two that installed correctly. The first time, the network worked fine, and I was even installing Arch Linux over SSH. After booting from the installed system instead of the live CD, it can't connect to the network, I get the following message when I try to ping anything, even my router:
I've tried installing Arch again, because nothing on the Internet seemed to fix my issue. After installing, I'm getting the same issue. It appears it's failing to start eth0 because it times out.
@uzsolt Yes, it gives a Failed to issue method call: No such file or directory error. I've also posted a topic over at the official forums, I will be posting the answer here if I find one.
ifconfig eth0 up already done? Does linux see your network card (module are loaded)? Before anything please systemctl stop netctl-eth0.
Damn. you've no eth0, you've. I can't read it 🙁 bbs.archlinux.org/viewtopic.php?pid=1291880#p1291880 So you should set up NO eth0, you should use instead enp1s0 (or what the hell is on your photo 🙂 ).
4 Answers 4
The problem I was facing was that there was no eth0 (from what I can understand.) Run the command ip link , this should output your interfaces. I did not have the eth0 interface. Instead I had enp1s8 .
Because I was using static, I copied the example profile with cd /etc/netctl then cp examples/ethernet-static my-network . After that, I edited my-network with nano my-network , and changed the Interface from eth0 to en1s8 (or whatever your adapter is in ip link ). Finally, I enabled it to use that profile on startup with netctl enable my-network .
Enabling the profile will ensure that it starts upon boot, but there is no need to reboot the system, simply run netctl start my-network to initialize it immediately.
I was able to get help on the official Arch Linux forums, you can view my topic there.
Archlinux says, try dhcpcd in case your installer can't connect automatically. This worked on the spot for me AFTER installation. Just type "dhcpcd" as a command, wait a few seconds, and then "ip route" or "ping 8.8.8.8" to check if it works. I even used "watch ip address" to see how fast these inet and inet6 addresses pop up.
Instead of using dhcpcd, I can also connect from zero with:
modprobe e1000e ip link set dev eth0 up ip address add 192.168.0.16/24 dev eth0 ip route add 192.168.0.0/24 dev eth0 ip route add default via 192.168.0.1
e1000e is a "Network Driver", says modinfo. By loading this module I get a eth0 link (no, don't look for it in /dev). The "ip" commands activate the link, choose an address and define a local (subnet) and then a default gateway. It took me quite some time to test this out (ip link help, ip address help, ip route help. ).
So this is instructive, but "dhcpcd" is faster to type, and probably more robust. And you can stop it cleanly with "dhcpcd -x".
With a working ping and the mirrorlist in /etc/pacman.d/ you have all you need for pacman or pacstrap.
And yes, I saw a kernel message renaming eth0 to enoxxx, so you have to check first with "ip link" what interfaces are already set up by systemd. It happens here:
[ 3.052354] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) 94:c6:91:a5:39:b8 [ 3.052360] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection [ 3.052445] e1000e 0000:00:1f.6 eth0: MAC: 13, PHY: 12, PBA No: FFFFFF-0FF [ 3.055917] e1000e 0000:00:1f.6 eno1: renamed from eth0
The .16 in my address is just any (free) number, and 192.168.0.1 should always be the gateway. Maybe I was lucky, but it is good news that you can hack around under systemd and inet6. I will try netctl, though.
And right now I have booted with systemd and have dhcpcd started. I got address .15 on "eno1" and three inet6 addresses, but apart from that the result is quite the same as with above "ip"-hack.
3: eno1: mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 94:c6:91:a5:39:b8 brd ff:ff:ff:ff:ff:ff inet 192.168.0.15/24 brd 192.168.0.255 scope global noprefixroute eno1 valid_lft forever preferred_lft forever inet6 2a05:41c0:12:bf00::2/128 scope global dynamic noprefixroute valid_lft 2559430sec preferred_lft 572230sec inet6 2a05:41c0:12:bf00:f51e:97c1:de6f:6f49/64 scope global dynamic mngtmpaddr noprefixroute valid_lft 2591994sec preferred_lft 604794sec inet6 fe80::47cf:a2e4:af0b:b7cd/64 scope link valid_lft forever preferred_lft forever default via 192.168.0.1 dev eno1 proto dhcp src 192.168.0.15 metric 203 192.168.0.0/24 dev eno1 proto dhcp scope link src 192.168.0.15 metric 203