Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<various>: Split "Firewalls" section into distinct sections. #508

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
- [Kernel](./config/kernel.md)
- [Power Management](./config/power-management.md)
- [Network](./config/network/index.md)
- [Firewalls](./config/network/firewalls.md)
- [wpa_supplicant](./config/network/wpa_supplicant.md)
- [IWD](./config/network/iwd.md)
- [NetworkManager](./config/network/networkmanager.md)
- [ConnMan](./config/network/connman.md)
- [iptables](./config/network/iptables.md)
- [nftables](./config/network/nftables.md)
- [Network Filesystems](./config/network-filesystems.md)
- [Session and Seat Management](./config/session-management.md)
- [Graphical Session](./config/graphical-session/index.md)
Expand Down
9 changes: 9 additions & 0 deletions src/config/network/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,12 @@ Void provides several ways to connect to wireless networks:
- [iwd](./iwd.md)
- [NetworkManager](./networkmanager.md)
- [ConnMan](./connman.md)

## Firewalls

By default, the `iptables` package is installed on the base system. However,
iptables is now considered deprecated on Linux, with nftables as its
replacement.

- [iptables](./iptables.md)
- [nftables](./nftables.md)
45 changes: 3 additions & 42 deletions src/config/network/firewalls.md → src/config/network/iptables.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Firewalls

## iptables
# iptables

By default, the `iptables` package is installed on the base system. It provides
[iptables(8)/ip6tables(8)](https://man.voidlinux.org/iptables.8). The related
Expand All @@ -11,7 +9,7 @@ system administrator.
Two example rulesets are provided in the `/etc/iptables` directory:
`empty.rules` and `simple_firewall.rules`.

### Applying the rules at boot
## Applying the rules at boot

To apply iptables rules at runit stage 1, install the `runit-iptables` package.
This adds a core-service which restores the `iptables.rules` and
Expand All @@ -37,7 +35,7 @@ After rebooting, check the active firewall rules:
# ip6tables -L
```

### Applying the rules at runtime
## Applying the rules at runtime

`iptables` comes with two runit services, `iptables` and `ip6tables`, to quickly
flush or restore the `iptables.rules` and `ip6tables.rules` rulesets. Once these
Expand All @@ -53,40 +51,3 @@ and restore them by upping the relevant service, e.g.:
```
# sv up ip6tables
```

## nftables

`nftables` replaces `iptables`, `ip6tables`, `arptables` and `ebtables`
(collectively referred to as `xtables`). The [nftables
wiki](https://wiki.nftables.org/wiki-nftables/index.php/Main_Page) describes
[the main
differences](https://wiki.nftables.org/wiki-nftables/index.php/Main_differences_with_iptables)
from the `iptables` toolset.

To use `nftables`, install the `nftables` package, which provides
[nft(8)](https://man.voidlinux.org/nft.8). It also provides
[iptables-translate(8)/ip6tables-translate(8)](https://man.voidlinux.org/iptables-translate.8)
and
[iptables-restore-translate(8)/ip6tables-restore-translate(8)](https://man.voidlinux.org/iptables-restore-translate.8),
which convert `iptables` rules to `nftables` rules.

### Applying the rules at boot

To apply nftables rules at runit stage 1, install the `runit-nftables` package.
This adds a core-service which restores the ruleset in `/etc/nftables.conf`.

### Applying the rules at runtime

The `nftables` package provides the `nftables` service, which uses rules from
`/etc/nftables.conf`. Once you [enable](../services/index.md#enabling-service)
the `nftables` service, to load the rules, run:

```
# sv up nftables
```

To flush the rules, run:

```
# sv down nftables
```
38 changes: 38 additions & 0 deletions src/config/network/nftables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# nftables

`nftables` replaces `iptables`, `ip6tables`, `arptables` and `ebtables`
(collectively referred to as `xtables`). The [nftables
wiki](https://wiki.nftables.org/wiki-nftables/index.php/Main_Page) describes
[the main
differences](https://wiki.nftables.org/wiki-nftables/index.php/Main_differences_with_iptables)
from the `iptables` toolset.

To use `nftables`, install the `nftables` package, which provides
[nft(8)](https://man.voidlinux.org/nft.8). It also provides
[iptables-translate(8)/ip6tables-translate(8)](https://man.voidlinux.org/iptables-translate.8)
and
[iptables-restore-translate(8)/ip6tables-restore-translate(8)](https://man.voidlinux.org/iptables-restore-translate.8),
which convert `iptables` rules to `nftables` rules.

## Applying the rules at boot

To apply nftables rules at runit stage 1, install the `runit-nftables` package.
This adds a core-service which restores the ruleset in `/etc/nftables.conf`.

## Applying the rules at runtime

The `nftables` package provides the `nftables` service, which uses rules from
`/etc/nftables.conf`. [Enabling](../services/index.md#enabling-services) the
service will load the rules.

To flush the rules, run:

```
# sv down nftables
```

To re-load the rules, run:

```
# sv up nftables
```