On Fri, Oct 01, 2021 at 08:16:17PM -0500, Matt Zagrabelny wrote: > Hello, > > I'd like to do something like the following: > > if exists $named_set > nft add rule ip filter output ip daddr $named_set accept > else > nft add rule ip filter output ip daddr $default_set accept > > Does anyone know if I can accomplish this with nftables? > > Thanks, > > -m How about > if nft list ruleset | grep -q "$named_set"; then > nft add rule ip filter output ip daddr $named_set accept > else > nft add rule ip filter output ip daddr $default_set accept > fi You can restrict the search to a table, e.g. instead of "ruleset" put "table $my_table" Cheers ... Duncan.