OPNsense Forum

Archive => 19.1 Legacy Series => Topic started by: CloudHoppingFlowerChild on February 02, 2019, 08:40:31 am

Title: [BUG] DHCPv4 gateway=none
Post by: CloudHoppingFlowerChild on February 02, 2019, 08:40:31 am
There's an issue with the DHCPv4 gateway assignment that has been around since I started using OPNsense, around 16.X.

Gateway assignment behavior is not always consistent with the described operation.
(http://nothingunreal.com/dump/OPNsense_gateway.PNG)

Tonight I was futzing with DHCP settings and eventually figured out how to reproduce it consistently (as much as that word can be applied).

I have four internal interfaces that all operate on em0. OOB is untagged; LAN, MGMT, and PIA are tagged vlans. If I leave the gateway assignment blank in the DHCPv4 settings for all interfaces then each is assigned the corresponding interface address as the gateway via DHCP. If I manually specify a gateway for one of the interfaces, the rest still work correctly; a blank entry results in the interface address being assigned as the gateway. The problem comes up if I specify "none" (without quotes) as the gateway for one of the DHCP configurations.

This 'table' should only be read horizontally. "none" indicates I have specified "none" as the gateway on that interface and left the gateway assignment blank for the other three. "yes" means a gateway was assigned. "no" means a gateway was not assigned.
LAN=none      LAN=no        MGMT=yes       OOB=yes       PIA=no
MGMT=none     LAN=no        MGMT=no        OOB=no        PIA=no
OOB=none      LAN=no        MGMT=yes       OOB=no        PIA=no
PIA=none      LAN=yes       MGMT=yes       OOB=yes       PIA=no


As you can see, using "none" on any one of the interfaces results in some or all of the other interfaces no longer assigning gateways. The exception being PIA which never gets a gateway assignment if "none" is used on any of the others but if I use "none" on PIA then the other three continue to work as expected. I did not try using "none" on more than one interface at a time as it would take much longer to try all the combinations and I doubt it would clarify the underlying issue. On the up side, specifying "none" does consistently result in no gateway being assigned on the intended interface.

The workaround is simply to manually specify the gateway IP for interfaces that don't get the interface IP when the gateway field is left blank.

I should note that when I started using OPNsense it was as a VMware virtual machine and in that instance each interface was configured as an individual NIC, not as VLANs. I migrated to bare metal shortly after 17.1.

What further info can I provide to help out?