diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-10-22 18:55:29 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-10-22 18:55:29 +0200 |
commit | 3b75213d4077b4dbbad1fe43c22beaecf4e815d6 (patch) | |
tree | cc2c8aea67333e2df7320c9a225cd585c78421ee /os/config/roles/network/templates | |
parent | 5c31fbf0b12632b32912fa92be3d53b6e3902b91 (diff) | |
parent | b53b71f750008267351d84938b4701413f045628 (diff) | |
download | infrastructure-3b75213d4077b4dbbad1fe43c22beaecf4e815d6.tar.gz infrastructure-3b75213d4077b4dbbad1fe43c22beaecf4e815d6.zip |
We now have IPv6 activated on our network interfaces!
Diffstat (limited to 'os/config/roles/network/templates')
-rw-r--r-- | os/config/roles/network/templates/en.network | 9 | ||||
-rw-r--r-- | os/config/roles/network/templates/rules.v4 (renamed from os/config/roles/network/templates/rules.v4.j2) | 11 | ||||
-rw-r--r-- | os/config/roles/network/templates/rules.v6 | 40 |
3 files changed, 56 insertions, 4 deletions
diff --git a/os/config/roles/network/templates/en.network b/os/config/roles/network/templates/en.network new file mode 100644 index 0000000..b9b52e9 --- /dev/null +++ b/os/config/roles/network/templates/en.network @@ -0,0 +1,9 @@ +[Match] +Name={{ interface }} + +[Network] +Address={{ ipv4 }}/24 +Address={{ ipv6 }}/64 +Gateway=192.168.1.254 +DNS={{ ipv4 }} +DNS={{ dns_server }} diff --git a/os/config/roles/network/templates/rules.v4.j2 b/os/config/roles/network/templates/rules.v4 index a446139..a5f138b 100644 --- a/os/config/roles/network/templates/rules.v4.j2 +++ b/os/config/roles/network/templates/rules.v4 @@ -3,15 +3,18 @@ :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] +# Internet Control Message Protocol +-A INPUT -p icmp -j ACCEPT + # Administration -A INPUT -p tcp --dport 22 -j ACCEPT -# Cluster +# Diplonat needs everything open to communicate with IGD with the router -A INPUT -s 192.168.1.254 -j ACCEPT --A INPUT -s 82.253.205.190 -j ACCEPT + +# Cluster {% for selected_host in groups['cluster_nodes'] %} --A INPUT -s {{ hostvars[selected_host]['public_ip'] }} -j ACCEPT --A INPUT -s {{ hostvars[selected_host]['private_ip'] }} -j ACCEPT +-A INPUT -s {{ hostvars[selected_host]['ipv4'] }} -j ACCEPT {% endfor %} # Local diff --git a/os/config/roles/network/templates/rules.v6 b/os/config/roles/network/templates/rules.v6 new file mode 100644 index 0000000..50737a0 --- /dev/null +++ b/os/config/roles/network/templates/rules.v6 @@ -0,0 +1,40 @@ +*filter +:INPUT DROP [0:0] +:FORWARD DROP [0:0] +:OUTPUT ACCEPT [0:0] + +# Internet Control Message Protocol +# (required) +-A INPUT -p icmp -j ACCEPT +-A INPUT -p ipv6-icmp -j ACCEPT + +# Administration +-A INPUT -p tcp --dport 22 -j ACCEPT + +# Cluster +{% for selected_host in groups['cluster_nodes'] %} +-A INPUT -s {{ hostvars[selected_host]['ipv6'] }} -j ACCEPT +{% endfor %} + +# Local +-A INPUT -i docker0 -j ACCEPT +-A INPUT -s ::1/128 -j ACCEPT +-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT + +COMMIT + +*nat +:PREROUTING ACCEPT [0:0] +:INPUT ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +:POSTROUTING ACCEPT [0:0] +COMMIT + +*mangle +:PREROUTING ACCEPT [0:0] +:INPUT ACCEPT [0:0] +:FORWARD ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +:POSTROUTING ACCEPT [0:0] +COMMIT + |