EGR056 - Failed to Set Up the Knoc's Egress Rule
Agent error code #EGR056 indicates that the agent could not put an egress knoc's destinations in place.
On nftables the agent keeps a knoc's destinations in the sets the knoc names, which your rules match, and replaces a set's contents whenever the knoc changes. This code means the firewall refused that change. The agent refuses the grant rather than let anyone through, and the set keeps what it held before.
On iptables the agent rewrites the knoc's chain whenever the knoc's destinations, its reject or its jump change, and puts the jump back in OUTPUT after a reload. This code means iptables-restore refused that rewrite. The chain keeps what it held before.
On pf the knoc's fence is a rule in the fences child of the knocknoc_egress anchor, and its grants an anchor of their own under grants. This code there means pfctl refused to load one of them.
On Windows this code comes only from a knoc whose rules Knocknoc creates. It means Windows Firewall refused to create, change or delete one of the knoc's kk_egress_ rules. A knoc naming your own Block rule never reports it, since the agent does not change that rule's destinations.
Common causes include:
- The knoc's destinations overlap one another
- An nftables set has
auto-merge, which refuses elements that touch - On iptables, a firewall reload removed the knoc's chain between the agent reading it and writing it, which clears on the next write once the chain is back
- A firewall reload replaced the ruleset at the same moment
Steps to Resolve
Validate the Knoc
Run Validate integration on the knoc. On nftables it checks each set the destinations need is on the host, of the right type, and matched by a rule. On iptables it checks the chain is in each family the destinations need and that something jumps to it.
Check the Destinations
Open the knoc and make sure no destination contains another, such as 10.0.0.0/8 alongside 10.1.0.0/16, and that no address is listed twice with different ports. Remove the narrower one and save.
Check the Agent Log
sudo journalctl -u knocknoc-agent --since "10 minutes ago" | grep -i egress
The agent logs the firewall's error and the change it attempted.