Sample Header Ad - 728x90

Why is nftables giving me trouble adding a jump to another chain?

1 vote
1 answer
327 views
I'm putting together nft rules for chains and I've gotten to this point where I'm stuck. My ruleset looks like this:
table inet whitelist_table {
        chain whitelist_chain {
                ip saddr 127.0.0.1 accept
                ct state established,related accept
                #more ip addresses for the whitelist
                drop
        }

        chain enabled_state_chain {
                type filter hook input priority filter - 10; policy accept;
                jump whitelist_chain
                # I dynamically manage this so that if the whitelist is enabled,
                # it goes to the white_list chain, otherwise it accepts
        }

        chain allowed_port_chain {
                type filter hook input priority -20; policy accept;
                # This is where I'm trying to add my rule for ports, but it won't let me jump/goto.
        }
}
When I use the nft command add rule inet whitelist_table allowed_port_chain tcp dport {22, 80, 443} goto enabled_state_chain I get the following error:
Error: Could not process rule: Operation not supported
add rule inet whitelist_table allowed_port_chain tcp dport {22, 80, 443} goto enabled_state_chain
                                                                   ^^^^^^^^^^^^^^^^^^^
What am I not understanding?
Asked by Isaac (113 rep)
Oct 29, 2024, 06:20 PM
Last activity: Mar 14, 2025, 10:18 PM