OPNsense Forum

English Forums => 23.7 Legacy Series => Topic started by: username123 on December 20, 2023, 11:08:47 pm

Title: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: username123 on December 20, 2023, 11:08:47 pm
Hi,
my OPNsense looses internet connection every 3-4h. Restarting the box fixes the issue. While the problem occurs, the WAN IP field on the WebGUI is blank. However, OPNsense is reachable from within the LAN network.
I have the Vodafone Cable 1000 Plan and use OPNsense 23.7.10_1-amd64.
My network looks somewhat like this:
Code: [Select]

     WAN / Internet
            :
            : Vodafone Cable 1000
            :
      .-----+-----.
      |  Modem    |  https://www.vodafone.de/hilfe/router/station.html, bridge-mode
      '-----+-----'
            |
        WAN | IP or Protocol   (DHCP)
            |
      .-----+------.   
      |  OPNsense  |  WAN: DHCP / DHCP6 | LAN: static, 192.168.1.1 / track interface
      '-----+------'   
            |
        LAN |  192.168.1.0/24
            |
      .-----+------.   
      |  Switch       | TP-Link TL-SG108E, Gateway: 192.168.1.1,  Subnet: 255.255.255.0 | LAN: static, 192.168.1.2
      '-----+------'   
            |
        LAN | 192.168.1.0/24
            |
      .-----+------.   
      |  Clients      | (PC's, WIFI AP, ...) 
      '-------------'   


Would like to note that the Service "dhcpd6" is not running in the WebGUI at all times. I also checked log files (System->Logging File->Default) but couldn't find anything I would deem error indicating.

I also have the feeling that access on Websites is now slower than before when using the Vodafone Station as Router/Switch.

I'm relatively new to networking, hence the solution might be obvious, but just not for me. Do you guys have any ideas where I should look or how I can fix any these issues? Thanks! :)
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: iMx on December 21, 2023, 08:28:53 am
I think the first thing that needs to be determined:

Does a reboot fix the issue, or does the DHCP request just need to be reissued/renewed?

Next time it happens:

Interfaces -> Overview -> WAN, reload/reconnect/renew

... does that fix the issue, before you reboot?
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: knebb on December 21, 2023, 09:10:35 am
Just as IMx stated: Check for DHCP stuff.

Additionally, some providers want to have the devices registered by MAC address. For unknown devices they only allow limited connectivity. So have you registered (if needed) your WAN MAC to Vodafone?

/KNEBB
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: username123 on December 21, 2023, 11:54:32 am
Hi,
so I did as you said tried to renew the DHCP lease when it went down. But to no avail, still had to reboot to fix it.
However I noticed some strange things before rebooting (see screenshots).

Straight after loosing the connection I went to check on the OPNSense dashboard. The WAN interface there had both a configured, and correctly looking IPv4 and IPv6 address. Logs did not have anything suspicious. But no internet was available for me.
So I checked the Interface->Overview->WAN tab and tried to renew the DHCP lease. This is where the log you see in the screenshot comes from. This did not fix my issue.
In the german forum someone suggested turning of IPv6 on the WAN interface (Interface->WAN->IPv6 Configuratio Type set to None), which I did, however this also did not solve the issue.
When coming back to the overview I noticed that the WAN IPv4 address now was pointing to 0.0.0.0, which of course is wrong (IPv6 was missing as I just turned it off).

So all in all - DHCP lease renew did not fix the issue but resulted in some weird logs. The issue could only be resolved by rebooting from website.
Any other ideas? :)
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: iMx on December 21, 2023, 02:55:54 pm
I do see 're0' in one of your screenshots - i.e Realtek - which can sometimes be problematic.

If a DHCP renew/reconnect does not resolve the issue and only a reboot does, to me, it would sound like the NIC/driver is potentially crashing.

Have you tried to force a link down, link up? i.e removing the cable and reseating, to see if that makes any difference? Next time it happens.

I've had a few (seemingly) random NIC crashes myself, albeit not with Realtek NICs, something that is (apparently) helping for me, is to disable MSIX - as a tuneable, then rebooting:

hw.pci.enable_msix="0"

Disabling MSIX means most NICs then default to 1 queue, using MSI instead - it's possible this is also the cause, but I haven't got that far yet in determining the root cause.  You could check the dmesg output, to see if your NICs are using MSIX - for example:

