I did a fresh OPNsense 19.1 install - upgraded to 19.1.3 afterwards, but this issue persists:
Scenario:
- Cable ISP with Fritz!Box at 192.168.178.1
- OPNSense box with two Realtek onboard NICs
- WAN on re1_vlan140 at 192.168.178.2 static IP
- Connected to the Fritz!Box via two switches with proper VLAN configuration.
- IPv6 set to "none" on all interfaces, not allowed in firewall settings
- Single IPv4 gateway configured with 192.168.178.1 (Fritz!Box)
- Single IPv6 gateway configured, but disabled.
- Fritz!Box does WLAN.
- OPNsense set to serve DHCP on WAN.
Problem:After every boot of OPNsense, at first:
- Gateway is down - no internet connectivity. Disabling gateway monitoring does not help!
- Ping from OPNsense to 192.168.178.1 immediately returns: ping: sendto: Invalid argument
- Ping to any other host on 192.168.178.0/24 works, though!
- Even hosts on WLAN can be pinged (switched through Fritz!Box).
- WLAN devices successfully get their DHCP from OPNsense (switched through Fritz!Box)
- Manually saving the WAN interface configuration again makes the ping work and gateway accessible. - Until next reboot!
- Simply navigating to Interfaces -> WAN and clicking "Save", then "Apply".
- Without(!) changing any interface settings.
Having to resort to manual intervention after every reboot just to get basic connectivity working really is a pain!
I am out of ideas what might cause this. Being able to ping everything else in the same network across several network switches seems proof that my configuration is basically correct.
Is this a bug in OPNsense, or did I miss something really stupid?
Anyone have a clue what is going on here?
(edit)
UpdateAlright, after writing down all my results here, I turned to playing with OPNsense GUI themes - and that brought out another related fact:
Every time I saved Systems -> Settings -> General, the issue re-appeared even without a reboot!Again, saving
Interfaces -> WAN fixed it for the time being.
After some experimentation, I found:
I had set DNS server 192.168.178.1 explicitly, and explicity set "use gateway" to the configured WANGW with the same IP as well.
When I set "use gateway" behind the DNS server entry to "none", the problem disappears.However, this still smells like a bug to me? How is setting a (correct!) gateway supposed to cause ping issues?
DNS servers set host routes to gateways when selected. The monitoring IP will as well. Something likely isn't in sync with these two gateways hence the one host route overwriting the other.
Check routing table in working state and broken:
# netstat -nr
Cheers,
Franco