Skip to contentSkip to conversation

numeric ip protocol values and omitting filter tablename

nft Christoph A. 2 participants 2 messages Aug 11, 2009 – Aug 13, 2009 netfilter

lore
Share & tools
lore
#0 lore raw

Hi,

Is the default table (filter) also mandatory?

# nft add rule filter input meta iifname eth0 accept  (works)
# nft add rule input meta iifname eth0 accept
<cmdline>:1:16-19: Error: syntax error, unexpected meta, expecting string
add rule input meta iifname eth0 accept
               ^^^^

just in case this is not expected:

# nft add rule filter input ip protocol 6 accept
<cmdline>:1:35-35: Error: Could not resolve protocol name
add rule filter input ip protocol 6 accept

ip protocol TCP accept (works)

kind regards,
Christoph

#1 lore raw
Quoted 9 lines · Christoph A.

Hi,

Is the default table (filter) also mandatory?

# nft add rule filter input meta iifname eth0 accept  (works)
# nft add rule input meta iifname eth0 accept
<cmdline>:1:16-19: Error: syntax error, unexpected meta, expecting string
add rule input meta iifname eth0 accept
               ^^^^

The table is mandatory, the "add" and "rule" parts are not. So you can do:

nft filter input meta iifname eth0 accept

Quoted 7 lines

just in case this is not expected:

# nft add rule filter input ip protocol 6 accept
<cmdline>:1:35-35: Error: Could not resolve protocol name
add rule filter input ip protocol 6 accept

ip protocol TCP accept (works)

Yes, this is currently a known bug, types do not parse in their basetypes. I'll fix that before the next release, which is happening in a few weeks.