Bug #14473
openAutomatic gateway not updating after default deleted
0%
Description
Copied from forum post: https://forum.netgate.com/topic/177395/automatic-gateway-not-updating-after-default-deleted
At System/Routing/Gateways in the web UI, I created a new gateway and set it to be the default gateway. It was not working (my fault, not pfsense issue) so I deleted it and returned the "Default gateway IPv4" field to the "Automatic" setting. After hours of frustration I realized this "Automatic" setting had not switched back to the original gateway (received via DHCP). The original gateway was online according to the Status/Gateways page, but was not the default and thus no default route was defined. Manually resetting the default ipv4 gateway solved the problem.
I am on pfSense 2.6.0-RELEASE. I do have ipv6 enabled so there are two gateways on Status/Gateways, one for ipv4 and one for v6 (there should be a default gateway for each).
I found this somewhat similar issue (https://redmine.pfsense.org/issues/11570), but mine seems to be more related to config saving/parsing. While attempting to replicate the issue with the ipv6 gateway I found that even worse, I could not change the default gateway back manually. All my configuration is done in the web UI but I will show how the config file gets messed up:
Default configuration:
<gateways>
<defaultgw4>WANGW</defaultgw4>
<defaultgw6>WANGWv6</defaultgw6>
</gateways>
Added a new default ipv6 gateway "test6" and disabled the original:
<gateways>
<defaultgw4></defaultgw4>
<defaultgw6></defaultgw6>
<gateway_item>
<interface>wan</interface>
<gateway>dynamic</gateway>
<name>WAN_DHCP6</name>
<weight>1</weight>
<ipprotocol>inet6</ipprotocol>
<descr><![CDATA[Interface WAN_DHCP6Gateway]]></descr>
<disabled></disabled>
</gateway_item>
<gateway_item>
<interface>wan</interface>
<gateway>**garbage ipv6**</gateway>
<name>test6</name>
<weight>1</weight>
<ipprotocol>inet6</ipprotocol>
<descr></descr>
</gateway_item>
</gateways>
Removed the new gateway and manually restored the default gateway:
<gateways>
<defaultgw4></defaultgw4>
<defaultgw6></defaultgw6>
<gateway_item>
<interface>wan</interface>
<gateway>dynamic</gateway>
<name>WAN_DHCP6</name>
<weight>1</weight>
<ipprotocol>inet6</ipprotocol>
<descr><![CDATA[Interface WAN_DHCP6 Gateway]]></descr>
</gateway_item>
</gateways>
But now the web UI does not show wan_dhcp6 as a default gateway!
The gateway itself works as it should, but whatever determines the default gateway is not choosing the only one remaining after "test6" was deleted.