Debian Codegraph @

docs/config/section/zonemap.md

raw
1 # zonemap
2
3 Normally Foomuuri will map incoming and outgoing traffic to zones by
4 source and destination network interface. These interfaces are assigned to
5 zones dynamically by NetworkManager, or configured in
6 [zone](zone.md) section.
7
8 Zonemap section can be used to map traffic to different zone by using
9 standard [rules](../rule/index.md). Example:
10
11 ```
12 zonemap {
13 # Map outgoing IPsec traffic that is going to zone "public" to use zone
14 # "vpn" instead.
15 dipsec dzone public new_dzone vpn
16
17 # Same for incoming.
18 sipsec szone public new_szone vpn
19 }
20
21 localhost-public {
22 # Rules for non-IPsec traffic
23 ipsec # You must allow IPsec traffic here and in public-localhost
24 ...accept some traffic...
25 reject log
26 }
27
28 localhost-vpn {
29 # Rules for IPsec traffic
30 ...accept some traffic...
31 reject log
32 }
33 ```
34
35 Above example, splitting traffic to IPsec and non-IPsec zones is the most
36 common use case. You can use any matcher, for example `daddr` or `saddr` to
37 map some IP addresses to own zones, or `uid` or `gid` to map outgoing
38 traffic from some local user to own zone:
39
40 ```
41 zonemap {
42 # Map IP address 10.2.3.0/24 from internal to dmz
43 saddr 10.2.3.0/24 szone internal new_szone dmz
44 daddr 10.2.3.0/24 dzone internal new_dzone dmz
45
46 # Map outgoing traffic from user myservice to myzone
47 uid myservice szone localhost new_szone myzone
48
49 # Map all outgoing IPsec traffic to xxx-vpn, no matter what the original
50 # dzone was
51 dipsec new_dzone vpn
52 }
53 ```