一、防火墙iptables 简洁介绍

iptables 和 firewalld 都是工作在用户空间、用来定义规则的工具,本身不是防火墙,他们定义的规则,可以让内核空间当中的netfilter读取,并且实现防火墙工作。

netfilter是操作系统核心层内部的一个数据包处理模块,它具有如下功能:

  1.网络地址转换 nat

  2.数据包内容修改 mangle

  3.数据包过滤的防火墙功能 filter  

centos7.2  默认使用firewalld ;iptables默认无法被systemctl控制,需要按照iptables-services、iptables-devel这两个依赖包

二、将firewalld切换到 iptables

1. 停止并禁用 firewalld

sudo systemctl stop firewald.service && sudo systemctl disable firewald.service

2.安装iptables-services、iptables-devel

sudo yum install iptables-services iptables-devel

3.启用并启动iptables

sudo systemctl enable iptables.service && sudo systemctl start iptables.service

4.查看iptables配置文件

sudo vim /etc/sysconfig/iptables

5.开启转发功能

(1) 在 /etc/sysctl.conf 中添加 net.ipv4.ip_forward=1

(2) sudo sysctl -p 同步内核参数

(3) 继续查看内核参数 less /proc/sys/net/ipv4/ip_forward  如果为1 则配置生效

Centos7.2 启用iptables的更多相关文章

  1. Centos7防火墙关闭和启用iptables操作

    https://yq.aliyun.com/ziliao/33590前序 还是docker惹得最近做的系统都是上的centos7的系统带来的一系列的新环境的适应 补记下:在使用oracle vmbox ...

  2. centos7 启用iptables

    在centos 7下启用iptables systemctl stop firewalld.service systemctl disable firewalld.service yum instal ...

  3. vsftp被动模式启用iptables访问设置

    vsftpd服务搭建好之后,如果是使用主动模式访问.那么启用iptables只需添加以下规则即可: -A RH-Firewall-1-INPUT -m state --state NEW -m tcp ...

  4. 玩转Linux之- CentOS 7.0,启用iptables防火墙

    原文 玩转Linux之- CentOS 7.0,启用iptables防火墙 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall:sy ...

  5. centos7上安装iptables

    centos7上安装iptables的步骤 注意:CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #安装iptables ...

  6. Centos7 防火墙关闭和启用iptables防火墙

    操作系统环境:CentOS Linux release 7.0.1406(Core) 64位CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭f ...

  7. CentOS7关闭默认防火墙启用iptables防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭firewall: systemctl stop firewalld.service #停止f ...

  8. centos7关闭默认firewall,启用iptables

    CentOS 7.0默认使用"firewall"防火墙 一:关闭firewall1.直接关闭防火墙systemctl stop firewalld.service 2.禁止fire ...

  9. centos7下部署iptables环境纪录(关闭默认的firewalle)(转)

    下面介绍centos7关闭firewall安装iptables,并且开启80端口.3306端口的操作记录:[root@localhost ~]# cat /etc/redhat-release Cen ...

随机推荐

  1. Hadoop的介绍、搭建、环境

    HADOOP背景介绍 1.1Hadoop产生背景 HADOOP最早起源于Nutch.Nutch的设计目标是构建一个大型的全网搜索引擎,包括网页抓取.索引.查询等功能,但随着抓取网页数量的增加,遇到了严 ...

  2. HDOJ2008-数值统计

    Problem Description 统计给定的n个数中,负数.零和正数的个数.   Input 输入数据有多组,每组占一行,每行的第一个数是整数n(n<100),表示需要统计的数值的个数,然 ...

  3. jsp 重定向技术

    页面重定向之后,request对象的属性全部失效,生成一个新的requeset对象

  4. IDEA 2017注册码破解方法(转)

    进入ide主页面,help-register-license server,然后输入 http://idea.iteblog.com/key.PHP(注意:php要小写)即可~ 如下图: 点击 Act ...

  5. Mybatis框架分析

    摘要 本篇文章只是个人阅读mybatis源码总结的经验或者个人理解mybatis的基本轮廓,作为抛砖引玉的功能,希望对你有帮助,如果需要深入了解细节还需亲自去阅读源码. mybatis基本架构 myb ...

  6. Linux服务器中安装Oracle

    笔者手动安装成功 一,oracle安装前的准备与配置 1,修改stsctl.conf文件 Linux是为小文件设计的,Oracle数据库安装需要占用较多资源,要把各项参数调大. 使用vi编辑/etc/ ...

  7. [补档]暑假集训D4总结

    考试 爆零了,不开心,打了两道自己以为是正解的东西,打了两道样例骗分,结果发现并没有给样例分= =,自己以为的正解也打挂了,所以就很= = 但是没办法啊,自己弱也不能怪谁,考试这东西有时候也很玄学. ...

  8. Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.

    我用String代替了链表显示,本题的大意是每k个进行逆序处理,剩下的不够k个的就按照原顺序保留下来. public class ReverseNodes { public static void m ...

  9. Alluxio 1.5集群搭建

    一.依赖文件安装 1.1 JDK 参见博文:http://www.cnblogs.com/liugh/p/6623530.html 二.文件准备 2.1 文件名称 alluxio-1.5.0-hado ...

  10. NYOJ--STL--擅长排列的小明(强大的string :: iterator 和next_permutation)

    NYOJ--STL--擅长排列的小明 #include <iostream> #include <string> #include <algorithm> usin ...