OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: lello1231 on March 11, 2022, 06:42:07 am

Title: Opnsense connectivity /switch power issue
Post by: lello1231 on March 11, 2022, 06:42:07 am
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 
Title: Re: Opnsense connectivity /switch power issue
Post by: Sangito on March 12, 2022, 05:14:55 am
is your switch is managed ?
Title: Re: Opnsense connectivity /switch power issue
Post by: lello1231 on March 12, 2022, 07:27:14 am
No it is not.  What you suggest?
Title: Re: Opnsense connectivity /switch power issue
Post by: Sangito on March 12, 2022, 06:48:43 pm
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?
Title: Re: Opnsense connectivity /switch power issue
Post by: 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 (https://forum.opnsense.org/index.php?topic=27189.0)). 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.
Title: Re: Opnsense connectivity /switch power issue
Post by: Patrick M. Hausen on March 12, 2022, 11:27:52 pm
Neither Realtek nor USB NICs in general are recommended. If possible, use some appropriate hardware.
Title: Re: Opnsense connectivity /switch power issue
Post by: schnipp on March 12, 2022, 11:43:07 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).
Title: Re: Opnsense connectivity /switch power issue
Post by: lello1231 on March 13, 2022, 11:16:05 am
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)

Title: Re: Opnsense connectivity /switch power issue
Post by: lello1231 on March 13, 2022, 11:45:12 am
You probably encountered the same problems like me since updating to Opnsense 22.x (see here (https://forum.opnsense.org/index.php?topic=27189.0)). 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




Title: Re: Opnsense connectivity /switch power issue
Post by: schnipp on March 14, 2022, 06:58:19 pm
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.
Title: Re: Opnsense connectivity /switch power issue
Post by: lello1231 on March 15, 2022, 06:25:51 pm
Hello schnipp,

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

Br
Elie
Title: Re: Opnsense connectivity /switch power issue
Post by: schnipp on March 17, 2022, 09:25:33 pm
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 (https://forum.opnsense.org/index.php?topic=27189.msg133595#msg133595))   
Title: Re: Opnsense connectivity /switch power issue
Post by: lello1231 on March 18, 2022, 01:43:05 pm
Thanks! ,

-How can i know the chipset number ?
-Did you try the tunable option? in case yes, what did you put there exactly?
Title: Re: Opnsense connectivity /switch power issue
Post by: schnipp on March 18, 2022, 04:04:07 pm
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:

Code: [Select]
# 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)

Code: [Select]
# 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.
Title: Re: Opnsense connectivity /switch power issue
Post by: lello1231 on March 19, 2022, 02:15:47 pm
Thanks! problem fixed