Code: [Select]
em0: <Intel(R) PRO/1000 Network Connection 7.7.8> port 0xe000-0xe01f mem 0xf7b40000-0xf7b5ffff,0xf7b60000-0xf7b63fff irq 16 at device 0.0 on pci1
em0: Insufficient MSIX vectors, using MSI
em0: Using an MSI interrupt

However, I'm afraid I don't have any boxes with Realtek, so cannot offer anything further. 

Although I know there have been quite a few general posts on the forum relating to such NICs, that I've skimmed past.  Potentially additional drivers need to be installed (I think).
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: zan on December 21, 2023, 03:00:47 pm
Try installing os-realtek plugin first if you haven't already done so, might give you better stability.
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: username123 on December 21, 2023, 03:11:58 pm
Thank you guys. It is also recommended here: https://www.thomas-krenn.com/de/wiki/Realtek_NICs_in_OPNsense
I'm trying to install (/ui/core/firmware#plugins) os-realtek-re and let you know if it fixes the issue.
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: username123 on December 21, 2023, 09:02:06 pm
Installed ~8hrs ago, no more disconnects so far. Seems to work.
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: Patrick M. Hausen on December 21, 2023, 09:11:02 pm
A couple of weeks ago I wrote this on the TrueNAS forum:
Quote
The seemingly "arrogant" stance of the FreeBSD community towards Realtek network interfaces is rooted in this situation:

- Realtek won't provide documentation for their hardware without developers signing an NDA.
- Therefore the FreeBSD native driver does not support current models and probably never will
  unless Realtek changes their policy.
- Realtek provides a vendor driver in binary form.
- Unfortunately this one does not adhere to current FreeBSD networking standards and architecture (iflib),
  so while it might work in specific situations, bugs and missing features are to be expected.
- This is not really the FreeBSD community's fault nor anything we could change on our own.

HTH to put things into perspective. Just stay away from vendors who do not support open source.

So while it's good that the vendor driver solves your problem now, expect the driver to stop working at all some time in the future when OPNsense switches to FreeBSD 14, 15, ...

Realtek simply does not support open source. Crap company.
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: username123 on December 21, 2023, 09:13:49 pm
Mhh, I can still return my Firewall PC (Forums Mini). Any good recommendations for a very small PC used for Firewall/Routing + Ubquiti Server (basically everything network related) for under 150€? :P
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: Patrick M. Hausen on December 21, 2023, 09:22:03 pm
Not for under 150€ new, sorry.

If your uplink is in the 100 Mbit/s range with PPPoE or the Gbit/s range with just plain routing (DHCP for WAN), then an APU4D4 if still available is an extremely solid piece of hardware - with some performance limits, especially for PPPoE.

A bit more "oomph" would be a Protectli FW4B. If you need only two ports (LAN and WAN), a Protectli FW2B might fit the bill.

None of these devices will do Gbit/s speeds with PPPoE, sorry. But "Cable" seems to imply you won't need that.
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: doktornotor on December 22, 2023, 09:50:51 am
Crap company.

They have crapb in their logo, what'd you expect...  ;D
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: zan on December 22, 2023, 01:02:00 pm
They have crapb in their logo, what'd you expect...  ;D

TIL Realtek's logo is a crab, I always thought it was a circuit diagram or something  ;D

Quote
Through strength, persistence, and adaptability, Realtek follows in the spirit of the crab.

Spirit of the crab, whatever that means haha.

Literally on their "About page" https://www.realtek.com/en/about-realtek/realtek-in-brief


Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: Mr.Goodcat on December 22, 2023, 02:55:12 pm
Hi,
my OPNsense looses internet connection every 3-4h. Restarting the box fixes the issue.

Are you a customer of Vodafone West (former Unitymedia) by any chance?
You could try adding
Code: [Select]
supersede dhcp-server-identifier 255.255.255.255 under Interfaces->Your WAN Interface->DHCP client configuration (Advanced)->Option Modifiers

This worked for me as Vodafone is doing funky stuff with their DHCP (it's hidden behind a relay causing IP renew request going to the wrong server, thus triggering an IP lease timeout).
Title: Re: OPNSense and Vodafone Cabel disconnects every ~4h
Post by: username123 on December 22, 2023, 08:55:38 pm
Thanks Mr.Goodcat, issue was fixed with adding the plugin for RealTek drivers. No DHCP issues.