Site icon David Yin's Blog

Fix the problem of unstable router

I have a Awow AK34 mini PC. It is used as a router for a few years. It has a problem. It may lost respons after a few month, or every month. All the devices no matter wired or wireless connection are all stopped.  I am using TP-Link product as the switch and Access Points device. So it is neither the problem with the wireless device, nor the switch. It is the problem from Awow AK34 soft router.

The router OS is OPNsense.

Recently the problem is much more ofter, almost every two days. I have to reset the device. It is kind of annoying.

I google it and saw some post about it.

Here is what I did and it is working OK more than 10 days.

Step 1,

SSH to the router.

Step 2,

Check the network interface card information. sysctl -a | grep -E 'dev.(re)'

root@OPNsense:~ # sysctl -a | grep -E 'dev.(re)'
vfs.zfs.vdev.removal_suspend_progress: 0
vfs.zfs.vdev.removal_max_span: 32768
vfs.zfs.vdev.remove_max_segment: 16777216
vfs.zfs.vdev.removal_ignore_errors: 0
vfs.zfs.vdev.rebuild_min_active: 1
vfs.zfs.vdev.rebuild_max_active: 3
vfs.zfs.vdev.removal_min_active: 1
vfs.zfs.vdev.removal_max_active: 2
vfs.zfs.vdev.read_gap_limit: 32768
dev.re.1.wake: 0
dev.re.1.int_rx_mod: 65
dev.re.1.stats: -1
dev.re.1.%parent: pci2
dev.re.1.%pnpinfo: vendor=0x10ec device=0x8168 subvendor=0x10ec subdevice=0x0123 class=0x020000
dev.re.1.%location: slot=0 function=0 dbsf=pci0:2:0:0 handle=\_SB_.PCI0.RP04.PXSX
dev.re.1.%driver: re
dev.re.1.%desc: RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet
dev.re.0.wake: 0
dev.re.0.int_rx_mod: 65
dev.re.0.stats: -1
dev.re.0.%parent: pci1
dev.re.0.%pnpinfo: vendor=0x10ec device=0x8168 subvendor=0x10ec subdevice=0x0123 class=0x020000
dev.re.0.%location: slot=0 function=0 dbsf=pci0:1:0:0 handle=\_SB_.PCI0.RP03.PXSX
dev.re.0.%driver: re
dev.re.0.%desc: RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet
dev.re.%parent:
root@OPNsense:~ #

The hardware description is : RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet

Step 3,

Install the os-realtek-re plugin

During the installation, the output looks like below:

***GOT REQUEST TO INSTALL***
Currently running OPNsense 23.7.5 at Wed Oct 4 18:28:51 PDT 2023
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
os-realtek-re: 1.0
realtek-re-kmod: 198.00_3

Number of packages to be installed: 2

95 KiB to be downloaded.
[1/2] Fetching realtek-re-kmod-198.00_3.pkg: .......... done
[2/2] Fetching os-realtek-re-1.0.pkg: . done
Checking integrity... done (0 conflicting)
[1/2] Installing realtek-re-kmod-198.00_3...
[1/2] Extracting realtek-re-kmod-198.00_3: .... done
[2/2] Installing os-realtek-re-1.0...
[2/2] Extracting os-realtek-re-1.0: .. done
Reloading firmware configuration
Writing firmware setting...done.
Writing trust files...done.
Configuring login behaviour...done.
Configuring system logging...done.
=====
Message from realtek-re-kmod-198.00_3:

--
Add the following lines to your /boot/loader.conf
to override the built-in FreeBSD re(4) driver.

if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"

By default, the size of allocated mbufs is enough
to receive the largest Ethernet frame supported
by the card. If your memory is highly fragmented,
trying to allocate contiguous pages (more than
4096 bytes) may result in driver hangs.
For this reason the value is tunable at boot time,
e.g. if you don't need Jumbo frames you can lower
the memory requirements and avoid this issue with:

hw.re.max_rx_mbuf_sz="2048"
Checking integrity... done (0 conflicting)
Nothing to do.
***DONE***

Step 4,

Reboot the device

Step 5,

Check the NIC information again.

root@OPNsense:~ # sysctl -a | grep -E 'dev.(re)'
vfs.zfs.vdev.removal_suspend_progress: 0
vfs.zfs.vdev.removal_max_span: 32768
vfs.zfs.vdev.remove_max_segment: 16777216
vfs.zfs.vdev.removal_ignore_errors: 0
vfs.zfs.vdev.rebuild_min_active: 1
vfs.zfs.vdev.rebuild_max_active: 3
vfs.zfs.vdev.removal_min_active: 1
vfs.zfs.vdev.removal_max_active: 2
vfs.zfs.vdev.read_gap_limit: 32768
dev.re.1.wake: 0
dev.re.1.%parent: pci2
dev.re.1.%pnpinfo: vendor=0x10ec device=0x8168 subvendor=0x10ec subdevice=0x0123 class=0x020000
dev.re.1.%location: slot=0 function=0 dbsf=pci0:2:0:0 handle=\_SB_.PCI0.RP04.PXSX
dev.re.1.%driver: re
dev.re.1.%desc: Realtek PCIe GbE Family Controller
dev.re.0.wake: 0
dev.re.0.%parent: pci1
dev.re.0.%pnpinfo: vendor=0x10ec device=0x8168 subvendor=0x10ec subdevice=0x0123 class=0x020000
dev.re.0.%location: slot=0 function=0 dbsf=pci0:1:0:0 handle=\_SB_.PCI0.RP03.PXSX
dev.re.0.%driver: re
dev.re.0.%desc: Realtek PCIe GbE Family Controller
dev.re.%parent:

Now, the driver is Realtek PCIe GbE Family Controller.

Thanks to the people who make this plugin/driver.

 

Exit mobile version