nft实战-迁移iptables规则到nft

迁移iptables规则到nft
  1. To save the existing rules to a file, run below command:
# iptables-save > rules.iptables
  1. Move the step1 file to CentOS/RHEL 8 Server via scp or ftp. You can use vi editor as well to copy the content from CentOS/RHEL 6 or 7 machine.
  2. Run the below command to generate the nft rules file on CentOS/RHEL 8 with iptables rules file.
# iptables-restore-translate -f rules.iptables > rules.nft
  1. Load the rules in CentOS/RHEL 8 machine, make sure nftables service is running on the system.
# nft -f rules.nft     ### load the rule via nft to nftables.
  1. To Display rule in CentOS/RHEL 8 Server .
# nft list ruleset

You can see the rules have been migrated from CentOS/RHEL 6 or 7 to CentOS/RHEL 8 server now and can test them as well

本文链接:http://www.yunweipai.com/35080.html

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/52542.html

(0)
上一篇 2021年8月6日
下一篇 2021年8月6日

相关推荐

发表回复

登录后才能评论