iptables安装
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安装的更多相关文章
- Linux防火墙iptables安装配置--使用远程工具Xmanager和ftp服务安装配置
一.linux关闭防火墙: a.用户直接在终端输入:service iptables stop 查看防火墙状况:service iptables status b.root用户在终端输 ...
- CentOS7 iptables安装及操作
添加规则时的考量点: (1)要实现哪种功能:判断添加在哪张表上: (2)报文流经的路径:判断添加在哪个链上: 链上规则的次序: (1)同类规则(访问同一应用),匹配范围小的放上面: (2)不同类规则( ...
- centos下iptables安装
[root@localhost ~]# yum install iptables -y[root@localhost ~]# yum install iptables-services 查看安装情况 ...
- iptables安装失败后-------------firewalld回归
yum install firewalld systemctl stop iptables; systemctl mask iptables; systemctl unmask firewalld s ...
- CentOS7安装iptables防火墙
CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #先检查是否安装了iptables service iptables st ...
- entOS7安装iptables防火墙,试验未通过
CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #先检查是否安装了iptables service iptables st ...
- centos6.5 安装iptables
阿里云默认是没有安装iptables 安装 yum install -t iptables yum install iptables-services 检查iptables服务的状态 service ...
- CentOS 7安装iptables服务,以及常用命令
之前使用的是CentOS6.5,并且学艺不精,用啥查啥,用完就忘.并且网上大部分资料是基于CentOS7之前的版本. 在CentOS7中,默认的防火墙不是iptables,而是firewalld.而且 ...
- CentOS7安装配置iptables防火墙
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/50779761 CentOS7默认的防火墙不是iptables,而是firewall ...
随机推荐
- Pycharm问题:module 'pip' has no attribute 'main'
更新pip之后(pip 10 版本之后),Pycharm安装package出现报错:module 'pip' has no attribute 'main' 解决办法如下: 找到Pycharm安装目录 ...
- 第一章 初识Mysql
Mysql是一个开放源代码的数据库管理系统(DBMS),它是由MySQL AB 公司开发.发布并支持的. 登录 -- mysql #本地登录,默认用户root,空密码,用户为root@127.0.0. ...
- 【medium】990. Satisfiability of Equality Equations 并查集
Given an array equations of strings that represent relationships between variables, each string equa ...
- selenium打开Chrome浏览器并最大化
#打开Chrome浏览器并放大 from selenium import webdriver def BrowserOpen(): driver = webdriver.Chrome(); drive ...
- win10遇见的问题
所有问题的终极解决办法:系统重置 1.Windows PowerShell打不开,重装.net framework装不上 电脑系统为win10企业版,今天第n遍安装sql server 2017的时候 ...
- SpringCloud使用Feign调用其他客户端带参数的接口,传入参数为null或报错status 405 reading IndexService#del(Integer);
SpringCloud使用Feign调用其他客户端带参数的接口,传入参数为null或报错status 405 reading IndexService#del(Integer); 第一种方法: 如果你 ...
- 解决 DBMS_AW_EXP: BIN$*****==$0 not AW$
在Oracle 11.2.0.4 版本的数据库中,使用数据泵导出数据时,有可能会遇到这样的提示: 示例1 Connected to: Oracle Database 11g Enterprise Ed ...
- Echarts折线图案例
公司要求做个累计收益图,没用过Echarts,再这里记录一下 html页面 <!DOCTYPE html> <html> <head> <meta chars ...
- python全栈开发day117-MongoDB,pymongo
1.MongoDB操作 使用了不存在的对象即创建该对象 1.增加: 官方不推荐写法: insert([{},{},{}]) 官方推荐写法: insertOne({}) insertMany([{},{ ...
- 【原创】navicat for sqlite 11.1.12 patch 永久试用 不报毒
因为最近需要用这个但是网上都是注册机没有成功注册,所以就自己动手使用ollydbg开刀, 修改成了永久试用版本. 着急用所以没仔细分析,暂时先这样吧. 这个下载版本 http://dlsw.ba ...