Линукс network is unreachable

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. 

Источник

Читайте также:  Merging partitions in linux

Since this morning the network is unreachable Ubuntu 18:04

marco@pc01:$ sudo lshw -class network *-network DISABLED description: Ethernet interface product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller *-network DISABLED description: Wireles interface product: AR9227 Wireless Network Adapter *-network:0 description: Ethernet interface physical id: 2 logical name : docker0 *-network:1 description: Ethernet interface physical id: 3 
iface eth0 inet static address 192.168.1.7 netmask 255.255.255.0 network 192.168.1.1 broadcast 192.168.0.255 post-up iptables-restore < /etc/iptables.up.rules gateway 192.168.1.1 dns-nameservers 192.168.0.5 8.8.8.8 marco@pc01:$ sudo service network-manager restart Failed to restart network-manager.service: Unit network-manager.service not found 
marco@pc01:$ sudo /etc/init.d/networking restart [ok] Restarting networking (via systemctl): networking.service marco@pc01:$ ping 192.168.1.4 connect: Network is unreachable 

What have I to do in order to make the network available again? Looking forward to your kind help Marco 1° Update:

marco@pc01:$ ip addr show 1: lo: mtu 65536 qdisc noqueue state UNKOWN group default qlen 1000 inet 27.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp3s0: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 78:24:af:43:ef:5c brd ff:ff:ff:ff:ff:ff 3: wlp5s0: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether c0:4a:00:09:0e:80 brd ff:ff:ff:ff:ff:ff 4: b3-4f9fe03b1a66: mtu 1500 qdisc noqueue state DOWN group default link/ether 02:42:64:29:65:73 brd ff:ff:ff:ff:ff:ff inet 172.22.0.1/16 brd 172.22.255.255 scope global br-4f9fe03b1a66 valid_lft forever preferred_lft forever 5: docker0: mtu 1500 qdisc noqueue state DOWN group default link/Ether 02:42:01:ea:90:66 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255 scoper global docker0 valid_lft forever preferred_lft forever 
marco@pc01:$ ifconfig eth0 up eth0: ERROR while getting interface flags: eth0: ERROR while getting interface flgs: No such device eth0: Host name lookup failure marco@pc01:$ ifconfig br-4f9feo3b1a66: flags=4099 mtu 1500 inet 192.22.0.1 netmask 255.255.0.0 broadcast 172.22.255.255 ether 02:42:4d:c4:bd:62 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0B) RX errors 0 dropped 0 overruns 0 frame 0 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 docker0: flags=4099 mtue 1500 inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:24:b9:3b:59 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 l0: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefoxlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 258 bytes 32343 (32.3 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 258 bytes 32343 (32.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 
 auto lo iface lo inet loopback 
iface enp3s0 inet static address 192.168.1.7 netmask 255.255.255.0 network 192.168.1.1 broadcast 192.168.0.255 post-up iptables-restore < /etc/iptables.up.rules gateway 192.168.1.1 dns-nameservers 192.168.0.5 8.8.8.8 
 marco@pc01:$ uname -r 4.15.0-55-generic marco@pc01:$ ls -al /etc/netplan total 20 drwxr-xr-x 2 root root 4096 Jul 25 18:37 drwxr-xr-x 128 root root 12288 Jul 25 12:51 -rw-r--r-- 1 root root 616 Jul 25 18:37 30-cloun-init.yaml etc/netplan/50-cloud-init.yaml : network: renderer: NetworkManager/ networkd ethernets: enp3s0: addresses: [192.168.1.7/24] gateway4: 192.168.1.1 nameservers: addresses: [8.8.8.8,8.8.4.4] dhcp4: no version: 2 marco@pc01:$ sudo netplan apply sudo: netplan: command not found 
marco@pc01:$ dpkg -l *netplan* Desired=Unknown/Install/Remove/Purge/Hold Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig- pend Err?=(none)/Reinst-required (Status,Err: uppercase=bad) Name Version Architecture Description in netplan.io amd64 (no description available) 
marco@pc01:$ sudo lshw -c network *-network DISABLED description : Ethernet interface product: RTL811178168/8411 PCI Express Gigabit Ethernet Controller vendor: Realtek Semiconductor CO., Ltd. physical id: 0 bus info: pci@000:03:00.0 logical name: enp3s0 version: 11 serial: 78:24:af:43:ef:5c size: 100 Mbit/s capacity: 1Gbit/s width: 64 bits clock: 33 Mhz capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation configuration: autonegotiaion=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full latency=0 link=no multcast=yes port=MII speed=100Mbit/s resources: irq:18 ioport:d000(size=256) memory:f7200000-f7200fff memory:f2100000-f2103fff *-network DISABLED description: Wireless interface product: AR9227 Wireless NEtwork Adapter vendor: Qualcomm Atheros physical id: 0 bus info: pci@0000:05:00.0 logical name: wlp5s0 version: 01 serial: c0:4a:00:09:0e:80 width: 32 bits clock: 66MHz capabilities: pm bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=ath9k driverversion=3.15.0-55- generic firmware=N/A latency=168 link=no multicast=yes wireless=IEEE 802.11 resources: irq:19 memory:f7100000-f10ffff *-network:0 description: Ethernet interface physical id: 2 logical name: docker0 serial: 02:42:62:12:98:6e capabilities: ethernet physical configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.17.0.1 link=no multicast=yes *-network:1 description: Ethernet interface physical id:3 logical name: br-4f9fe03b1a66 serial: 01:42:fc:9e:92:1c capabilities: ethernet physical consiguration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.22.0.1 link=no multicast=yes 
Two disks: 1° disk: /dev/sda1 1M BIOS boot /dev/sda2 1G Linux filesystem /dev/sda3 232G Linux filesystem with sudo fsck -f : everything ok ; 2° disk: /dev/sdb1 1M BIOS boot /dev/sdb2 232G Linux filesystem sudo fsck -f /dev/sdb1 fsck from util-linux 2.31.1 e2fsck 1.44.1 (24-Mar-2018) ext2fs_open2: Bad magic number in super-block fsck.ext2: Supeblock invalid, trying backup blocks. fsck.ext2: Bad magic number in super-block whule trying to open /dev/sdb1 The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 or e2fsck -b 32768
ubuntu@ubuntu:$ sudo fsck -f /dev/sda2 fsck fromutil-linux 2.31.1 e2fsck 1.44.1 (24-Mar-2018) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sda2: 309/65536 files (2.9% non-contiguous), 48744/262144 blocks ubuntu@ubuntu:$ sudo fsck -f /dev/sdb2 fsck from util-linux 2.31.1 
ubuntu@ubuntu:/etc/netplan$ sudo netplan --debug generate DEBUG:command generate: running ['/lib/netplan/generate'] ** (generate:4715): DEBUG: 15:57:43.284: Processing input file /etc/netplan/01-network-manager-all.yaml.. ** (generate:4715): DEBUG: 15:57:43.285: starting new processing pass to 1 ** (generate:4715): DEBUG: 15:57:43.285: Configuration is valid ** (generate:4715): DEBUG: 15:57:43.285: Generating output files.. ** (generate:4715): DEBUG: 15:57:43.285: NetworkManager: definition enp3s0 is not for us (backend 1) 

Источник

Читайте также:  Анализ wifi каналов linux

"Network is unreachable" when attempting to ping google, but internal addresses work

I can get to other PCs in my house on the 192 network, but trying to go outside gives me the "network is unreachable" message. p3p1 is up with a good IP Address. Running Fedora 16. What should I do next to troubleshoot? All other PCs in the house are working (Windows, Mac).

Does any other PCs in your house have external internet access? (Can other PC ping google?) Restarted your house ADSL/cable/? modem?

Ping 8.8.4.4 fails @MariusMatutiae - same error, "connect: Network is unreachable." But then I did a "route -n" and realized I had no gateway, added one ("route add -net 0.0.0.0 gw 192.168.1.1 p3p1") and now I can ping 8.8.4.4 but still not 74.125.229.194 (google).

Yes @r3mus I can ping 192.168.1.1. On a working machine I go to "whatismyipaddress.com" and get my external address, and can ping that successfully as well from my failing machine.

3 Answers 3

You say all other pcs in your house have a connection. Then the problem lies only with your linux machine. There are several possibilities:

    You do have a connection, but you cannot reach your DNS; you can diagnose this by

if you can reach Google, then you have a connection, and you only need to update your DNS servers. Edit (as sudo) your /etc/resolv.conf file and add these two lines:

nameserver 8.8.8.8 nameserver 8.8.4.4 
default via 192.168.11.1 dev wlan0 proto dhcp metric 600 

(this is for my laptop). What is important is that the correct IP address of your router is shown exactly where mine (192.168.11.1) is shown. If an incorrect IP address is shown, or, worse, if the ip route show default command receives no reply, then your routing table has been corrupted. You may simply restore it by means of:

sudo ip route del default (only if the wrong IP address appears) sudo ip route add default via IP.address.OfYour.Router 

Источник

Оцените статью
Adblock
detector