Skip to content

for nixos-rebuild, old value of firewall.extraStopCommands should be used. #11966

@anderspapitto

Description

@anderspapitto

I have a pair of commands in firewall.extra{Start,Stop}Commands. They look like this now

      extraCommands = ''
        iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o enp0s3 -j MASQUERADE
      '';
      extraStopCommands = ''
        iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o enp0s3 -j MASQUERADE
      '';

and they used to look like this (different interface name)

      extraCommands = ''
        iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
      '';
      extraStopCommands = ''
        iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
      '';

when I did nixos-rebuild switch, the old rule was not taken down correctly. My (unconfirmed) suspicion is that the new value of extraStopCommands was used, which didn't work because it doesn't match the rule that the old value of extraStartCommands added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions