aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-17 01:31:43 +0000
committertv <tv@krebsco.de>2026-11-17 01:31:43 +0000
commitd281affea6d20c6569393f14624de06291303cb4 (patch)
tree98a396944b6bd23a6f51bdec21f745277f84ce56 /README.md
parentff3dafcc0003ffc2d48244fcd6e98984b6a9174d (diff)
let users allow plain TCP and UDP to given addresses
Rules like tcp://192.0.2.7:22 or udp://192.0.2.0/24:5000-5100 in a user's egress rules (managed with fc-egress as before) go into the nftables set allow_USER, and connections from that user's guests that match get forwarded (NATed to the host's address), or let in, if they're for one of the host's addresses. fcbr0-firewall fills the sets whenever a user's rules change, and after nftables reloads. Forwarding needs net.ipv4.ip_forward, which networking.nat used to set.
Diffstat (limited to 'README.md')
-rw-r--r--README.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/README.md b/README.md
index d5fb323..ea30fd2 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,8 @@ with `fc-egress`:
fc-egress list
fc-egress allow cache.nixos.org # the domain and its subdomains
fc-egress allow github.com/NixOS/ # only paths starting with /NixOS/
+fc-egress allow tcp://192.0.2.7:22 # plain TCP to that address and port
+fc-egress allow udp://192.0.2.0/24:5000-5100
fc-egress deny github.com/NixOS/
fc-egress log -f
```
@@ -95,6 +97,13 @@ when the guest gets built, so build the guest on the host after the proxy
has started once. Everything else, and anything that isn't HTTPS, gets
refused.
+tcp:// and udp:// rules take IPv4 addresses (a guest resolves every name
+to the host, so it has to use addresses for these, too). Those
+connections get forwarded, NATed to the host's address, or, if they're
+for one of the host's addresses, let in. If the host has a forward
+chain of its own, it has to let them through, too (anything from
+`fcbr0`; this module rejects what isn't allowed).
+
For `nix-shell` and the like to download, allow `cache.nixos.org`.
## Layout