I had a customer today who brought in a laptop and wanted to switch over to Ubuntu linux. I always try to go the extra mile for people who want to convert to Linux. After installing Ubuntu 10.04 LTS, I rebooted and to my dismay the wired (eth0) interface was not working. I always run into wireless problems with Linux but its pretty rare that a wired interface doesn’t work. Below I show the fairly simple fix.
First, here is the lspci output:
- root@ubuntu:~$ lspci | grep 8139
- 01:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
As we can see the modules are loaded:
- root@ubuntu:~$ lsmod | grep 8139
- 8139too 31616 0
- 8139cp 27520 0
- mii 13440 2 8139too,8139cp
Looking at dmesg it apears every thing is ok:
- root@ubuntu:~$ dmesg | grep 8139
- [ 3.631942] 8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004)
- [ 4.280361] 8139cp 0000:01:07.0: This (id 10ec:8139 rev 10) is not an 8139C+ compatible chip
- [ 4.280368] 8139cp 0000:01:07.0: Try the "8139too" driver instead.
- [ 4.284116] 8139too Fast Ethernet driver 0.9.28
- [ 4.284423] 8139too 0000:01:07.0: PCI INT A -> Link[APC3] -> GSI 18 (level, high) -> IRQ 18
- [ 4.285237] eth0: RealTek RTL8139 at 0xc400, 00:40:95:30:62:5e, IRQ 18
- [ 4.285240] eth0: Identified 8139 chip type 'RTL-8139C'
And even more oddly, the interface is listed in iwconfig:
- root@ubuntu:~$ ifconfig -a
- eth0 Link encap:Ethernet HWaddr 00:40:95:30:62:5e
- 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:18 Base address:0xc400
But what was happening was the interface would never get a address via dhcp and I also could not connect to the internet even when I set the IP statically.
Turns out there were some issues with auto setting the links speed.
Using the mii-tool to force set the speed worked:
- root@ubuntu:~$ mii-tool eth0 -F 10baseT-FD
- root@ubuntu:~$ rmmod 8139too
- root@ubuntu:~$ modprobe 8139too
(Obviously you need to add sudo to those commands if you are not root)
After that my eth0 interface worked great and the settings also survived a reboot so once you set it once you should be good after that.