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 ...
随机推荐
- 搜狐畅游CEO王滔辞职
凤凰科技讯 11月3日消息,搜狐公布公告确认搜狐畅游CEO离职.公告称王滔因个人原因辞去畅游首席运行官职务.将继续担任畅游公司董事和首席产品官. 据搜狐公告,董事会任命搜狐总裁余楚媛与畅游总裁陈德文为 ...
- Netty(四):粘包问题描述及解决
拆包粘包问题解决 netty使用tcp/ip协议传输数据.而tcp/ip协议是类似水流一样的数据传输方式.多次访问的时候有可能出现数据粘包的问题,解决这种问题的方式如下: 1 定长数据流 客户端和服务 ...
- Atitit. 最佳实践 QA----降低cpu占有率--cpu占用太高怎么办
Atitit. 最佳实践 QA----降低cpu占有率--cpu占用太高怎么办 跟个磁盘队列长度雅十,一到李80%走不行兰.... 1. 寻找线程too 多的.关闭... Taskman>> ...
- alloc retain release函数
- Qcon2017实录|Service Mesh:下一代微服务
https://zhuanlan.zhihu.com/p/30292372 数人云11月Meetup报名开启,看中西方大神如何论道云原生与微服务!本文作者敖小剑老师将在本次Meetup上继续分享Ser ...
- sass 的使用心得
//定义颜色 $c55:#; $c22:#; $c33:#; $c99:#; $c77:#; $c00:#; $cff:#fff; $caa:#aaa; $ccc:#ccc; $cf0:#f0f0f0 ...
- 插入节点appendChild()
http://www.imooc.com/code/1698 插入节点appendChild() 在指定节点的最后一个子节点列表之后添加一个新的子节点. 语法: appendChild(newnode ...
- 基于Redis实现延时队列服务
背景 在业务发展过程中,会出现一些需要延时处理的场景,比如: a.订单下单之后超过30分钟用户未支付,需要取消订单 b.订单一些评论,如果48h用户未对商家评论,系统会自动产生一条默认评论 c.点我达 ...
- MySQL 找回密码
Windows: 1.关闭正在运行的MySQL. 2.打开DOS窗口,转到mysql\bin目录. 3.输入mysqld --skip-grant-tables回车.如果没有出现提示信息,那就对了. ...
- rsync详解之exclude排除文件
rsync详解之exclude排除文件 问题:如何避开同步指定的文件夹? --excludersync --exclude files and folders http://articles.sl ...