nftインストール
ufw無効
sudo ufw disablesudo systemctl stop ufwsudo systemctl disable ufwreboot
sudo apt install nftablessudo update-alternatives --config iptables- nftablesを選択
sudo vim /etc/nftables.conf#!/usr/sbin/nft -f flush ruleset table inet filter { chain input { type filter hook input priority 0; policy drop; iifname "lo" counter accept ct state established,related counter accept ct state new tcp dport 22 counter accept } chain forward { type filter hook forward priority 0; policy drop; } chain output { type filter hook output priority 0; policy accept; } }起動と有効化
systemctl enable nftables --now
動作確認
nft list rulesetsudo iptables --versioniptables v1.8.4 (nf_tables)
nftables
Original text: Japanese