USB ethernet converter does not automatically connect

I have a usb hub with an ethernet converter (https://www.anker.com/products/A7522012) which I would like to use to connect to the internet when wifi is not available. Unfortunately the connection is not recognised automatically. The only way I have found to start yast’s network settings configuration. The probe that does is the only thing I have found to initiate an ethernet connection with this ethernet converter.

The ethernet converter (from Realtek) uses the r8152 driver.

When I initially plug in an ethernet cable to the converter nothing happens. Here is dmesg output:


   11.556476] usbcore: registered new interface driver r8152
   11.556732] initcall rtl8152_driver_init+0x0/0x1000 [r8152] returned 0 after 151778 usecs
   11.558942] calling  usbnet_init+0x0/0x1000 [usbnet] @ 688
   11.559202] initcall usbnet_init+0x0/0x1000 [usbnet] returned 0 after 0 usecs
   11.561122] r8152 2-3.1.3:1.0 enp0s20u3u1u3: renamed from eth0
   11.561536] calling  cdc_driver_init+0x0/0x1000 [cdc_ether] @ 688
   11.561866] usbcore: registered new interface driver cdc_ether
   11.562151] initcall cdc_driver_init+0x0/0x1000 [cdc_ether] returned 0 after 321 usecs
   11.596038] IPv6: ADDRCONF(NETDEV_UP): enp0s20u3u1u3: link is not ready
   11.625811] IPv6: ADDRCONF(NETDEV_UP): enp0s20u3u1u3: link is not ready

When I first try the yast network settings (that is when I plug in the converter to a usb port) the computer completely freezes then crashes, just switches off and reboots. After this reboot the ethernet works fine. If I unplug the cable and re-plug it in I have to reload yast network settings to initiate the connection again.

The hub and converter comes with udev rules, which I tried placing in /etc/udev/rules.d but this did not help. I also found a post on the ArchWiki (https://bbs.archlinux.org/viewtopic.php?id=193238) which suggested adding the line USB_BLACKLIST=“0bda:8152” to /etc/default/tlp. This also did not help.

The hub also comes with code to compile the kernel module (which I think is a later version than the one already in the kernel), but the compilation fails with the error

 error: ‘NETIF_F_ALL_CSUM’ undeclared (first use in this function)

Any help would be appreciated. Basically all I would like is to be able to plug in the hub and an ethernet cable and be connected to the internet, without having to reboot or start up yast to initiate the connection.

error: ‘NETIF_F_ALL_CSUM’ undeclared (first use in this function)

That was an error for Kernel > 4.5.
You have to patch the driver.

Maybe this will work:
http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=14&PFid=55&Level=5&Conn=4&DownTypeID=3&GetDown=false

Yes, this version compiled properly. Thanks very much for the pointer (I had got the code from the Anker website, and that was an older version, plus there were additional udev rules in the version linked here, which might also have made a difference).

Things work more or less as expected now. Plugging the ethernet cable into the hub (which is already plugged in) still does nothing, unless initiated by yast network settings, or hardware scan. But plugging the hub into the usb port with the ethernet cable already attached to the hub initiates a connection. This should do for all practical purposes.

Thanks again.

Please post:

lsusb

To see the ID of your Converter…

Bus 002 Device 004: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter


Verbose output


Bus 002 Device 004: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x8153 RTL8153 Gigabit Ethernet Adapter
  bcdDevice           30.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 6 
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           57
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               64mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               8
        bMaxBurst               0
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           98
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               64mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      6 Ethernet Networking
      bInterfaceProtocol      0 
      iInterface              5 
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC Ethernet:
        iMacAddress                      3 (??)
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               8
        bMaxBurst               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              4 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3