printf "#!/usr/sbin/nft -f\n" > /etc/nftables.conf
printf "flush ruleset\n" >> /etc/nftables.conf
nft list ruleset >> /etc/nftables.conf
+ if [ -d /etc/sysconfig ]; then
+ cp /etc/nftables.conf /etc/sysconfig/nftables.conf
+ fi
fi
}
allow_ping() {
printf "Allowing icmp pings\n"
if [ "$FIREWALL" = "iptables" ]; then
- iptables -A INPUT -p icmp --icmp-type echo-request -m limit --limit 10/sec -j ACCEPT
- iptables -A INPUT -p icmpv6 --icmpv6-type echo-request -m limit --limit 10/sec -j ACCEPT
+ iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
+ iptables -A INPUT -p icmpv6 --icmpv6-type echo-request -j ACCEPT
elif [ "$FIREWALL" = "nftables" ]; then
- nft add rule inet filter input icmp type \{ echo-request \} limit rate 10/second accept
- nft add rule inet filter input icmpv6 type \{ echo-request \} limit rate 10/second accept
+ nft add rule inet filter input icmp type echo-request accept
+ nft add rule inet filter input icmpv6 type echo-request accept
fi
}