sblantipodi wrote:
Give me your /etc/sysconfig/ip6tables
Sorry, all Ubuntu here, so no /etc/sysconfig directory. But if you're looking for some sample rules, I've got a mixture of nodes using ufw (those with simple/minimal requirements) and some using firehol/sanewall (pre-v6 support) for more complicated v4 rules, with basic v6 setup in /etc/network/if-up.d.
In the latter case, for IPv6 I'm currently just using (for /etc/network/if-up.d/eth0):
Code:
ip6tables -F
ip6tables -P INPUT DROP
ip6tables -I INPUT -p icmpv6 -j ACCEPT
ip6tables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
ip6tables -I INPUT -p tcp --dport 80 -j ACCEPT
or in ip6tables-save format:
Code:
# Generated by ip6tables-save v1.4.12 on Fri Jul 18 19:59:30 2014
*filter
:INPUT DROP [268:75972]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [556802:1200105898]
-A INPUT -p ipv6-icmp -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
COMMIT
# Completed on Fri Jul 18 19:59:30 2014
This particular case is for a public-facing web server.
ufw has a more elaborate - but reasonable - configuration by default, so I accept it, but not sure I'd have necessarily bothered doing it if I had to set it up manually. On my 12.04 systems, extracting the ICMPv6 related rules yields:
Code:
# Generated by ip6tables-save v1.4.12 on Fri Jul 18 19:39:09 2014
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [12:832]
:ufw6-before-input - [0:0]
:ufw6-before-forward - [0:0]
:ufw6-before-output - [0:0]
-A INPUT -j ufw6-before-input
-A FORWARD -j ufw6-before-forward
-A OUTPUT -j ufw6-before-output
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 135 -m hl --hl-eq 255 -j ACCEPT
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 136 -m hl --hl-eq 255 -j ACCEPT
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 133 -m hl --hl-eq 255 -j ACCEPT
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 134 -m hl --hl-eq 255 -j ACCEPT
-A ufw6-before-input -s fe80::/10 -p ipv6-icmp -m icmp6 --icmpv6-type 129 -j ACCEPT
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 1 -j ACCEPT
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 2 -j ACCEPT
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 3 -j ACCEPT
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 4 -j ACCEPT
-A ufw6-before-input -p ipv6-icmp -m icmp6 --icmpv6-type 128 -j ACCEPT
-A ufw6-before-output -p ipv6-icmp -m icmp6 --icmpv6-type 135 -m hl --hl-eq 255 -j ACCEPT
-A ufw6-before-output -p ipv6-icmp -m icmp6 --icmpv6-type 136 -m hl --hl-eq 255 -j ACCEPT
COMMIT
# Completed on Fri Jul 18 19:39:09 2014
which is essentially the set of types I mention, with the addition of an allowance for echo response from the link-local address block. I believe that's to support responses to a multi-cast echo request since each responding node will use its link-local address, which won't have any state to match for the responding packet. Certainly not a common use case for me.
-- David