how to configure RTL8101/2/6E PCI E to detect link

9,405

Solution 1

If it has LED's, those two LEDs (Link & Activity) are NIC hardware controlled. So while cable plugged:

  • Link=off, ACT=off : It's a physical issue, no connection detected. (Usually socket/plug connection or cable)
  • Link=blink, ACT=off : Most NIC mean a connection error that could be detected, it's a physical issue. (Ex: only one wire pair connected)
  • Link=on, ACT=* : The physical connection is fine. Check at software level (driver).

Tested 1st and 3rd case using a homemade RJ45 Ethernet loop-back plug with and without driver loaded (e1000e from Intel) on this machine:

sudo dmidecode

BIOS Information
    Vendor: Dell Inc.
    Version: A16
    Release Date: 12/05/2013
System Information
    Manufacturer: Dell Inc.
    Product Name: Latitude E6410
    Version: 0001

sudo lshw -c network

  *-network               
       description: Ethernet interface
       product: 82577LM Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 19
       bus info: pci@0000:00:19.0
       logical name: eno1
       version: 05
       serial: 5c:26:0a:52:2b:16
       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=3.2.6-k firmware=0.12-1 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:25 memory:e9600000-e961ffff memory:e9680000-e9680fff ioport:8040(size=32)

If no LED's as your case:

  • Check to LED's of device in the other end of the cable (switch, router, another laptop, additional USB Ethernet adapter in same PC ...). You may use same command-line tools if it's another laptop or USB Ethernet adapter in same PC)

    If Link=on on the other device then your physical connection is ok, check driver.

Solution 2

Run watch -n 1 ethtool eth0 and watch for Link detected: yes.

I have the same hardware. This works for me.

Share:
9,405

Related videos on Youtube

JosephRuby
Author by

JosephRuby

Updated on September 18, 2022

