|
|
|
@ -50,8 +50,12 @@ sudo iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT |
|
|
|
if [ ! -z "${SSH_CLIENT}" ]; then |
|
|
|
if [ ! -z "${SSH_CLIENT}" ]; then |
|
|
|
SSH_SRC=$(echo $SSH_CLIENT | awk '{print $1}') |
|
|
|
SSH_SRC=$(echo $SSH_CLIENT | awk '{print $1}') |
|
|
|
SSH_PRT=$(echo $SSH_CLIENT | awk '{print $3}') |
|
|
|
SSH_PRT=$(echo $SSH_CLIENT | awk '{print $3}') |
|
|
|
|
|
|
|
if [[ $SSH_SRC =~ .*:.* ]]; then |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p tcp -s $SSH_SRC --dport $SSH_PRT -j ACCEPT |
|
|
|
|
|
|
|
else |
|
|
|
sudo iptables -A INPUT -p tcp -s $SSH_SRC --dport $SSH_PRT -j ACCEPT |
|
|
|
sudo iptables -A INPUT -p tcp -s $SSH_SRC --dport $SSH_PRT -j ACCEPT |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# docker rules |
|
|
|
# docker rules |
|
|
|
sudo iptables -N MISTBORN_DOCKER_INPUT |
|
|
|
sudo iptables -N MISTBORN_DOCKER_INPUT |
|
|
|
@ -91,6 +95,15 @@ echo "Setting ip6tables rules" |
|
|
|
sudo ip6tables -P INPUT ACCEPT |
|
|
|
sudo ip6tables -P INPUT ACCEPT |
|
|
|
sudo ip6tables -I INPUT -i lo -j ACCEPT |
|
|
|
sudo ip6tables -I INPUT -i lo -j ACCEPT |
|
|
|
sudo ip6tables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT |
|
|
|
sudo ip6tables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT |
|
|
|
|
|
|
|
# Allow as per RFC 4890 |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 1 -j ACCEPT |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 2 -j ACCEPT |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 3 -j ACCEPT |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 4 -j ACCEPT |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 133 -j ACCEPT |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 134 -j ACCEPT |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 135 -j ACCEPT |
|
|
|
|
|
|
|
sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 136 -j ACCEPT |
|
|
|
sudo ip6tables -A INPUT -j MISTBORN_LOG_DROP |
|
|
|
sudo ip6tables -A INPUT -j MISTBORN_LOG_DROP |
|
|
|
|
|
|
|
|
|
|
|
sudo ip6tables -P INPUT DROP |
|
|
|
sudo ip6tables -P INPUT DROP |
|
|
|
|