rework firewall setup
This commit is contained in:
parent
be62c1270f
commit
cd48cf495d
30 changed files with 145 additions and 122 deletions
|
@ -66,16 +66,16 @@ def get_static_allocations(metadata):
|
|||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'nftables/rules/10-kea-dhcp-server',
|
||||
'nftables/input/10-kea-dhcp-server',
|
||||
)
|
||||
def nftables(metadata):
|
||||
rules = set()
|
||||
for iface in node.metadata.get('kea-dhcp-server/subnets', {}):
|
||||
rules.add(f'inet filter input udp dport {{ 67, 68 }} iif {iface} accept')
|
||||
rules.add(f'udp dport {{ 67, 68 }} iifname {iface} accept')
|
||||
|
||||
return {
|
||||
'nftables': {
|
||||
'rules': {
|
||||
'input': {
|
||||
# can't use port_rules here, because we're generating interface based rules.
|
||||
'10-kea-dhcp-server': sorted(rules),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue