root / manifests / ip_nat.pp @ c8092701
Historique | Voir | Annoter | Télécharger (1,13 ko)
1 |
# manage basic chains in table ip nat |
---|---|
2 |
class nftables::ip_nat inherits nftables { |
3 |
|
4 |
nftables::config{ |
5 |
'ip-nat': |
6 |
source => 'puppet:///modules/nftables/config/puppet-ip-nat.nft'; |
7 |
} |
8 |
|
9 |
nftables::chain{ |
10 |
[ |
11 |
'PREROUTING', |
12 |
'POSTROUTING', |
13 |
]: |
14 |
table => 'ip-nat'; |
15 |
} |
16 |
|
17 |
# ip-nat-chain-PREROUTING |
18 |
nftables::rule{ |
19 |
default: |
20 |
table => 'ip-nat'; |
21 |
'PREROUTING-type': |
22 |
order => '01', |
23 |
content => 'type nat hook prerouting priority -100'; |
24 |
'PREROUTING-policy': |
25 |
order => '02', |
26 |
content => 'policy accept'; |
27 |
} |
28 |
|
29 |
# ip-nat-chain-POSTROUTING |
30 |
nftables::rule{ |
31 |
default: |
32 |
table => 'ip-nat'; |
33 |
'POSTROUTING-type': |
34 |
order => '01', |
35 |
content => 'type nat hook postrouting priority 100'; |
36 |
'POSTROUTING-policy': |
37 |
order => '02', |
38 |
content => 'policy accept'; |
39 |
} |
40 |
|
41 |
# basic outgoing rules |
42 |
if $nftables::out_ntp { |
43 |
include nftables::rules::out::chrony |
44 |
} |
45 |
if $nftables::out_dns { |
46 |
include nftables::rules::out::dns |
47 |
} |
48 |
if $nftables::out_http { |
49 |
include nftables::rules::out::http |
50 |
} |
51 |
if $nftables::out_https { |
52 |
include nftables::rules::out::https |
53 |
} |
54 |
} |