大网数据广告活动
服务器运维问答

How to load iptables rules to firewalld?

· 52CE 我爱测

I've got centos 6 running server. It uses iptables. I want to migrate to centos 7. Centos 7 uses firewalld. My aim is to download iptables configuration(rules) and apply to firewalld. I can download iptables rules like this: ipta…

问题原文

原帖链接 · Ikrom · CC BY-SA 4.0

I've got centos 6 running server. It uses iptables. I want to migrate to centos 7. Centos 7 uses firewalld.
My aim is to download iptables configuration(rules) and apply to firewalld. I can download iptables rules like this:

iptables-save

I don't know how to apply iptables-save's output to firewalld. I hope there is automated way. Question: How can I apply current iptables rules to firewalld? I don't like to configure manually because there might be many server with big iptables rules/configs.

已采纳解答

原帖链接 · HBruijn · CC BY-SA 4.0

A good place to start is the RHEL 6 --> 7 migration planning guide but in short:

  • If you configured your RHEL/CentOS 6 firewall with system-config-firewall, you can use the firewall-offline-cmd tool to migrate the configuration from /etc/sysconfig/system-config-firewall into the default zone of firewalld.
  • If you used any other method to configure your current firewall there is, as far as I know, no practical migration to firewalld and your options are:

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-05-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。