Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / manifests / ip_nat.pp @ fcb1d356

Historique | Voir | Annoter | Télécharger (1,39 ko)

1
# manage basic chains in table ip nat
2
class nftables::ip_nat inherits nftables {
3
  nftables::config { ['ip-nat', 'ip6-nat']: }
4

    
5
  nftables::chain {
6
    [
7
      'PREROUTING',
8
      'POSTROUTING',
9
    ]:
10
      table => 'ip-nat';
11
  }
12

    
13
  nftables::chain {
14
    [
15
      'PREROUTING6',
16
      'POSTROUTING6',
17
    ]:
18
      table => 'ip6-nat';
19
  }
20

    
21
  # ip-nat-chain-PREROUTING
22
  nftables::rule {
23
    'PREROUTING-type':
24
      table   => 'ip-nat',
25
      order   => '01',
26
      content => 'type nat hook prerouting priority -100';
27
    'PREROUTING-policy':
28
      table   => 'ip-nat',
29
      order   => '02',
30
      content => 'policy accept';
31
    'PREROUTING6-type':
32
      table   => 'ip6-nat',
33
      order   => '01',
34
      content => 'type nat hook prerouting priority -100';
35
    'PREROUTING6-policy':
36
      table   => 'ip6-nat',
37
      order   => '02',
38
      content => 'policy accept';
39
  }
40

    
41
  # ip-nat-chain-POSTROUTING
42
  nftables::rule {
43
    'POSTROUTING-type':
44
      table   => 'ip-nat',
45
      order   => '01',
46
      content => 'type nat hook postrouting priority 100';
47
    'POSTROUTING-policy':
48
      table   => 'ip-nat',
49
      order   => '02',
50
      content => 'policy accept';
51
    'POSTROUTING6-type':
52
      table   => 'ip6-nat',
53
      order   => '01',
54
      content => 'type nat hook postrouting priority 100';
55
    'POSTROUTING6-policy':
56
      table   => 'ip6-nat',
57
      order   => '02',
58
      content => 'policy accept';
59
  }
60
}