摘要

CentOS 7.0默认使用的是firewall作为防火墙,如果改为iptables防火墙,如何操作?

关闭firewall:

systemctl stop firewalld.service 
systemctl disable firewalld.service 
systemctl mask firewalld.service

安装iptables防火墙

yum install iptables-services -y

启动设置防火墙

systemctl enable iptables
systemctl start iptables

查看防火墙状态

systemctl status iptables

启动设置防火墙

vi /etc/sysconfig/iptables #编辑防火墙配置文件
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
:wq! #保存退出

重启配置,重启系统

systemctl restart iptables.service #重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动

参考文章

http://blog.csdn.net/zhldt2008/article/details/52626892

[CentOs7]iptables防火墙安装与设置的更多相关文章

  1. CentOS7.3编译安装Nginx设置开机启动

    起因 最近想玩nginx了,本来用yum -y install nginx安装也启动好了,但是买了本<Nginx高性能Web服务器详解>,我咋能辜负我的书费呢?于是我就直接ps -ef | ...

  2. CentOS7安装iptables防火墙

    CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #先检查是否安装了iptables service iptables st ...

  3. CentOS7安装配置iptables防火墙

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/50779761 CentOS7默认的防火墙不是iptables,而是firewall ...

  4. CentOS之——CentOS7安装iptables防火墙

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/50779761 CentOS7默认的防火墙不是iptables,而是firewall ...

  5. Centos7下安装iptables防火墙

    说明:centos7默认使用的firewalld防火墙,由于习惯使用iptables做防火墙,所以在安装好centos7系统后,会将默认的firewall关闭,并另安装iptables进行防火墙规则设 ...

  6. entOS7安装iptables防火墙,试验未通过

    CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #先检查是否安装了iptables service iptables st ...

  7. centos 7 安装iptables防火墙

    firewalle: 开启6379端口和16379端口 [root@localhost ~]# firewall-cmd --zone=public --add-port=6379/tcp --per ...

  8. CentOs7 使用iptables防火墙开启关闭端口

    CentOs7 使用iptables防火墙开启关闭端口   # 0x01介绍 iptables命令是Linux上常用的防火墙软件,是netfilter项目的一部分iptables文件设置路径:命令:v ...

  9. 网卡配置文件详解 用户管理与文件权限篇 文件与目录权限 软连接 tar解压命令 killall命令 linux防火墙 dns解析设置 计划任务crond服务 软件包安装 阿里云 yum源 安装

    Linux系统基础优化及常用命令 Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ...

随机推荐

  1. perl sub

    #/usr/bin/perl -w use strict; my $usage = "\n\nusage: $0 <length>\n\n"; my $length = ...

  2. Spark MLib 数据类型

    1.  MLlib Apache Spark's scalable machine learning library, with APIs in Java, Scala and Python. 2. ...

  3. Leetcode Odd Even Linked List

    Given a singly linked list, group all odd nodes together followed by the even nodes. Please note her ...

  4. 【BZOJ-3437】小P的牧场 DP + 斜率优化

    3437: 小P的牧场 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 705  Solved: 404[Submit][Status][Discuss ...

  5. JQuery冲突问题,以及含有jquery的框架与jquery冲突

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  6. 【poj3615】 Cow Hurdles

    http://poj.org/problem?id=3615 (题目链接) 题意 给出一张有向图,求从u到v最大边最小的路径的最大边.→_→不会说话了.. Solution 好久没写Floyd了,水一 ...

  7. struts2 CVE-2013-1965 S2-012 Showcase app vulnerability allows remote command execution

    catalog . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch Fix 1 ...

  8. Guava的异常工具类--Throwables

    Guava为我们提供了一个非常方便并且实用的异常处理工具类:Throwables类. 这个类的API可以参见:http://docs.guava-libraries.googlecode.com/gi ...

  9. Java内存回收机制

    在Java中,它的内存管理包括两方面:内存分配(创建Java对象的时候)和内存回收,这两方面工作都是由JVM自动完成的,降低了Java程序员的学习难度,避免了像C/C++直接操作内存的危险.但是,也正 ...

  10. vs 2012 + OPenCV 2.4.8 配置

    一:安装Opencv 下载opencv-2.4.8.exe,然后安装在目录D:\opencv-2.4.8. 二:配置vs 2012 1.打开vs创建项目 2.下一步,选择dll ,空项目,然后完成.后 ...