Skip to contentSkip to conversation

nftables: variable network ranges in named maps

DISCUSSION Andreas Schultz 1 participant 1 message Jan 12, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

I want to use network ranges and host IP's in named maps. Using them in anonymous maps works:

# nft add rule filter output ip daddr vmap {192.168.0.0/24 : drop, 192.168.0.1 : accept}

However, in named maps it failes:

root@SCG4:~# nft -i
nft> add map filter verdict_map { type ipv4_address : verdict; }
nft> add element filter verdict_map { 1.2.3.5 : drop}
nft> add element filter verdict_map { 1.2.3.4/16 : accept}
BUG: invalid data expression type prefix

How do i use ranges or more complex expressions like IP + Port in maps?

Andreas