diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2020-11-08 15:10:05 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2020-11-15 18:33:37 +0100 |
commit | ef1764c0ec38f987087f8dc9727aa12c441720a0 (patch) | |
tree | c290566dbd130efce7c645e5f70e5c1464c8be9f /roles/common/templates/etc/nftables.conf.j2 | |
parent | 4db299d6e2a5953c59906d4f1cb6841da34beb7c (diff) |
Firewall: ICMPv6: accept link-local multicast receiver notification messages.
Diffstat (limited to 'roles/common/templates/etc/nftables.conf.j2')
-rwxr-xr-x | roles/common/templates/etc/nftables.conf.j2 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/roles/common/templates/etc/nftables.conf.j2 b/roles/common/templates/etc/nftables.conf.j2 index 808383c..cc79671 100755 --- a/roles/common/templates/etc/nftables.conf.j2 +++ b/roles/common/templates/etc/nftables.conf.j2 @@ -47,41 +47,44 @@ flush ruleset table netdev filter { {% for if in ansible_interfaces %} {% if if != "lo" and ansible_facts[if].active %} {% set addr = (ansible_facts[if].ipv4 | default({'address': '0.0.0.0'})).address %} chain INGRESS-{{ if }} { type filter hook ingress device {{ if }} priority -499 policy accept # IPsec traffic (refined later in the filter rule) ip saddr {{ ipsec_subnet }} ip daddr {{ ipsec[inventory_hostname_short] }} meta secpath exists accept # rate-limiting is done directly by the kernel (net.ipv4.icmp_{ratelimit,ratemask} runtime options) icmp type { echo-reply, echo-request, destination-unreachable, time-exceeded } counter accept icmpv6 type { echo-reply, echo-request, destination-unreachable, packet-too-big, time-exceeded, parameter-problem } counter accept # accept neighbour discovery for autoconfiguration, RFC 4890 sec. 4.4.1 ip6 hoplimit 255 icmpv6 type { 133,134,135,136,141,142 } counter accept - # reject all remaining ICMP/ICMPv6 traffic + # accept link-local multicast receiver notification messages + ip6 saddr fe80::/10 ip6 daddr ff02::/16 ip6 hoplimit 1 icmpv6 type { 130,131,132,143 } counter accept + + # drop all remaining ICMP/ICMPv6 traffic meta l4proto { icmp, icmpv6 } drop # bogon filter (cf. RFC 6890 for non-global ip addresses) define bogon = { 0.0.0.0/8 # this host, on this network (RFC 1122 sec. 3.2.1.3) {% if not addr | ipaddr('10.0.0.0/8') %} , 10.0.0.0/8 # private-use (RFC 1918) {% endif %} , 100.64.0.0/10 # shared address space (RFC 6598) , 127.0.0.0/8 # loopback (RFC 1122, sec. 3.2.1.3) , 169.254.0.0/16 # link local (RFC 3927) {% if not addr | ipaddr('172.16.0.0/12') %} , 172.16.0.0/12 # private-use (RFC 1918) {% endif %} , 192.0.0.0/24 # IETF protocol assignments (RFC 6890 sec. 2.1) , 192.0.2.0/24 # documentation (RFC 5737) {% if not addr | ipaddr('192.168.0.0/16') %} , 192.168.0.0/16 # private-use (RFC 1918) {% endif %} , 198.18.0.0/15 # benchmarking (RFC 2544) |