network: firewall integration with NFT sets
New directives `NFTSet=`, `IPv4NFTSet=` and `IPv6NFTSet=` provide a method for
integrating configuration of dynamic networks into firewall rules with NFT
sets.
/etc/systemd/network/eth.network
```
[DHCPv4]
...
NFTSet=netdev:filter:eth_ipv4_address
```
```
table netdev filter {
set eth_ipv4_address {
type ipv4_addr
flags interval
}
chain eth_ingress {
type filter hook ingress device "eth0" priority filter; policy drop;
ip saddr != @eth_ipv4_address drop
accept
}
}
```
```
sudo nft list set netdev filter eth_ipv4_address
table netdev filter {
set eth_ipv4_address {
type ipv4_addr
flags interval
elements = { 10.0.0.0/24 }
}
}
```
This commit is contained in:
committed by
Topi Miettinen
parent
e8f1b50f27
commit
ab51fd9dbd
@@ -132,6 +132,7 @@ RouteMTUBytes=
|
||||
FallbackLeaseLifetimeSec=
|
||||
Use6RD=
|
||||
NetLabel=
|
||||
NFTSet=
|
||||
[DHCPv6]
|
||||
UseAddress=
|
||||
UseDelegatedPrefix=
|
||||
@@ -154,6 +155,7 @@ IAID=
|
||||
DUIDType=
|
||||
DUIDRawData=
|
||||
NetLabel=
|
||||
NFTSet=
|
||||
[DHCPv6PrefixDelegation]
|
||||
SubnetId=
|
||||
Announce=
|
||||
@@ -171,6 +173,7 @@ ManageTemporaryAddress=
|
||||
Token=
|
||||
RouteMetric=
|
||||
NetLabel=
|
||||
NFTSet=
|
||||
[Route]
|
||||
Destination=
|
||||
Protocol=
|
||||
@@ -257,6 +260,8 @@ DHCPv6PrefixDelegation=
|
||||
DHCPPrefixDelegation=
|
||||
BatmanAdvanced=
|
||||
IPoIB=
|
||||
IPv4NFTSet=
|
||||
IPv6NFTSet=
|
||||
[IPv6Prefix]
|
||||
Prefix=
|
||||
OnLink=
|
||||
@@ -348,6 +353,7 @@ Managed=
|
||||
OtherInformation=
|
||||
UplinkInterface=
|
||||
NetLabel=
|
||||
NFTSet=
|
||||
[IPv6PrefixDelegation]
|
||||
RouterPreference=
|
||||
DNSLifetimeSec=
|
||||
|
||||
Reference in New Issue
Block a user