Firewall rule - gateway drop down menu empty
-
var_dump(return_gateway_groups_array());
in the PHP exec box under Diag > Command Prompt would show you the gateways.The gateway names are put through json so maybe there is a character somewhere in your gateway names or descriptions that is breaking json.
If you could post the contents of
config.xml
containing your gateways and gateway groups that would be helpful. Or the output of the PHP command above may be enough. -
@jimp said in Firewall rule - gateway drop down menu empty:
var_dump(return_gateway_groups_array());
Yay, got it! One Gateway Group description had two " characters in it. On a hunch I've removed them, and voilà - the gateway dropdown is being populated again! Thanks so much for the support, and for pointing me in the right direction!
-
So two double quotes (
"
) or two single quotes ('
)?Something must not be right with the code that forms the json if that broke it. I'd like to be able to replicate it so I can fix it properly.
-
That's two double quotes (
"
), the original string wasAlle "sicheren" WANs, sequentiell
, I've changed it toAlle sicheren WANs sequentiell
and that fixed the issue instantly, without having to reboot the box.I hope the OP will notice this, it'd be so cool if a simple edit like this would fix his issue as well! (;
-
In my case, the command var_dump is not returning anything, even though I have checked all the tips everyone gave on this thread. Maybe that just shows Gateway Groups and not gateways, and given I don't have any gateway groups, just gateways, that is why this particular command is not showing anything. Does anyone have any other idea that might help me? Thanks.
-
The command returned a lot of text for me, with data about all gateways and gateway groups (I can post an edited/anonymized version if you're interested). Are you sure you've entered the command under "Diagnostics / Command Prompt" in the "Execute PHP Commands" box?
-
I found the problem and fixed it. Issue is at https://redmine.pfsense.org/issues/8962 and the fix commit will show up there shortly.
-
@jimp said in Firewall rule - gateway drop down menu empty:
var_dump(return_gateway_groups_array());
I created a gateway group to check that command and it also didn't return anything. Don't know what else to check/do.
-
Well, I guess the command should at least show the data for the default gateway, so it seems you've got a different issue than mine after all. Hope you'll be able to fix it!
jimp: where do I get my bug bounty award? (;
EDIT: after looking at the PHP command output again, I'm not so sure single gateways are included in the output after all, sorry. The command
var_dump(return_gateways_array());
seems to show those. -
I just found my issue too, thanks to SaschalTM tip. I checked the description of my gateways and I found that one of them had a leading space on the description, which I can swear it was not then when I created the gateways. In any case, I removed the leading space and saved the gateway, went to the firewall rule and for sure the gateway drop down menu was once again populated. I then checked the PHP commands again and for sure they returned the gateways and the gateway group I just created, but I can't be sure that the edit fixed that too, maybe I was making a typo on the command, which I doubt, but since there was a leading space that I was not seeing before, maybe I was not seeing a typo too.
In any case, my issue is resolved. Thanks guys for your help, and a special thanks to SachalTM.