精彩文章免费看
从iptables迁移到nftables
cloudFans
简书作者 2022-06-16 10:12IP属地: 吉林基于iptables-save 为文件,然后导入即可
% iptables-save > iptables.txt
% iptables-nft-restore < iptables.txt
% iptables-nft-save
# Generated by xtables-save v1.6.0 (nf_tables) on Sat Dec 24 14:51:41 2016
*filter
:INPUT ACCEPT [19:1283]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [18:2487]
-A FORWARD -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
COMMIT
# Completed on Sat Dec 24 14:51:41 2016
% nft list ruleset
table ip filter {
chain INPUT {
type filter hook input priority 0; policy accept;
}
chain FORWARD {
type filter hook forward priority 0; policy accept;
ip protocol tcp tcp dport 22 ct state new counter packets 0 bytes 0 accept
}
chain OUTPUT {
type filter hook output priority 0; policy accept;
}
}
参考: https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_iptables_to_nftables
© 著作权归作者所有,转载或内容合作请联系作者点赞赚钻最高日赚数百
赞 (0) cloudFans 小礼物走一走,来简书关注我 下载简书,随时随地看好文 暂无评论 智慧如你,不想 咩~创作你的创作,接受世界的赞赏 ||热门文章 标签:iptables,tcp,filter,nftables,ACCEPT,过渡,save From: https://www.cnblogs.com/cheyunhua/p/18003785