centos7iptables和rc.local问题

简介:

今天给一个学校安装nginx设置开机启动,对方的操作系统是centos7的。但是后来发现开机并没有启动,而且iptables里的设置也没有生效。随便一百度,人家就甩出解决方案了。我就整理总结一下,自己做个备忘吧。


先在/etc/sysconfig/iptables里写好规则,然后就是下面这堆了:

#!/bin/bash

chmod +x /etc/rc.d/rc.local

systemctl stop firewalld

systemctl disable firewalld

systemctl restart iptables

systemctl enable iptables


没有找到iptables服务的,执行yum install -y iptables-services



本文转自 朱科强 51CTO博客,原文链接:http://blog.51cto.com/zhukeqiang/1655514,如需转载请自行联系原作者

相关文章
|
Linux
centos使用iptables实现nat端口转发
centos使用iptables实现nat端口转发
861 4
|
安全 Linux 网络安全
百度搜索:蓝易云【服务器安全设置Centos7 防火墙firewall与iptables】
CentOS 7使用的默认防火墙是firewall,它是一种基于Netfilter的用户空间工具,用于管理Linux内核中的iptables规则。为了加强服务器的安全性,可以通过配置CentOS 7防火墙和iptables规则来保护服务器。
194 0
|
网络协议 Linux 网络安全
Centos7中如何打开和关闭防火墙??CentOS 7以上默认使用firewall作为防火墙改为iptables
Centos7中如何打开和关闭防火墙??CentOS 7以上默认使用firewall作为防火墙改为iptables
|
网络协议 Linux 网络安全
CentOS 7 :Failed to start IPv4 firewall with iptables.
CentOS 7 :Failed to start IPv4 firewall with iptables.
353 0
|
NoSQL Linux 网络安全
CentOS使用iptables禁止某IP访问
CentOS使用iptables禁止某IP访问
750 0
|
Linux 网络安全
iptables防火墙限制 centos中有 firewalld selinux 还有 iptables
iptables防火墙限制 centos中有 firewalld selinux 还有 iptables
158 0
iptables防火墙限制 centos中有 firewalld selinux 还有 iptables
|
运维 安全 网络协议
Centos 运维之防火墙篇——①iptables
防火墙 一般来说,iptables和firewalld启用一个即可
363 0
|
Linux 网络安全
centOS7.3 安装启用 iptables 记录
iptables 执行规则时,是从从规则表中从上至下顺序执行的,如果没遇到匹配的规则,就一条一条往下执行,如果遇到匹配的规则后,那么就执行本规则
207 0
|
网络协议 Linux 网络安全
CentOS 7.2:Failed to start IPv4 firewall with iptables
CentOS 7.2:Failed to start IPv4 firewall with iptables
1144 0