Zones
Zones define a part of network topology.
They are usually defined as a list of subnets or by a list of interfaces, though custom rules for matching traffic are possible.
There exists an implicit all Zone, that matches all traffic.
Traffic originating or targeting the local machine are matched by a predefined zone called fw (short for firewall) by default.
There exists inheritance for zones. Each zone will automatically get the rules of its parent zone applied, after the more specific rules get applied.
Options in networking.nftables.firewall.zones.<name>
Section titled “Options in networking.nftables.firewall.zones.<name>”...after
Section titled “...after”| Name | networking.nftables.firewall.zones.<name>.after |
|---|---|
| Type | non-empty (list of string) |
| Declared in |
...before
Section titled “...before”| Name | networking.nftables.firewall.zones.<name>.before |
|---|---|
| Type | non-empty (list of string) |
| Declared in |
...early
Section titled “...early”| Name | networking.nftables.firewall.zones.<name>.early |
|---|---|
| Type | boolean |
| Default | false |
| Declared in |
...egressExpression
Section titled “...egressExpression”| Name | networking.nftables.firewall.zones.<name>.egressExpression |
|---|---|
| Description |
If multiple expressions are given, any one of them matching traffic suffices to consider the traffic as part of the zone. This is used eg. when defining a zone as an ipv4 and ipv6 subnet. No Traffic will ever match both, so one matching expression is considered sufficient.
|
| Type | list of string |
| Default | [ ] |
| Declared in |
...enable
Section titled “...enable”| Name | networking.nftables.firewall.zones.<name>.enable |
|---|---|
| Type | boolean |
| Default | true |
| Declared in |
...ingressExpression
Section titled “...ingressExpression”| Name | networking.nftables.firewall.zones.<name>.ingressExpression |
|---|---|
| Description |
If multiple expressions are given, any one of them matching traffic suffices to consider the traffic as part of the zone. This is used eg. when defining a zone as an ipv4 and ipv6 subnet. No Traffic will ever match both, so one matching expression is considered sufficient.
|
| Type | list of string |
| Default | [ ] |
| Declared in |
...interfaces
Section titled “...interfaces”| Name | networking.nftables.firewall.zones.<name>.interfaces |
|---|---|
| Description | Shorthand for defining This defines the zone as a list of network interfaces. |
| Type | list of string |
| Default | [ ] |
| Example | [ "eth0" ] |
| Declared in |
...ipv4Addresses
Section titled “...ipv4Addresses”| Name | networking.nftables.firewall.zones.<name>.ipv4Addresses |
|---|---|
| Description | Shorthand for defining This defines the zone as a list of ipv4 hosts or subnets. |
| Type | list of string |
| Default | [ ] |
| Example | [ "192.168.0.0/24" ] |
| Declared in |
...ipv6Addresses
Section titled “...ipv6Addresses”| Name | networking.nftables.firewall.zones.<name>.ipv6Addresses |
|---|---|
| Description | Shorthand for defining This defines the zone as a list of ipv6 hosts or subnets. |
| Type | list of string |
| Default | [ ] |
| Example | [ "2042::/16" ] |
| Declared in |
...late
Section titled “...late”| Name | networking.nftables.firewall.zones.<name>.late |
|---|---|
| Type | boolean |
| Default | false |
| Declared in |
...parent
Section titled “...parent”| Name | networking.nftables.firewall.zones.<name>.parent |
|---|---|
| Description | Additionally to If traffic matches a zone, it will first be tested, if it also matches some of its subzones. If so, the logic of the subzones will be called. If not, or if the subzones did not terminate the rule processing with a verdict, the rules of the parent zone will be applied. |
| Type | null or string |
| Default | null |
| Example | config.networking.nftables.firewall.localZoneName |
| Declared in |