router: rename nat table to router-nat so Docker's chains survive rebuilds
NixOS's nftables module rebuilds the tables it owns on every activation, which previously wiped Docker's DOCKER/PREROUTING chains in ip nat (both Docker and the router were defining 'ip nat'). Renaming our table sidesteps the collision — kernel hooks across separate tables at the same priority all run, so functionality is unchanged. Eliminates the need to run 'systemctl restart docker' after every nixos-rebuild to restore container port-forwards.
This commit is contained in:
parent
c1750c8538
commit
ec32b9b849
1 changed files with 6 additions and 1 deletions
|
|
@ -136,7 +136,12 @@ in
|
|||
}
|
||||
'';
|
||||
};
|
||||
tables.nat = {
|
||||
# Use a distinct table name so we don't share `ip nat` with Docker —
|
||||
# Docker manages its own DOCKER/PREROUTING chains in `ip nat`, and
|
||||
# NixOS's nftables module rebuilds whichever tables it owns on every
|
||||
# activation, which would wipe Docker's rules. Hooks at the same
|
||||
# priority across separate tables coexist fine.
|
||||
tables.router-nat = {
|
||||
family = "ip";
|
||||
content = ''
|
||||
chain prerouting {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue