centos-iptables-scripts
author:headsen chen
date:2018-06-04 11:20:38
notice:This article is created by headsen chen himself and not allowed to copy.or you will count law questions.
#启动
service iptables start
chkconfig iptables on
情况原先的规则
iptables -F #允许特定网段和地址访问
iptables -I INPUT -s 192.168.1.0/24 -j ACCEPT
iptables -I INPUT -s 121.23.45.146 -j ACCEPT iptables -I INPUT -p tcp -s 121.23.45.146 --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -s 10.0.0.0/16 --dport 22 -j ACCEPT #内部回环口
iptables -I OUTPUT -o eth0 -j ACCEPT
iptables -I INPUT -i lo -j ACCEPT #默认规则
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP #允许httpd服务过来访问
iptables -A INPUT -p tcp --dport 80 -j ACCEPT #允许ping服务
iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT #允许长连接访问(必须是tcp和udp及其他协议都允许的,否则光tcp则不行,yum都无法运行!!!)
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT #限制某个单独ip访问
iptables -I INPUT -p tcp -s 146.56.32.147 --dport 80 -j DROP #保存防火墙:
service iptables save
iptables-save >/bb.txt
centos-iptables-scripts的更多相关文章
- mac pfctl / centos iptables 使用
mac使用pfctl 为了测试zk client的重连功能,需要模拟zk client与zk server网络连接出现问题的情况,经过查询资料发现可以使用防火墙阻止zk server启动端口上的流量实 ...
- Centos iptables防火墙关闭启动详解
CentOS .0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 .直接关闭防火墙 systemctl stop firewalld.service #停止firewal ...
- CentOS iptables防火墙的基本应用讲解
iptables是Linux下不错的防火墙软件,本文主要给大家介绍下iptables的安装.规则增加和清除.开放指定端口.屏蔽指定ip和ip段等CentOS下iptables的基本应用. 一.ipta ...
- centos iptables
1.查看本机关于IPTABLES的设置情况iptables -L -niptables --listmore /etc/sysconfig/iptablesservice iptables statu ...
- [daily][centos][iptables][firewalld] firewalld的初步了解
CentOS7中默认使用firewalld代替了iptables . 接下来将对firewalld, 做一些初步的了解. 首先读一下, redhat的文档: https://access.redhat ...
- 【服务器防护】centos iptables 防火墙设置 mac过滤
1.阻止MAC地址为XX:XX:XX:XX:XX:XX主机的所有通信: iptables -A INPUT -s 192.168.1.21 -m mac --mac-source XX:XX:XX:X ...
- centos IPTables 配置方法
entos IPTables 配置方法 http://os.51cto.com/art/201103/249359_1.htm iptables 指南 1.1.19 http://www.frozen ...
- Centos iptables防火墙设置
iptables的基本语法格式 iptables [-t 表名] 命令选项 [链名] [条件匹配] [-j 目标动作或跳转]说明:表名.链名用于指定iptables命令所操作的表和链,命令选项用于指定 ...
- centos iptables关于ping
配置iptables策略后,一般来说INPUT都是DROP然后配置需要通过的 当执行: iptables -P INPUT DROP 后,机器就不能被ping通了! 因为icmp没有添加到规则中! 于 ...
- centos iptables 数据转发
iptables -t nat -I PREROUTING -p tcp --dport 3389 -j DNAT --to 38.X25.X.X02 iptables -t nat -I POSTR ...
随机推荐
- ItelliJ项目打jar包
不是Eclipse里方便的export...了. 一.配置 . 点击View->Open Module Settings(快捷键是F4) . 在弹出的对话框中,点击最左侧树的Artifacts ...
- jenkins + jacoco 单元测试覆盖率
1.新建一个maven工程,在src/main/java 下建一个CoverageTest.java 类 package test_junit; public class CoverageTest { ...
- 禁止apache显示目录索引 apache禁止列目录
禁止Apache显示目录索引的常见的3种方法. 要实现禁止Apache显示目录索引,只需将Option中的Indexes去掉即可. 禁止Apache显示目录索引,禁止Apache显示目录结构列表,禁止 ...
- 异步FIFO的FPGA实现
本文大部分内容来自Clifford E. Cummings的<Simulation and Synthesis Techniques for Asynchronous FIFO Design&g ...
- nginx 反向代理 配置 https 实现http https同时存在 经测试 支持location 规则
server { listen ssl; #监听443端口 server_name www.app01.com; ssl on; #启用ssl加密 ssl_certificate /etc/cert/ ...
- CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙
CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙 时间:2014-10-13 19:03:48 作者:哎丫丫 来源:哎丫丫数码网 查看:11761 评论:2 ...
- linux中录屏工具byzanz
linux中录屏工具byzanz: 1.安装 sudo apt install byzanz 2.使用 help:byzanz-record --help 配合xwininfo使用--xwininfo ...
- vuex 定义
vuex是什么? vuex是一个专为vue.js应用程序开发的状态管理模式,它采用集中式存储管理应用的所有组件的状态,并以相应的规则保证状态以一种可预测的方式发生变化.Vuex也集成到vue的官方调试 ...
- excel鼠标拖选慢shift选择快的问题
今天遇到个惊天大坑,关于excel的,最近,一直在调查这个东西,刚开始真的是毫无头绪,反正现在就是excel的值的copy会偶尔慢,慢的情况也是不明白,就是稀里糊涂的调查. 刚开始连100%再现这个b ...
- XML-RPC使用手册
内容列表 Preface: About This Manual Introduction to XML-RPC for C/C++ What is XML-RPC? How Does XML-RPC ...