Opnsense connectivity /switch power issue

Started by lello1231, March 11, 2022, 06:42:07 AM

Previous topic - Next topic
Hello,
I am facing a strange issue and i need some help.
I have a laptop where opnsense is installed on it.  This laptop has 2 adapters  , default ethernet port of laptop connected to WAN  and  an eth usb adapter connected to LAN . a cable goes from the usb adapter to a L2 switch connected to my other devices.  The issue im facing , is when i lose electricity power on the switch (then after power up) , i lose internet and connectivity,  and the problem cannot be resolved till i restart opnsense . Any idea why this is happening and how to solve it?
Elie 



Start by checking the status of the router interface.
Does it ping on the internet ?
Does it ping a device on youe network?
Does it have an ip adress on bolt interface?
Since you said it a L2 switch what are your control interface with the switch?

You probably encountered the same problems like me since updating to Opnsense 22.x (see here). It's either a general or a specific problem related to my realtek USB NIC. Which USB NIC do you use?i

My temporary solution is to shutdown and restart the interface using the CLI.
OPNsense 24.7.11_2-amd64

Neither Realtek nor USB NICs in general are recommended. If possible, use some appropriate hardware.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: pmhausen on March 12, 2022, 11:27:52 PM
Neither Realtek nor USB NICs in general are recommended. If possible, use some appropriate hardware.

I cannot believe that this a general recommendation of FreeBSD 13. Do you have a reputable source for this? BTW my Realtek USB NIC worked flawlessly under Opnsense 21.x (Hardened BSD).
OPNsense 24.7.11_2-amd64

March 13, 2022, 11:16:05 AM #7 Last Edit: March 13, 2022, 12:01:58 PM by lello1231
Hello, basically this is what i can find in logs:

at 11:17 , i remove the power from the switch , the firewall detect that UE0 state has change to down and then i receive some errors regarding to memory allocation, and yes i have enabled and configured arp static entries.

2022-03-13T11:17:35   Error   opnsense   /usr/local/etc/rc.linkup: The command '/usr/sbin/arp -s '192.168.2.5' '80:ea:96:06:4e:65'' returned exit code '1', the output was 'arp: writing to routing socket: Cannot allocate memory'   
2022-03-13T11:17:35   Error   opnsense   /usr/local/etc/rc.linkup: The command '/usr/sbin/arp -s '192.168.2.4' '90:e7:c4:d7:35:62'' returned exit code '1', the output was 'arp: writing to routing socket: Cannot allocate memory'   
2022-03-13T11:17:35   Error   opnsense   /usr/local/etc/rc.linkup: The command '/usr/sbin/arp -s '192.168.2.3' '60:36:dd:61:ab:93'' returned exit code '1', the output was 'arp: writing to routing socket: Cannot allocate memory'   
2022-03-13T11:17:35   Error   opnsense   /usr/local/etc/rc.linkup: The command '/usr/sbin/arp -s '192.168.2.2' '84:8e:0c:07:45:d1'' returned exit code '1', the output was 'arp: writing to routing socket: Cannot allocate memory'   
2022-03-13T11:17:35   Error   opnsense   /usr/local/etc/rc.linkup: DEVD: Ethernet detached event for static lan(ue0)


March 13, 2022, 11:45:12 AM #8 Last Edit: March 13, 2022, 12:20:15 PM by lello1231
Quote from: schnipp on March 12, 2022, 11:11:23 PM
You probably encountered the same problems like me since updating to Opnsense 22.x (see here). It's either a general or a specific problem related to my realtek USB NIC. Which USB NIC do you use?i

My temporary solution is to shutdown and restart the interface using the CLI.

Yes , i think we have similar problems,

ure0 on uhub1
ure0: <Realtek USB 10/100/1000 LAN, class 0/0, rev 2.10/30.00, addr 2> on usbus7
miibus0: <MII bus> on ure0
ue0: <USB Ethernet> on ure0





Today, I have ordered a new USB ethernet adapter. The new one uses "AX88179" chipset instead the "Realtek 8153(B)" and is supported by the "axge" driver provided with FreeBSD. If the new adapter works, it won't be worth to investigate time for a solution.
OPNsense 24.7.11_2-amd64

Hello schnipp,

Please let me know the outcome of this new usb lan adapter.

Br
Elie

The new adapter arrived yesterday. Unfortunately, the device continuously looses the carrier and causes a lot of errors in USB communication. The same occurs with Linux. In this case it is a device problem and not caused by FreeBSD or the chipset.

But, I found a solution for the realtek adapter :) (see here: #2)   
OPNsense 24.7.11_2-amd64

Thanks! ,

-How can i know the chipset number ?
-Did you try the tunable option? in case yes, what did you put there exactly?

March 18, 2022, 04:04:07 PM #13 Last Edit: March 18, 2022, 04:10:13 PM by schnipp
The string should be the same like mine. In most cases the chipset doesn't matter as long as the device supports the mentioned CDC-ECM mode. The only thing you have to check before applying the string is to verify whether vendor and product id match.

First, list all devices:


# usbconfig
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <Realtek USB 10/100/1000 LAN> at usbus0, cfg=1 md=HOST spd=HIGH (480Mbps) pwr=ON (350mA)
[...]


Second: Retrieve vendor and product id of your device (the example applies to device 0.2 (ugen0.2) from the list above)


# usbconfig -d 0.2 dump_device_desc
ugen0.2: <Realtek USB 10/100/1000 LAN> at usbus0, cfg=1 md=HOST spd=HIGH (480Mbps) pwr=ON (350mA)

[...]
  idVendor = 0x0bda
  idProduct = 0x8153
[...]


--> The resulting tunable is:
Name: hw.usb.quirk.0
Description: what you like to describe
Value: "0x0bda 0x8153 0 0xffff UQ_CFG_INDEX_1" (with blanks but without quotes)

Only the italics part of the value string needs to be adjusted if it differs.
OPNsense 24.7.11_2-amd64