| 1 |
# zone |
| 2 |
|
| 3 |
This section is required on all configurations. It lists all known zones. |
| 4 |
|
| 5 |
``` |
| 6 |
zone { |
| 7 |
localhost |
| 8 |
public |
| 9 |
} |
| 10 |
``` |
| 11 |
|
| 12 |
Above example defines two zones, `localhost` and `public`. All configurations |
| 13 |
must have zone `localhost`, which is the computer running Foomuuri, similar to |
| 14 |
"localhost" in hostnames. See [zone names](../basic.md#zone-names) for |
| 15 |
recommended zone naming. |
| 16 |
|
| 17 |
Above example assumes that you are using firewalld D-Bus (`dbus_firewalld` |
| 18 |
config option) emulation where interfaces are attached and detached to zones |
| 19 |
by NetworkManager. It is the recommended way for laptops and personal servers. |
| 20 |
This config option will be turned on by default when installing |
| 21 |
`foomuuri-firewalld` package. |
| 22 |
|
| 23 |
You can also define default interface to zone mapping by specifying interface |
| 24 |
name(s) after zone name. This is useful for corporate servers with static |
| 25 |
network configuration. This method can be used with or without firewalld |
| 26 |
D-Bus emulation. This mapping is only default, not static. Interfaces can |
| 27 |
still be moved to other zones with D-Bus calls. |
| 28 |
|
| 29 |
``` |
| 30 |
zone { |
| 31 |
localhost # Localhost must be left empty |
| 32 |
public eth0 # eth0 is attached to public |
| 33 |
dmz eth1 eth2 # eth1 and eth2 are in dmz |
| 34 |
} |
| 35 |
``` |
| 36 |
|
| 37 |
It is also possible to use wildcard interface names. If you define `wg*` |
| 38 |
then make sure that NetworkManager doesn't try to assign `wg0` to any zone. |
| 39 |
It would create "interval overlap" error as `wg*` and `wg0` conflicts. |
| 40 |
|
| 41 |
``` |
| 42 |
zone { |
| 43 |
localhost |
| 44 |
public eth0 |
| 45 |
wireguard wg* # Matches wg0, wg1, wgfoo, and so on |
| 46 |
} |
| 47 |
``` |
| 48 |
|
| 49 |
There is also catch all interface `*`. It will match all unassigned |
| 50 |
interfaces. Interfaces assigned to a zone in config or by NetworkManager |
| 51 |
will use that zone. |
| 52 |
|
| 53 |
``` |
| 54 |
zone { |
| 55 |
localhost |
| 56 |
public * # All other than eth0 are assigned to public |
| 57 |
internal eth0 |
| 58 |
} |
| 59 |
``` |