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. springboot整合springdata-jpa

    1.简介  SpringData : Spring 的一个子项目.用于简化数据库访问,支持NoSQL 和 关系数据存储.其主要目标是使数据库的访问变得方便快捷. SpringData 项目所支持 No ...

  2. 2018-2019-2 网络对抗技术 20165231 Exp3 免杀原理与实践

    实践内容(3.5分) 1.1 正确使用msf编码器(0.5分),msfvenom生成如jar之类的其他文件(0.5分),veil-evasion(0.5分),加壳工具(0.5分),使用shellcod ...

  3. openssl 1.1.1 reference

    openssl 1.1.1 include/openssl aes.h: # define HEADER_AES_H aes.h: # define AES_ENCRYPT 1 aes.h: # de ...

  4. Nginx:Linux下安装Nginx与配置

    准备目录 [root@sijizhen ~]# mkdir /usr/local/nginx [root@sijizhen ~]# cd /usr/local/nginx/ 下载 1.Nginx,在h ...

  5. Java入门细则

    (一)一个完整的Java.源程序应该包括下列部分:  package语句,该部分至多只有一句,必须放在源程序的第一句.  import语句,该部分可以有若干import语句或者没有,必须放在所有的类定 ...

  6. Percona 5.7.13 已经发布

    Percona 5.7.13 已经正式发布,需要的人士可以去官方网站下载 https://www.percona.com/downloads/Percona-Server-5.7/Percona-Se ...

  7. 项目中的Git七步精髓

    项目中Git常用的七步操作: 1.git branch -a  查看所有分支 2.git checkout dev_yxq 如果冲突了,操作回退上一个版本, git status git checko ...

  8. 在django中uwsgi的使用,以及安装

    首先了解wsgi是一个python web服务器,uwsgi实现了wsgi所有的功能,性能稳定,效率高的服务器: 1.安装uwsgi pip install uwsgi 2.配置uwsgi [uwsg ...

  9. 2-2、安装Filebeat

    安装filebeat 第1步:安装Filebeat 开始之前:如果尚未安装Elastic Stack,请立即执行此操作. 请参阅Getting started with the Elastic Sta ...

  10. HttpClient不必每次新建实例而RestSharp推荐新建实例的原因

    https://stackoverflow.com/questions/49588205/should-restclient-be-singleton-or-new-for-every-request ...