Openwrt with AX88179B USB network adapters on a rpi 4b


Spoiler … it didn’t work, yet.

So, my current network setup is:

[ISP 1]───┐                                   ┌──►[mesh network]
          ├──►[cudy r700]◄──►[dummy switch]──►│──►[nas]
[ISP 2]───┘                                   └──►[pihole + smokeping]

Basically the cudy device manages failovers when the primary ISP is down. But it’s not perfect, sometimes the first ISP goes down, up again but traffic is still routed to the secondary one. cuddy’s firmware is ok but I can’t add a few things that I want, like detailed monitor of the connections and alerts when they change.

Hence, an opportunity to build new stuff.

My initial plan of having an rpi 4b with 3 ethernet ports (the one in the board plus two usb dongles) turns to be difficult. I wanted to use OpenWRT with mwan3 for failover plus https://openwrt.org/docs/guide-user/services/dns/adguard-home. And then add some metrics and alerts.

However I faced a few things with the USB adapter

[   92.042719] usb 2-2: new SuperSpeed USB device number 3 using xhci_hcd
[   92.079370] usb 2-2: New USB device found, idVendor=0b95, idProduct=1790, bcdDevice= 2.00
[   92.089145] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   92.097958] usb 2-2: Product: AX88179B
[   92.103361] usb 2-2: Manufacturer: ASIX
[   92.108835] usb 2-2: SerialNumber: 00193E19

But even after installing the module, it was not available with ipconfig or ip

root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg install kmod-usb-net-asix-ax88179
root@OpenWrt:~# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 2c:cf:67:6e:d7:21 brd ff:ff:ff:ff:ff:ff
3: phy0-ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether 2e:cf:67:6e:d7:23 brd ff:ff:ff:ff:ff:ff
5: br-lan: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 2e:cf:67:6e:d7:23 brd ff:ff:ff:ff:ff:ff

I did try to bind it manually. No luck.

root@OpenWrt:~# echo "0b95 1790" > /sys/bus/usb/drivers/ax88179_178a/new_id
root@OpenWrt:~# dmesg | tail -10
[ 1058.846848] usb 2-2: Product: AX88179B
[ 1058.851874] usb 2-2: Manufacturer: ASIX
[ 1058.856911] usb 2-2: SerialNumber: 00193E19
[ 1147.781964] usb 2-2: USB disconnect, device number 4
[ 1152.252395] usb 2-2: new SuperSpeed USB device number 5 using xhci_hcd
[ 1152.288991] usb 2-2: New USB device found, idVendor=0b95, idProduct=1790, bcdDevice= 2.00
[ 1152.298991] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1152.307983] usb 2-2: Product: AX88179B
[ 1152.313554] usb 2-2: Manufacturer: ASIX
[ 1152.319176] usb 2-2: SerialNumber: 00193E19
root@OpenWrt:~# lsmod | grep ax88179_178a
ax88179_178a           24576  0
usbnet                 24576  1 ax88179_178a
root@OpenWrt:~# modinfo ax88179_178a | grep -i "1790"
root@OpenWrt:~#

Then I ended on a raboot hole of building modules for OpenWrt. Some code and instructions here for reference but it didn’t work either.

sudo apt install -y \
  build-essential gawk gcc-multilib g++-multilib \
  git libncurses-dev libssl-dev python3-distutils \
  rsync unzip zlib1g-dev file wget gettext \
  m4 flex bison libelf-dev

# clone OpenWrt source
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout v24.10.4

# prepare code
./scripts/feeds update -a
./scripts/feeds install -a

# insert flashback meme, with a dog
make menuconfig

# Menu selection:
#
# Target System → Broadcom BCM27xx
# Subtarget → BCM2711
# Target Profile → Rpi 4b
#
# Kernel modules → USB Support → kmod-usb-net-asix-ax88179 and select it as <M> (module)

make target/linux/download
make target/linux/prepare

# build, and wait
make tools/clean
make toolchain/clean
make tools/compile -j$(nproc)
make toolchain/compile -j$(nproc)
make target/linux/compile -j$(nproc)

And after a few hours, got this. Now it seems I need to use a specific version of Ubuntu. But that’s a new post.

# On the RPi
root@OpenWrt:~# opkg install /tmp/kmod-usb-net-asix*.ipk --force-reinstall
root@OpenWrt:~# modprobe ax88179_178a
[58696.458082] usbcore: deregistering interface driver ax88179_178a
[58697.454703] module ax88179_178a: .gnu.linkonce.this_module section size must match the kernel's built struct module size at run time
 

social links