Add a rule manually to OPNsense firewall

You may be blocked from accessing your OPNsense firewall UI and need to add a rule to list yourself.

Be sure to check out the BSD pfctl cheatset.

Note: I figured out "quick" is the floating rules table.

# List all existing rules
pfctl -sr > existingrules.txt
# Replace with your IPv4 or IPv6
echo "pass in quick from 2a01:123:abc:ffff::0777:123 to any" | cat existingrules.txt - | pfctl -f -
# Remove temp file
rm -v existingrules.txt

An alternative solution is to disable packet filter:

# Disable the firewall
pfctl -d
# Enable the firewall (after you added the rules in the UI)
pfctl -e