I'm an absolute novice to Linux/Ubuntu and network, don't even know how to use vi editor yet. Just installed ubuntu 16.04 for about a week and happy learning online. However the wired connection, which has been fine for a week, lost all of a sudden when I turned on my computer today. I tried to find some solution by googling, and noticed that someone here asked the similar question couple of months ago, which turned out just bad wires. So I checked my hardware, changed 3 cable wires, one is brand new came with my new router (Netgear AC1900 R7000). the following is the info I gathered by reading some posts
ifconfig -a
:
eth0 Link encap:Ethernet HWaddr 00:1a:6b:36:35:51
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)
Interrupt:20 Memory:fe000000-fe020000
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:2390 errors:0 dropped:0 overruns:0 frame:0
TX packets:2390 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:202319 (202.3 KB) TX bytes:202319 (202.3 KB)
wlan0 Link encap:Ethernet HWaddr 00:13:e8:21:fd:c9
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:4047 errors:0 dropped:0 overruns:0 frame:0
TX packets:3489 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3294308 (3.2 MB) TX bytes:485753 (485.7 KB)
some ping test:
$ ping 8.8.8.8
connect: Network is unreachable
$ ping 192.168.1.1
connect: Network is unreachable
route -n
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
ip route show
returns nothing.
I could get online by wireless, however the results of ping tests are very odd. It keeps running, I have to break it by Ctrl+C
$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.00 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.33 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.33 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=1.33 ms
64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=1.36 ms
......
64 bytes from 192.168.1.1: icmp_seq=17 ttl=64 time=0.667 ms
35 packets transmitted, 35 received, 0% packet loss, time 34019ms
rtt min/avg/max/mdev = 0.667/1.024/2.008/0.355 ms
same for ping 8.8.8.8
, just the last 2 lines different
--- 8.8.8.8 ping statistics ---
16 packets transmitted, 15 received, 6% packet loss, time 15023ms
rtt min/avg/max/mdev = 9.357/11.939/30.631/5.519 ms
route -n
and ip route show
gave the following result under wireless connection.
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 600 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlan0
$ ip route show
default via 192.168.1.1 dev wlan0 proto static metric 600
169.254.0.0/16 dev wlan0 scope link metric 1000
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.8 metric 600
I have not installed or removed anything from last night when everything running normal and alright. I don't know why all of a sudden the wired connection lost, even under wireless connection things don't look right, though I could get online - like post this asking-for-help post.
If you need more information, please be very detail and specific, like what should I type in command line, how do I get out of vi or any other easy editor I could temporarily use.
=========================update========================
the output of interfaces and NetworkManager.conf
cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false
So my interfaces was looking like
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
Do I delete these 2 lines or just added your above 2 line in-middle like this
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
auto eth0
iface eth0 inet dhcp
iface lo inet loopback
Right now my interfaces file is as below, but still no wired connection after re-boot (which took about 6 mins)
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
ping
's default behaviour is to run forever until you kill it. If you want it to terminate after N packets, useping -c N
./etc/network/interfaces
and/etc/NetworkManager/NetworkManager.conf
you can do that by typing incat /path/to/file