博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何在CentOS 7 Linux上重新启动时使iptables / ip6tables配置永久化?
阅读量:2518 次
发布时间:2019-05-11

本文共 1468 字,大约阅读时间需要 4 分钟。

How to make iptables/ip6tables configurations permanent across reboot on CentOS 7 ?

如何在CentOS 7 上重新启动时使iptables / ip6tables配置永久化?

CentOS 7 uses FirewallD by default. If you would like to manage iptables/ip6tables rules directly without using FirewallD, you may use the old good iptables-services service which will load the iptables/ip6tables rules saved in /etc/sysconfig/iptables and /etc/sysconfig/ip6tables when it is started during boot time.

CentOS 7默认使用FirewallD。 如果您想不使用FirewallD直接管理iptables / ip6tables规则,则可以使用旧的良好iptables-services服务,该服务将在/etc/sysconfig/iptables/etc/sysconfig/ip6tables加载保存在其中的iptables / ip6tables规则在启动期间启动。

启用iptables-services服务 (Enable iptables-services service)

# yum install iptables-services# touch /etc/sysconfig/iptables# touch /etc/sysconfig/ip6tables# systemctl  iptables# systemctl start ip6tables# systemctl enable iptables# systemctl enable ip6tables

If the has FirewallD installed and enabled by default, you may disable the firewalld by

如果默认情况下安装并启用了FirewallD,则可以通过以下方式禁用firewalld

# systemctl disable firewalld.service# systemctl stop firewalld.service

保存iptables和ip6tables规则 (Save iptables and ip6tables rules)

Backup the configuration files before saving:

保存前备份配置文件:

# cp /etc/sysconfig/iptables /etc/sysconfig/iptables-date +%s# cp /etc/sysconfig/ip6tables /etc/sysconfig/ip6tables-date +%s

Then save the iptables rules:

然后保存iptables规则:

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

翻译自:

转载地址:http://xfowd.baihongyu.com/

你可能感兴趣的文章
软件评价
查看>>
分别在Windows系统和Linux系统环境安装anaconda3和tensorflow
查看>>
小程序开发基础-view视图容器
查看>>
【C++对象模型】函数返回C++对象的问题
查看>>
mysql索引创建 删除 查看 检测
查看>>
http 协议详解
查看>>
MySQL修改root密码的多种方法
查看>>
盘点国内Android移动广告平台的现状
查看>>
MongoDB 3.4 高可用集群搭建(二)replica set 副本集
查看>>
哈夫曼树编码
查看>>
QQ通信原理及QQ是怎么穿透内网进行通信的?
查看>>
maven引入ojdbc
查看>>
HTTP深入浅出 http请求
查看>>
事件驱动 异步IO
查看>>
JS学习笔记 - 透明度运动框
查看>>
Oracle_视图_索引_plsql_游标_存储过程_存储函数_触发器
查看>>
学习ASP.NET
查看>>
vue相关技术
查看>>
CSS BEM 命名规范简介
查看>>
LeetCode Minimum Path Sum
查看>>