@patient0 Excellent ... thanks!
At the moment, the widget is correctly displaying the state (result of yesterday's reboots).
41275872-7ced-4c1b-96ce-33ebf93db12b-image.png
That's consistent with the PHP script output.
gateway: WAN_DHCP6 ... friendly iface: wan ... isdefault: true ... gateway status: enabled ... get iface gateway: 'fe80::be9a:8eff:fe0b:3b81%igc0' gateway: WAN_DHCP ... friendly iface: wan ... isdefault: true ... gateway status: enabled ... get iface gateway: a.b.c.d gateway: E1V95_LTEGW ... friendly iface: opt12 ... isdefault: false ... gateway status: enabled ... get iface gateway: '192.168.95.1'It's also consistent with netstat.
[24.11-RELEASE][admin@pfSense.home.arpa]/root: netstat -rn | grep default default a.b.c.d UGS igc0 default fe80::be9a:8eff:fe0b:3b81%igc0 UGS igc0I'll run the script again and post the results when I next see the failure.
I made small changes to the script to handle different gateway statuses and missing addresses. The WAN_DHCP and E1V95_LTEGW interfaces on my system are set up as a gateway group -- IPv4 failover -- so it's normal for one of them not to be the default gateway.
require_once("pfsense-utils.inc"); $a_gateways = return_gateways_array(); foreach ($a_gateways as $gname => $gateway) { echo "gateway: ", $gateway['name'], "\n"; echo "... friendly iface: ", $gateway['friendlyiface'], "\n"; echo "... isdefault: "; if (isset($gateway['isdefaultgw'])) { echo "true\n"; } else { echo "false\n"; } echo "... gateway status: "; if (isset($gateway['inactive'])) { echo "inactive\n"; } elseif (isset($gateway['disabled'])) { echo "disabled\n"; } else { echo "enabled\n"; } $if_gw = ''; if ($gateway['ipprotocol'] == "inet") { $if_gw = get_interface_gateway($gateway['friendlyiface']); } else { $if_gw = get_interface_gateway_v6($gateway['friendlyiface']); } echo "... get iface gateway: '", $if_gw, "'\n"; //var_dump($gateway); }