REAL_PATH=$(realpath $(dirname $0))
-nft list ruleset | grep ^table | sed 's/ {$//' | while read TABLE_SPEC
-do
- nft flush $TABLE_SPEC
- nft delete $TABLE_SPEC
-done
-
+nft flush ruleset
nft --echo --file $REAL_PATH/nftables.config
-nft list ruleset >/etc/nftables/ifg.nft
-nft list ruleset
+nft list ruleset | tee /etc/nftables/ifg.nft
systemctl enable nftables.service
add rule inet ifg_filter input \
ip protocol icmp \
counter accept comment "ICMP"
+add rule inet ifg_filter input \
+ ip protocol icmpv6 \
+ counter accept comment "ICMP"
add rule inet ifg_filter input \
ip protocol gre \
add rule inet ifg_filter forward \
ip protocol icmp \
counter accept comment "ICMP"
+add rule inet ifg_filter forward \
+ ip protocol icmpv6 \
+ counter accept comment "ICMP"
add rule inet ifg_filter forward \
counter log prefix "FORWARD"
add rule inet ifg_filter output \
ip protocol icmp \
counter accept comment "ICMP"
+add rule inet ifg_filter output \
+ ip protocol icmpv6 \
+ counter accept comment "ICMP"
add rule inet ifg_filter output \
counter log prefix "OUTPUT"