After getting my OPNSense firewall I had the issue of it losing the Internet connection every now and again. Luckily, this reddit post helped me to solve the issue for the next couple of months:
Unfortunately, today in the morning the WiFi was gone - which was a new one, previously I was able to connect to the WiFi, but I had no Internet access - and after a quick troubleshoot I rebooted the firewall and after it came back up I installed a few updates. (I did the last marge upgrade of OPNSense as well as one update that followed when they were released, so today I only did a minor update) I still had to re-check the check-mark mentioned above though.
After a few hours though, the connection was again lost and OPNSense was not able to establish a connection even after a few reboots. I tried to directly attach my PC to the fiewall’s LAN connection but I also did not know how to proceed further. (I had a rather weird 192.254.x.x IP in an 255.255.0.0 subnet.) Furthermore, I was still not able to connect to the Internet…
Since it is rather late in the evening, I proceeded to directly connect my switch to my ISP’s router and call it a day, but naturally, I would like to solve my problems with the firewall.
So, any help or input would be immensely appreciated
So we have some kind of cheap chinese small form factor PC with a Broadcom NIC (you’re using VLANs or what’s on WAN)? 192.168.X.X is a private IP address and that’s not something Windows randomly so it’s either configured manually or you have some DHCP server (or multiple) running on your network. Since you can’t connect and I presume you know what IP you’ve specified on the LAN interface I’m going to guess the machine hangs or at least LAN interface. Without any kind of logs/output it’s pretty much impossible to pin point the cause.
Best guess is that at least LAN Interface is bad/broken/buggy/unreliable or the box itself. Might also be related to heat, storage or PSU.
After having it turned off for almost two days it works again and thus I am also able tp provide logs:
Errors and above:
2023-04-12T12:19:23 Error opnsense /usr/local/etc/rc.newwanip: The command '/bin/kill -'TERM' '85608'' returned exit code '1', the output was 'kill: 85608: No such process'
2023-04-12T12:19:22 Error opnsense /usr/local/etc/rc.newwanipv6: The command '/sbin/mount -r -t nullfs '/usr/local/lib/python3.9' '/var/unbound/usr/local/lib/python3.9'' returned exit code '1', the output was 'mount_nullfs: /var/unbound/usr/local/lib/python3.9: Device busy'
2023-04-12T12:19:22 Error opnsense /usr/local/etc/rc.newwanip: The command '/sbin/mount -t devfs devfs '/var/unbound/dev'' returned exit code '1', the output was 'mount: devfs: Device busy'
2023-04-12T12:19:21 Error opnsense /usr/local/etc/rc.newwanip: The command '/usr/local/sbin/ntpd -g -c '/var/etc/ntpd.conf'' returned exit code '1', the output was ''
2023-04-12T12:19:10 Error opnsense /usr/local/etc/rc.bootup: The command '/bin/kill -'TERM' '81999'' returned exit code '1', the output was 'kill: 81999: No such process'
2023-04-12T12:19:10 Error dhcp6c transmit failed: Can't assign requested address
2023-04-10T21:00:18 Error opnsense /usr/local/etc/rc.newwanip: The command '/sbin/mount -r -t nullfs '/usr/local/lib/python3.9' '/var/unbound/usr/local/lib/python3.9'' returned exit code '1', the output was 'mount_nullfs: /var/unbound/usr/local/lib/python3.9: Resource deadlock avoided'
2023-04-10T21:00:18 Error opnsense /usr/local/etc/rc.newwanipv6: The command '/usr/local/sbin/ntpd -g -c '/var/etc/ntpd.conf'' returned exit code '1', the output was ''
2023-04-10T21:00:07 Error opnsense /usr/local/etc/rc.bootup: The command '/bin/kill -'TERM' '15577'' returned exit code '1', the output was 'kill: 15577: No such process'
2023-04-10T21:00:07 Error dhcp6c transmit failed: Can't assign requested address
2023-04-10T18:39:34 Error opnsense /usr/local/etc/rc.newwanipv6: The command '/usr/local/sbin/ntpd -g -c '/var/etc/ntpd.conf'' returned exit code '1', the output was ''
2023-04-10T18:39:23 Error opnsense /usr/local/etc/rc.bootup: The command '/bin/kill -'TERM' '72372'' returned exit code '1', the output was 'kill: 72372: No such process'
2023-04-10T18:39:23 Error dhcp6c transmit failed: Can't assign requested address
2023-04-10T10:50:00 Error opnsense /usr/local/etc/rc.newwanipv6: The command '/bin/kill -'TERM' '30661'' returned exit code '1', the output was 'kill: 30661: No such process'
2023-04-10T10:49:59 Error opnsense /usr/local/etc/rc.newwanipv6: The command '/sbin/mount -r -t nullfs '/usr/local/lib/python3.9' '/var/unbound/usr/local/lib/python3.9'' returned exit code '1', the output was 'mount_nullfs: /var/unbound/usr/local/lib/python3.9: Resource deadlock avoided'
2023-04-10T10:49:59 Error opnsense /usr/local/etc/rc.newwanip: The command '/sbin/mount -t devfs devfs '/var/unbound/dev'' returned exit code '1', the output was 'mount: devfs: Device busy'
2023-04-10T10:49:58 Error opnsense /usr/local/etc/rc.newwanipv6: The command '/usr/local/sbin/ntpd -g -c '/var/etc/ntpd.conf'' returned exit code '1', the output was ''
2023-04-10T10:49:46 Error opnsense /usr/local/etc/rc.bootup: The command '/bin/kill -'TERM' '39340'' returned exit code '1', the output was 'kill: 39340: No such process'
2023-04-10T10:49:46 Error dhcp6c transmit failed: Can't assign requested address
2023-04-10T10:43:51 Error dhcp6c transmit failed: Can't assign requested address
It looks odd with processes dying/not working left and right. While it should work “Double NAT” is far from ideal however that’s not the cause of your issues but your Realtek NIC probably doesn’t help either. Unfortunately the logs don’t capture why everything comes crashing down but I suspect it’s some kind of hardware issue.
It’s hard to tell because the logs don’t really say why. There seems to be some issues with IPv6 configuration which probably causes noise, on top of that it seems to run into issues mounting nullfs. I don’t use opnsense myself so I can’t really tell you what it tries to do but you need to setup some kind of remote or persistent logging which may tell why it stops working. If you’re running suricata and/or snort, crowdsec you might be running into resouce exhaustion.
Given that a bunch of services dont seem to start properly I’d suspect that your configuration and/or filesystem is broken for whatever reason. Unless you have a monitor attached that shows the prompt with messages etc there’s no way to tell why it dies/died inte first place.