Skip to contentSkip to conversation

Question for table netdev set list

DISCUSSION Martin Zaharinov 1 participant 2 messages Sep 20, 2022 netfilter

lore
Share & tools
lore
#0 lore raw

Hi Pablo and Florian

I have one question
is it possible to set list in netdev hook

Like this :

table netdev test {
	set test_list {
		typeof iifname
		flags dynamic
		elements = { eth0, eth1 }
	}

	chain INGRESS {
		type filter hook ingress devices = { @test_list } priority -450; policy accept;
	}

	chain EGRESS {
		type filter hook egress devices = { @test_list  } priority -450; policy accept;
	}
}
table inet filter {
	set test_list {
		typeof iifname
		flags dynamic
		elements = {  eth0, eth1 }
	}
	
	flowtable fastpath {
		hook ingress priority filter
		devices = { @test_list }
	}
}

Idea is to set interface in list not to create many chains for every interface

now i receive:

Error: syntax error, unexpected @, expecting string or quoted string or '$' type filter hook ingress devices = { @device_list } priority -450; policy accept;

m.

#1 lore raw

Or to send device like ppp* eth0.* tap*

in this case no need to write list to set interface

Quoted 51 lines · Martin Zaharinov

Hi Pablo and Florian

I have one question
is it possible to set list in netdev hook

Like this :

table netdev test {
	set test_list {
		typeof iifname
		flags dynamic
		elements = { eth0, eth1 }
	}

	chain INGRESS {
		type filter hook ingress devices = { @test_list } priority -450; policy accept;
	}

	chain EGRESS {
		type filter hook egress devices = { @test_list  } priority -450; policy accept;
	}
}
table inet filter {
	set test_list {
		typeof iifname
		flags dynamic
		elements = {  eth0, eth1 }
	}
	
	flowtable fastpath {
		hook ingress priority filter
		devices = { @test_list }
	}
}

Idea is to set interface in list not to create many chains for every interface

now i receive:

Error: syntax error, unexpected @, expecting string or quoted string or '$' type filter hook ingress devices = { @device_list } priority -450; policy accept;

m.