Skip to main content

EGR057 - Destinations with Ports Need Linux 5.6

Agent error code #EGR057 indicates that an egress knoc has destinations with ports, such as 10.0.0.5:22, and the kernel on the agent host cannot fence by port.

Fencing a destination by port on nftables uses a set keyed on an address and a port together (typeof ip daddr . th dport; flags interval;). Linux added that in 5.6, and some distributions have backported it to older kernels. On a kernel without it, knocker enable egress declares no port sets, so a knoc whose destinations have ports names a set that is not there, and the agent reports this code.

Destinations without ports do not need it and work on any kernel. On iptables a destination's ports are in the knoc's own rules, which any kernel takes.

Steps to Resolve

Check the Kernel

uname -r

A version below 5.6 is the cause unless your distribution says it backports nftables concatenated interval sets.

Remove the Ports

Edit the knoc and remove the ports from its destinations, for example 10.0.0.5:22 becomes 10.0.0.5. The knoc then fences every port on the destination, which any kernel supports.

Upgrade the Kernel

Move the bastion to a kernel of 5.6 or later, then run knocker enable egress --sets <name> for a new set group, which declares the port sets now the kernel takes them, and include its file. A sets file knocker already wrote is left as it is.