Skip to content

Commit cce26b5

Browse files
committed
firewalls: Add nftables subsection.
1 parent fd8464a commit cce26b5

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/config/network/firewalls.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,39 @@ and restore them by upping the relevant service, e.g.:
5353
```
5454
# sv up ip6tables
5555
```
56+
57+
## nftables
58+
59+
`nftables` replaces `iptables`, `ip6tables`, `arptables` and `ebtables`
60+
(collectively referred to as `xtables`). The [nftables
61+
wiki](https://wiki.nftables.org/wiki-nftables/index.php/Main_Page) describes
62+
[the main
63+
differences](https://wiki.nftables.org/wiki-nftables/index.php/Main_differences_with_iptables)
64+
from the `iptables` toolset.
65+
66+
To use `nftables`, install the `nftables` package, which provides
67+
[nft(8)](https://man.voidlinux.org/nft.8). It also provides
68+
[iptables-translate(8)/ip6tables-translate(8)](https://man.voidlinux.org/iptables-translate.8)
69+
and
70+
[iptables-restore-translate(8)/ip6tables-restore-translate(8)](https://man.voidlinux.org/iptables-restore-translate.8),
71+
which convert `iptables` rules to `nftables` rules.
72+
73+
### Applying the rules at boot
74+
75+
To apply nftables rules at runit stage 1, install the `runit-nftables` package.
76+
This adds a core-service which restores the ruleset in `/etc/nftables.conf`.
77+
78+
### Applying the rules at runtime
79+
80+
The `nftables` package provides the `nftables` service, which uses rules from
81+
`/etc/nftables.conf`. To load the rules, run:
82+
83+
```
84+
# sv up nftables
85+
```
86+
87+
To flush the rules, run:
88+
89+
```
90+
# sv down nftables
91+
```

0 commit comments

Comments
 (0)