PDA

View Full Version : [SOLVED] Wired connection doesn't work - route table is empty



momocorpo
September 8th, 2015, 10:36 PM
Hello,
I just installed ubuntu 14.04 LTS in a partition next to Windows 7 and my Internet connection doesn't work when it works using Windows 7.

"ifconfig -a" shows that I have eth0 and lo and when I do "ifconfig eth0 up" I still don't have a connection, and it doesn't show any inet addr except for ipv6.
"route" shows an empty table
"ping 8.8.8.8" Connect : Network is unreachable
I tried "service network-manager restart", adding "auto eth0" and "iface eth0 inet dhcp" to "/etc/network/interfaces" so far nothing worked...

Maybe I have a driver problem? I can still ping to localhost.

I'm completly lost.

Thanks!

TheFu
September 9th, 2015, 12:00 AM
http://blog.jdpfu.com/2013/03/01/linux-troubleshooting-101-networking
Be clear if you are using network manager or not.

momocorpo
September 9th, 2015, 12:36 AM
I hope this is what you were asking.

dmesg |grep eth[0-9] :



[ 2.831118] e1000e 0000:00:19.0 eth0: registered PHC clock
[ 2.831121] e1000e 0000:00:19.0 eth0: (PCI Express:2.5GT/s:Width x1) 28:80:23:d8:5d:3f
[ 2.831123] e1000e 0000:00:19.0 eth0: Intel(R) PRO/1000 Network Connection
[ 2.831169] e1000e 0000:00:19.0 eth0: MAC: 11, PHY: 12, PBA No: FFFFFF-0FF
[ 11.594778] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 13.101800] e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: Rx/Tx
[ 13.101805] e1000e 0000:00:19.0 eth0: 10/100 speed: disabling TSO
[ 13.101852] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready


sudo lshw -C network :


*-network
description: Ethernet interface
product: Ethernet Connection I217-V
vendor: Intel Corporation
physical id: 19
bus info: pci@0000:00:19.0
logical name: eth0
version: 04
serial: 28:80:23:d8:5d:3f
size: 100Mbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=2.3.2-k duplex=full firmware=0.12-3 ip=192.168.1.10 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:30 memory:d0700000-d071ffff memory:d073f000-d073ffff ioport:3080(size=32)
*-network
description: Wireless interface
product: BCM43228 802.11a/b/g/n
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000:02:00.0
logical name: wlan0
version: 00
serial: 18:cf:5e:11:25:7b
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=wl0 driverversion=6.30.223.248 (r487574) ip=192.168.1.16 latency=0 multicast=yes wireless=IEEE 802.11abg
resources: irq:18 memory:d0500000-d0503fff


more /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
nameserver 192.168.1.1 // I added this myself to try, this is my router address
nameserver 127.0.1.1
search home


route -n :


Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0

Edit: updated the command's result after reinstalling ubuntu and having the wi-fi working (and enabled)

TheFu
September 9th, 2015, 08:35 AM
Good news. Looks like you have a NIC that is well supported with a solid driver.
Can you tell us a little about your network, so we don't have to guess 20 different issues?
* network manager being used? In Ubuntu, that is the GUI tool.
* is this a laptop or desktop?
* router running DHCP? reboot it?
* try swapping the ethernet cable?
* If you edit the /etc/network/interfaces file, it thinks you want to manually control the networking. If you want to use network-manager don't touch it.

momocorpo
September 9th, 2015, 12:42 PM
I'm not sure how to tell if network manager is being used.
I reinstalled, this time I allowed Ubuntu to install third party software and the Wi-fi works!
This is a laptop, HP ProBook 650 G1.
Since I my wi-fi now works I believe the router is running DHCP, I tried to reboot it and it didn't change.
I tried 2 different cables, both work with windows but none but Ubuntu.

I've rolled back /etc/network/interfaces to


auto lo
iface lo inet loopback

Then used "service network-manager restart" but it didn't change anything.

When I click on the "connection" icon in the top right corner, I don't see the wired connection 1 anymore, only the ethernet connection 1 which uses eth0 and automatic method for IPv4 (nothing else is wirtten in it).

TheFu
September 9th, 2015, 01:13 PM
Network manager works best (only) when simple connections are used. In theory, it should see the wired connection and use that over the wifi. If that doesn't work - well, you can add a manual connection in the wired section and fill in appropriate data for your network.

I don't use network manager or the GUI. Hopefully someone else will see this, see that you've provided real data above and will get you working on the wired connection. If you don't know much about networking, this is the best course of action. Wired is always, always better than wifi.

Allowing proprietary software means that wifi drivers and video drivers from the vendors can be used.

If you've reloaded the OS (why????) - please repost the data from above again - and label it so someone not reading every detail here knows this.

momocorpo
September 9th, 2015, 02:21 PM
I cannot add a wired connection, it isn't in the connection type list. I think ubuntu isn't seeing my cable connected.

I'll update the data.

SeijiSensei
September 9th, 2015, 03:33 PM
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0

Your computer has multiple routes for the 192.168.1.0/24 network using the both wired and wireless interfaces. I've had this happen when I moved a machine from wired to wireless. If you're connected over the wireless, issue the command

sudo ip route del 192.168.1.0/24 dev eth0
Everything should work fine after that.

If you want to connect over the wired network, check that you don't also have a route via wlan0. If you do, use the same command above with "wlan0" rather than "eth0".

TheFu
September 9th, 2015, 04:18 PM
Wow - can't believe I missed that!
Was the route output included before?

andretahim
September 9th, 2015, 05:48 PM
Hi,

I have a similar problem, maybe this post is the correct one to solve it. I recently installed Ubuntu 14.04 on a desktop in my university and I will only use wired connection. This connection works great on windows 7 (partition on the same desktop). Looking for solutions I saw many commands that might be useful for advanced users to help me out. Thanks in advance.


~$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 10:c3:7b:c4:60:be
inet addr:192.168.174.119 Bcast:192.168.174.255 Mask:255.255.255.0
inet6 addr: fe80::12c3:7bff:fec4:60be/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2270 errors:0 dropped:0 overruns:0 frame:0
TX packets:89 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:367221 (367.2 KB) TX bytes:10675 (10.6 KB)


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:93 errors:0 dropped:0 overruns:0 frame:0
TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8191 (8.1 KB) TX bytes:8191 (8.1 KB)




~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.174.1 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.174.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0




~$ ip route show
default via 192.168.174.1 dev eth0
169.254.0.0/16 dev eth0 scope link metric 1000
192.168.174.0/24 dev eth0 proto kernel scope link src 192.168.174.119






~$ sudo vi /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback


~$ sudo lshw |grep -ia2 net
configuration: driver=pcieport
resources: irq:18 ioport:e000(size=4096) ioport:f0000000(size=1048576)
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
--
width: 64 bits
clock: 33MHz
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: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168f-1_0.0.5 06/18/12 ip=192.168.174.119 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:27 ioport:e000(size=256) memory:f0004000-f0004fff memory:f0000000-f0003fff

TheFu
September 9th, 2015, 08:04 PM
andretahim - please create your own thread. Your issue probably is not related. Thread hijacking is frowned upon in these forums.

and please use "code tags" like the OP did, so cmd output is easier to read.

momocorpo
September 9th, 2015, 08:52 PM
Your computer has multiple routes for the 192.168.1.0/24 network using the both wired and wireless interfaces. I've had this happen when I moved a machine from wired to wireless. If you're connected over the wireless, issue the command

sudo ip route del 192.168.1.0/24 dev eth0
Everything should work fine after that.

If you want to connect over the wired network, check that you don't also have a route via wlan0. If you do, use the same command above with "wlan0" rather than "eth0".

Will I be able to switch from wireless to wired without using this command everytime?
As of now, the wireless works, but I'd like to be able to connect using wired when possible, and wireless when it isn't an option.


Wow - can't believe I missed that!
Was the route output included before?
No, my previous ubuntu didn't work at all, wired and wireless, so the routing table was empty.

TheFu
September 9th, 2015, 09:06 PM
No, my previous ubuntu didn't work at all, wired and wireless, so the routing table was empty.

An empty routing table is almost always bad.
A healthy routing table looks like this:

$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default rt1 0.0.0.0 UG 0 0 0 eth0
172.22.22.0 * 255.255.255.0 U 0 0 0 eth0

Obviously, your subnets are probably different from mine and your gateway probably doesn't have a name (mine is in DNS) as "rt1" on the LAN. Regardless, you get the idea. 2 lines using the same interface (eth0) is good. If there are multiple interfaces that you need active or multiple routes for different places (usually a work thing), it can be done, but I'd strongly suggest removing network-manager if that is the case and doing this stuff all manually through scripts or text config files. Make sense?

momocorpo
September 9th, 2015, 09:18 PM
Thanks, I'll keep the wireless connection since it's the one that works the best for the moment. At least I know what to do if I am required to use a wired connection!