"nft - f <file>" errors unless "nft flush ruleset" called first

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Version: nftables v0.9.0 (Fearless Fosdick), on Linux 4.14

`nftable.conf` starts with
```
flush ruleset
table ip nat {
    chain prerouting {
        type nat hook prerouting priority 0; policy accept;
    }

    chain postrouting {
        type nat hook postrouting priority 100; policy accept;
        oifname "br-lan" masquerade
    }
}
...
```

I'm getting the following error:
```
# nft -f /etc/nftable.conf
/etc/nftable.conf:3:15-24: Error: Could not process rule: File exists
    chain prerouting {
                 ^^^^^^^^^^
/etc/nftable.conf:7:15-25: Error: Could not process rule: File exists
    chain postrouting {
                 ^^^^^^^^^^^
/etc/nftable.conf:9:17-43: Error: Could not process rule: No such file
or directory
        oifname "br-lan" masquerade
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

However, when calling `nft flush ruleset` first in a separate command,
there is no error,
```
# nft flush ruleset
# nft -f /etc/nftable.conf
# echo $?
0
```

I was previously using nftables v0.9.0 in Linux 4.9 and didn't have
this problem.

Is it possible that a newer nftables should be used with Linux 4.14 ?



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux