# realtek 8168B (r1000) networking woes

## nihilo

I've just installed Gentoo on a brand new machine, but have not been able to get the realtek nic to work.

lspci shows it as:

```
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
```

The kernel I'm running is 2.6.19-rc5 mm2 (mm-sources), because gentoo-sources doesn't have support for my jmicron controller. I've tried using both the r8169 kernel module, and have also downloaded the version 1.04 r1000 src from realtek.

The kernel module didn't work (inserted fine, but got host unreachable always), so I tried the realtek module. I was able to compile the module and modprobe/insmod it. dmesg shows that it loads okay:

```
eth0: Identified chip type is 'RTL8168B/8111B'.

eth0: r10001.04, the Linux device driver for Realtek Ethernet controllers at 0xe800, 00:16<my_mac>:af, IRQ 17

Realtek RTL8168/8111 Family PCI-E Gigabit Ethernet Network Adapter

Driver version:1.04

Released date:2006/07/07

Link Status:Linked

Link Speed:100Mbps

Duplex mode:Full-Duplex

I/O Base:0xE800(I/O port)

IRQ:17
```

Here is my /etc/conf.d/net file:

```
config_eth0=( "192.168.101.20 netmask 255.255.255.0 brd 192.168.101.255" )

routes_eth0=( "default gw 192.168.101.1" )

gateways_eth0=( "192.168.101.1" )

dns_servers_eth0=( "192.168.101.1" )
```

I can start eth0 fine, and then ifconfig and route show:

```
noname ~ # ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:16:<my_mac>:AF

          inet addr:192.168.101.20  Bcast:192.168.101.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:660 (660.0 b)

          Interrupt:17 Base address:0xe800

noname ~ # route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.101.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

0.0.0.0         192.168.101.1   0.0.0.0         UG    0      0        0 eth0
```

All this looks good to me so far, but I can't even ping the router (192.168.101.1). The lights on the nic are what they should be, indicating it's up and running, but pinging the router or anything else looks like:

```
noname ~ # ping 192.168.101.1

PING 192.168.101.1 (192.168.101.1) 56(84) bytes of data.

From 192.168.101.20 icmp_seq=2 Destination Host Unreachable

From 192.168.101.20 icmp_seq=3 Destination Host Unreachable

From 192.168.101.20 icmp_seq=4 Destination Host Unreachable

From 192.168.101.20 icmp_seq=6 Destination Host Unreachable

From 192.168.101.20 icmp_seq=7 Destination Host Unreachable

From 192.168.101.20 icmp_seq=8 Destination Host Unreachable
```

I have verified that I can use the exact same configuration and exact same cable on a different machine, and it does work fine. My router does mac filtering, but i've registered the new address, and I also tried turning off mac filtering to be extra paranoid. Still no luck.

Does anybody have any suggestions for what else I might try?

Thanks for any info. I'm kind of at a loss on how to proceed from here.

----------

## sugar

dmesg give any errors once you try pinging something?

----------

## nihilo

 *sugar wrote:*   

> dmesg give any errors once you try pinging something?

 

No, there is nothing new in dmesg output after pinging.

----------

## nihilo

Anybody know what else I might try to figure this out?

----------

## Lloeki

some facts:

- I have a 8168 too, but no jmicron

- r1000_v104 worked successfully for me against gentoo-sources-2.6.18

- gentoo-sources-2.6.18-r3 has support for 8168 via 8169, I use that successfully now (upgraded yesterday)

- emission-sources-2.6.18-r1 has libata from git, thus jmicron support 

so you could try going back to the emission 2.6.18 (some things changed since 2.6.19_rc2 IIRC) and build r1000_v104 against that

----------

## ChL@Gentoo

I have a jmicron controller and a realtek 8111B (the same driver as for 8168) and for me the kernel 2.6.19-rc6 with the module r8169 works.

(Before I had the emission sources with the r1000 driver but that did not work 100% properly.)

----------

## nihilo

Thanks for the responses, ChL@Gentoo & Lloeki. 

I've now also tried emission-sources-2.6.18-r1 and vanilla-sources-2.6.19_rc6. In both cases, I see exactly the same behavior (Destination Host Unreachable).

I'm beginning to think maybe the hardware is bad (this is a new motherboard), or there is an irq conflict or something, but I don't have a clue how to go about debugging that kind of thing.

This is what /proc/interrupts looks like, in case anybody can see anything obviously wrong with it:

```
           CPU0       CPU1

  0:    1293400          0   IO-APIC-edge      timer

  1:          2          0   IO-APIC-edge      i8042

  8:          2          0   IO-APIC-edge      rtc

  9:          0          0   IO-APIC-fasteoi   acpi

 12:          4          0   IO-APIC-edge      i8042

 16:      96258          0   IO-APIC-fasteoi   uhci_hcd:usb3, nvidia

 17:      11128          0   IO-APIC-fasteoi   ide2, eth0

 18:          0          0   IO-APIC-fasteoi   uhci_hcd:usb6

 19:          0          0   IO-APIC-fasteoi   ehci_hcd:usb1, uhci_hcd:usb7

 20:      22052          0   IO-APIC-fasteoi   ehci_hcd:usb2, uhci_hcd:usb5

 21:          0          0   IO-APIC-fasteoi   uhci_hcd:usb4

 22:        159          0   IO-APIC-fasteoi   HDA Intel

 23:          2          0   IO-APIC-fasteoi   ohci1394

219:       6768          0   PCI-MSI-edge      libata

NMI:          0          0

LOC:    1294494    1294842

ERR:          0

MIS:          0
```

----------

## ChL@Gentoo

I think it's rather a network configuration problem (IP-address, gateway, ...) or something like that.

----------

## nihilo

 *ChL@Gentoo wrote:*   

> I think it's rather a network configuration problem (IP-address, gateway, ...) or something like that.

 

Not likely since the exact same configuration works perfectly fine on a different machine, and after buying a cheap $5 pci ethernet card, that works perfectly fine on the very same machine with the identical config (just eth1 substituted for eth0).

My /etc/conf.d/net is above and is correct as far as I can see. I also tried various other settings too. 

I don't think it has anything to do with the network settings, which is what led me to think about how the hardware could not be working correctly. Unfortunately I don't know the first thing about irqs and the like or other lower-level potential problems.

----------

## Lloeki

well, irq issues are nowaday fairly rare. nonetheless you could try kernel args like 'pci=', among which there are pci=routeirq, pci=noacpi pci=nommconf and a few others.

----------

## nihilo

 *Lloeki wrote:*   

> well, irq issues are nowaday fairly rare. nonetheless you could try kernel args like 'pci=', among which there are pci=routeirq, pci=noacpi pci=nommconf and a few others.

 

Thanks for the suggestions. I had already tried pci=routeirq based on something I saw somewhere (still didn't work), but I wasn't aware of the others. I'll try them out next time I can afford the time to shutdown and reboot a couple of times.

----------

## Lloeki

to further diagnose, you can also try 'arping' (see man arping)

----------

