1.安装iptable iptable-service

#先检查是否安装了iptables
service iptables status
#安装iptables
yum install -y iptables
#升级iptables
yum update iptables
#安装iptables-services
yum install iptables-services

2.禁用/停止自带的firewalld服务

systemctl stop firewalld.service && sudo systemctl disable firewalld.service

3.将iptables置为开机自启

chkconfig iptables on

4.iptables的常用命令

service iptables  start      #启动服务

service iptables  stop     #停止服务

service iptables  restart  #重启服务

service iptables  status     #重启服务

5.查看iptables规则

iptables -L -n

6.附上常用端口开放文档

# Generated by iptables-save v1.4.7 on Wed Jul 11 20:48:21 2018
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
# 上句之后添加的iptables无效
COMMIT
# Completed on Wed Jul 11 20:48:21 2018

iptables安装的更多相关文章

  1. Linux防火墙iptables安装配置--使用远程工具Xmanager和ftp服务安装配置

    一.linux关闭防火墙:    a.用户直接在终端输入:service iptables stop     查看防火墙状况:service iptables status  b.root用户在终端输 ...

  2. CentOS7 iptables安装及操作

    添加规则时的考量点: (1)要实现哪种功能:判断添加在哪张表上: (2)报文流经的路径:判断添加在哪个链上: 链上规则的次序: (1)同类规则(访问同一应用),匹配范围小的放上面: (2)不同类规则( ...

  3. centos下iptables安装

    [root@localhost ~]# yum install iptables -y[root@localhost ~]# yum install iptables-services 查看安装情况 ...

  4. iptables安装失败后-------------firewalld回归

    yum install firewalld systemctl stop iptables; systemctl mask iptables; systemctl unmask firewalld s ...

  5. CentOS7安装iptables防火墙

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

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

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

  7. centos6.5 安装iptables

    阿里云默认是没有安装iptables 安装 yum install -t iptables yum install iptables-services 检查iptables服务的状态 service ...

  8. CentOS 7安装iptables服务,以及常用命令

    之前使用的是CentOS6.5,并且学艺不精,用啥查啥,用完就忘.并且网上大部分资料是基于CentOS7之前的版本. 在CentOS7中,默认的防火墙不是iptables,而是firewalld.而且 ...

  9. CentOS7安装配置iptables防火墙

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

随机推荐

  1. 直流滤波器 verilog

    // dc filter- y(n) = c*x(n) + (1-c)*y(n-1) `timescale 1ps/1ps module ad_dcfilter #( // data path dis ...

  2. 具体分析UGUI中RectTransform

    一:RectTransform 组件 1.Transform 组件是所有的游戏物体必备的一个组件,且不可删除,不可隐藏.就算是一个空物体,也是具备 Transform 组件的. Unity3D4.6 ...

  3. Bootstrap-datepicker3官方文档中文翻译---Event/事件(原文链接 http://bootstrap-datepicker.readthedocs.io/en/latest/index.html)

    Events/事件 DatePicker在某些情况下触发一些事件.所有事件都拥有   传递给任何事件处理程序的  事件对象的    附加数据.(译者注:这里英语拗口,汉语也拗口,我用空格给大家断断句) ...

  4. bzoj 3261

    题目描述:这里 可持久化字典树裸题,可以作为模板使用 首先介绍一下可持久化字典树 可持久化字典树,顾名思义,就是一种可持久化的数据结构,常用于处理异或问题 我们看一下题目,发现要求一个最大异或和,但是 ...

  5. jdk7_ConcurrentHashMap 图示

    jdk7_ConcurrentHashMap初始化图示 jdk7_ConcurrentHashMap_put和get操作_扩容_线程安全的分析

  6. JpaManytoMany

    package com.allqj.calculator.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; i ...

  7. rpm和yum软件管理

    rpm简介 数据库管理工具,通过读取数据库,判断软件是否安装,如已安装可读取出来所有文件的所在位置等,并可以实现删除这些文件. rpm:RPM is Redhat Package Manager(递归 ...

  8. Debian+Django+uWsgi+nginx+mysql+celery

    下载系统各种依赖 nano /etc/apt/sources.list 在Debian中使用apt-get安装软件包时经常会提示让你插入netinst的光盘: Media change: please ...

  9. 简易promise的实现(二)

    code 上一章中我们遇到了两个问题 1.异步调用顺序的问题 2.then返回一个promise的问题 思考 如果控制异步回调的顺序? 因为异步操的时间作我们无法控制,但是我们只需要按顺序执行回调函数 ...

  10. 首次安装Ubuntu

    初试Ubuntu 双系统的安装 situation: dell(2017购) 固态250G+机械硬盘500G 已经安装windows 10 BIOS 为 UEFI rufus(向U盘写入镜像) Ubu ...