Comments

  • JosephRuby
    JosephRuby over 1 year

    I have a newly acquired dell notebook that came with a RTL8101/2/6E PCI E Ethernet card installed. After scouring the Internet I can not find any solutions to get it to detect the cat5 cable when plugged in. I have verified the router and cable on other devices, but don't know how to verify the NIC itself.

    Below is all of the information I know how to obtain about the card:

    almostid@almostid:~$ uname -a
    Linux almostid 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    
    almostid@almostid:~$ sudo ethtool eth0
    Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Speed: 10Mb/s
        Duplex: Half
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000033 (51)
                       drv probe ifdown ifup
        Link detected: no
    
    
    almostid@almostid:~$ sudo mii-tool
    [sudo] password for almostid: 
    eth0: autonegotiation restarted, no link
    
    almostid@almostid:~$ sudo lshw -C network
      *-network               
           description: Wireless interface
           product: BCM43142 802.11b/g/n
           vendor: Broadcom Corporation
           physical id: 0
           bus info: pci@0000:06:00.0
           logical name: wlan0
           version: 01
           serial: 18:4f:32:ff:27:9b
           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.0.102 latency=0 multicast=yes wireless=IEEE 802.11abg
           resources: irq:18 memory:f7900000-f7907fff
      *-network
           description: Ethernet interface
           product: RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller
           vendor: Realtek Semiconductor Co., Ltd.
           physical id: 0
           bus info: pci@0000:07:00.0
           logical name: eth0
           version: 07
           serial: 20:47:47:4c:9d:19
           size: 10Mbit/s
           capacity: 100Mbit/s
           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 autonegotiation
           configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8106e-1_0.0.1 06/29/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
           resources: irq:41 ioport:e000(size=256) memory:f7800000-f7800fff memory:f2100000-f2103fff
    
    
    almostid@almostid:~$ lspci -nnk | grep -iA3 net
    06:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)
        Subsystem: Dell Wireless 1704 802.11n + BT 4.0 [1028:0016]
        Kernel driver in use: wl
        Kernel modules: bcma, wl
    07:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136] (rev 07)
        Subsystem: Dell RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [1028:0652]
        Kernel driver in use: r8169
        Kernel modules: r8169
    
    almostid@almostid:~$ lsusb
    Bus 001 Device 006: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
    Bus 001 Device 005: ID 0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0
    Bus 001 Device 004: ID 0c45:670b Microdia 
    Bus 001 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
    Bus 001 Device 002: ID 8087:8000 Intel Corp. 
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    
    almostid@almostid:~$ ifconfig
    eth0      Link encap:Ethernet  HWaddr 20:47:47:4c:9d:19  
              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)
    
    almostid@almostid:~$ rfkill list all
    0: dell-rbtn: Wireless LAN
        Soft blocked: no
        Hard blocked: no
    1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
    2: brcmwl-0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
    3: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
    
    
    almostid@almostid:~$ networkctl list
    WARNING: systemd-networkd is not running, output will be incomplete.
    
    IDX LINK             TYPE               OPERATIONAL SETUP     
      1 lo               loopback           n/a         unmanaged 
      2 eth0             ether              n/a         unmanaged 
      3 wlan0            wlan               n/a         unmanaged 
    
    3 links listed.
    
    almostid@almostid:~$ service network-manager status
    NetworkManager.service - Network Manager
       Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
       Active: active (running) since Fri 2016-12-16 14:32:51 EET; 43min ago
     Main PID: 1260 (NetworkManager)
       CGroup: /system.slice/NetworkManager.service
               ├─1260 /usr/sbin/NetworkManager --no-daemon
               ├─1883 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkM
               └─4145 /sbin/dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /var/run/dhclient-wlan0.pid -lf /var/lib
    
    Dec 16 15:09:39 almostid NetworkManager[1260]: <info>  [1481893779.9984] device (wlan0): state change: ip-check -> secondaries
    Dec 16 15:09:39 almostid NetworkManager[1260]: <info>  [1481893779.9988] device (wlan0): state change: secondaries -> activate
    Dec 16 15:09:39 almostid NetworkManager[1260]: <info>  [1481893779.9989] manager: NetworkManager state is now CONNECTED_LOCAL
    Dec 16 15:09:40 almostid dhclient[4145]: bound to 192.168.0.102 -- renewal in 3519 seconds.
    Dec 16 15:09:40 almostid NetworkManager[1260]: <info>  [1481893780.1108] manager: NetworkManager state is now CONNECTED_GLOBAL
    Dec 16 15:09:40 almostid NetworkManager[1260]: <info>  [1481893780.1110] policy: set 'Supertatik' (wlan0) as default for IPv4 
    Dec 16 15:09:40 almostid NetworkManager[1260]: <info>  [1481893780.1112] dns-mgr: Writing DNS information to /sbin/resolvconf
    Dec 16 15:09:40 almostid dnsmasq[1883]: setting upstream servers from DBus
    Dec 16 15:09:40 almostid dnsmasq[1883]: using nameserver 192.168.0.1#53
    Dec 16 15:09:40 almostid NetworkManager[1260]: <info>  [1481893780.1187] device (wlan0): Activation: successful, device activa
    
    almostid@almostid:~$ iwlist eth0 channel
    eth0      no frequency information.
    
    almostid@almostid:~$ iwlist eth0 scan
    eth0      Interface doesn't support scanning.
    

    How do I properly determine if the NIC is capeable of detecting a link or physically broken?

    Edit: included ethtool eth0 with sudo permissions instead of without. dmesg has not entries that match dmesg | grep -i 'eth' .

    Edit: new information from dmesg.

    almostid@almostid:~$ dmesg | grep -i 'eth'
    [    1.191104] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
    [    1.191530] r8169 0000:07:00.0 eth0: RTL8106e at 0xffffc9000001e000, 20:47:47:4c:9d:19, XID 04900000 IRQ 41
    [    1.280878] ACPI Error: Method parse/execution failed [\_SB.PCI0.RP05.PEGP.DD02._BCL] (Node ffff88012b0f15f0), AE_NOT_FOUND (20150930/psparse-542)
    [   28.139570] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [   34.101488] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [   34.361253] r8169 0000:07:00.0 eth0: link down
    [   34.361297] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    
    almostid@almostid:/sys/class/net$ grep -Hs . eth0/*
    eth0/addr_assign_type:0
    eth0/address:20:47:47:4c:9d:19
    eth0/addr_len:6
    eth0/broadcast:ff:ff:ff:ff:ff:ff
    eth0/carrier:0
    eth0/carrier_changes:1
    eth0/dev_id:0x0
    eth0/dev_port:0
    eth0/dormant:0
    eth0/duplex:half
    eth0/flags:0x1003
    eth0/gro_flush_timeout:0
    eth0/ifindex:2
    eth0/iflink:2
    eth0/link_mode:0
    eth0/mtu:1500
    eth0/netdev_group:0
    eth0/operstate:down
    eth0/proto_down:0
    eth0/speed:10
    eth0/tx_queue_len:1000
    eth0/type:1
    eth0/uevent:INTERFACE=eth0
    eth0/uevent:IFINDEX=2
    
    • mattia.b89
      mattia.b89 over 7 years
      1- post dmesg output before and after you plug in the cable 2- post sudo ethtool eth0 output before and after you plug in the cable
    • wjandrea
      wjandrea over 7 years
    • JosephRuby
      JosephRuby over 7 years
      @wjandrea a helpful post, thanks. Unfortunately still not able to check the actual status of the connection with that information.
  • wjandrea
    wjandrea over 7 years
    Quick check: ethtool eth0 | grep -F 'Link detected: yes'. Functionalized: ethernet_is_connected()( ethtool eth0 2>/dev/null | grep -qF 'Link detected: yes' )
  • JosephRuby
    JosephRuby over 7 years
    @wonderer this is a good method to watch for when the link is detected, but what do you do that causes the link to actually come up?
  • JosephRuby
    JosephRuby over 7 years
    There are no LEDs installed on my model.
  • wjandrea
    wjandrea over 7 years
    @JosephRuby I have a different Realtek card, and on mine it showed "yes" once the cable was connected between the PC and router.
  • user.dz
    user.dz over 7 years
    @JosephRuby, update my answer, to check what the 2nd device on the other end of the cable says.
  • user.dz
    user.dz over 7 years
    @JosephRuby, BTW, make a close look at your laptop Ethernet, sometimes a pin just stuck down, you just need to touch with a needle to free it.
  • JosephRuby
    JosephRuby over 7 years
    an excellent option for checking to see if the nic is physically capable of working. I built an arduino with ethernet adapter to verify that my network card is not physically broken. Accepting as the correct answer.