nixos/firewall-nftables: allow adding additional rules to the rpfilter chain
This commit is contained in:
parent
383dbcec8c
commit
1eb26d4140
@ -45,6 +45,18 @@ in
|
|||||||
This option only works with the nftables based firewall.
|
This option only works with the nftables based firewall.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraReversePathFilterRules = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
example = "fib daddr . mark . iif type local accept";
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Additional nftables rules to be appended to the rpfilter-allow
|
||||||
|
chain.
|
||||||
|
|
||||||
|
This option only works with the nftables based firewall.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -79,6 +91,8 @@ in
|
|||||||
meta nfproto ipv4 udp sport . udp dport { 67 . 68, 68 . 67 } accept comment "DHCPv4 client/server"
|
meta nfproto ipv4 udp sport . udp dport { 67 . 68, 68 . 67 } accept comment "DHCPv4 client/server"
|
||||||
fib saddr . mark ${optionalString (cfg.checkReversePath != "loose") ". iif"} oif exists accept
|
fib saddr . mark ${optionalString (cfg.checkReversePath != "loose") ". iif"} oif exists accept
|
||||||
|
|
||||||
|
jump rpfilter-allow
|
||||||
|
|
||||||
${optionalString cfg.logReversePathDrops ''
|
${optionalString cfg.logReversePathDrops ''
|
||||||
log level info prefix "rpfilter drop: "
|
log level info prefix "rpfilter drop: "
|
||||||
''}
|
''}
|
||||||
@ -86,6 +100,10 @@ in
|
|||||||
}
|
}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
|
chain rpfilter-allow {
|
||||||
|
${cfg.extraReversePathFilterRules}
|
||||||
|
}
|
||||||
|
|
||||||
chain input {
|
chain input {
|
||||||
type filter hook input priority filter; policy drop;
|
type filter hook input priority filter; policy drop;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user