加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

如何在Redhat Enterprise Server 7上保存iptables配置

发布时间:2020-12-13 17:11:12 所属栏目:Linux 来源:网络整理
导读:我有一个Redhat服务器(Red Hat Enterprise Linux Server 7.2(Maipo)),它在re / boot上重置了iptable规则. 根据version 6 documentation,我执行: /sbin/service iptables save 返回: The service command supports only basic LSB actions (start,stop,rest
我有一个Redhat服务器(Red Hat Enterprise Linux Server 7.2(Maipo)),它在re / boot上重置了iptable规则.

根据version 6 documentation,我执行:

/sbin/service iptables save

返回:

The service command supports only basic LSB actions (start,stop,restart,try-restart,reload,force-reload,status). For other actions,please try to use systemctl.

如果我正确理解了消息,我尝试了以下方法:

sudo systemctl iptables save

返回:

Unknown operation 'iptables'.

我没有具体在保存IP表上找到version 7 documentation,但以前的版本支持相同的命令.

What command should I run to save iptables config?

以供参考:

防火墙d satatus:

systemctl status firewalld
firewalld.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

解决方法

你应该安装iptables-services包.

然后服务iptables保存将工作.这些命令也可以工作:

# iptables-save > /etc/sysconfig/iptables
# ip6tables-save > /etc/sysconfig/ip6tables

AFAIK,systemctl没有任何保存iptables-services配置的选项.

注意:systemctl语法如下:systemctl< operation> <单元>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读