linux下iptables配置模板
linux下iptables配置模板
# Flush all policy
iptables -F
iptables -X
iptables -Z
iptables -t nat -F
iptables -t nat -X
iptables -t nat -Z
iptables -t mangle -X
# Enable ip forward
echo "1" > /proc/sys/net/ipv4/ip_forward
# module
modprobe bridge
modprobe ip_tables
modprobe iptable_nat
modprobe ip_nat_ftp
modprobe ip_nat_irc
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_tftp
modprobe ip_conntrack_irc
modprobe ip_nat_tftp
modprobe ipt_recent
modprobe ipt_MASQUERADE
# Default policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# Enable lo interface
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# DNS lookup
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
iptables -A INPUT -p udp --sport 53 -j ACCEPT
# SSH Server
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
# icmp request
iptables -A INPUT -p icmp --icmp-type 8 -m limit --limit 1/s --limit-burst 10 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 0 -j ACCEPT
# icmp echo
iptables -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 0 -j ACCEPT
linux下iptables配置模板的更多相关文章
- linux下IPTABLES配置详解 (防火墙命令)
linux下IPTABLES配置详解 -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 24000 -j ACCEPT ...
- linux下IPTABLES配置详解(转)
如果你的IPTABLES基础知识还不了解,建议先去看看. 开始配置 我们来配置一个filter表的防火墙. (1)查看本机关于IPTABLES的设置情况 [root@tp ~]# iptables - ...
- linux下IPTABLES配置详解(转)
如果你的IPTABLES基础知识还不了解,建议先去看看.开始配置我们来配置一个filter表的防火墙.(1)查看本机关于IPTABLES的设置情况[ ~]# iptables -L -nChain I ...
- linux下IPTABLES配置
如果你的IPTABLES基础知识还不了解,建议先去看看. 开始配置 我们来配置一个filter表的防火墙. (1)查看本机关于IPTABLES的设置情况 [root@tp ~]# iptables - ...
- linux下IPTABLES配置详解
如果你的IPTABLES基础知识还不了解,建议先去看看. 开始配置 我们来配置一个filter表的防火墙. (1)查看本机关于IPTABLES的设置情况 [root@tp ~]# iptables - ...
- (转载)Linux下IPTABLES配置详解
(转载)http://www.cnblogs.com/JemBai/archive/2009/03/19/1416364.html 如果你的IPTABLES基础知识还不了解,建议先去看看. 开始配置 ...
- [转]linux下IPTABLES配置详解
如果你的IPTABLES基础知识还不了解,建议先去看看.开始配置我们来配置一个filter表的防火墙.(1)查看本机关于IPTABLES的设置情况[root@tp ~]# iptables -L -n ...
- CentOS下配置iptables防火墙 linux NAT(iptables)配置
CentOS下配置防火墙 配置nat转发服务CentOS下配置iptables防火墙 linux NAT(iptables)配置 CentOS下配置iptables 1,vim /etc/syscon ...
- 在linux下安装配置rabbitMQ详细教程
在linux下安装配置rabbitMQ详细教程 2017年12月20日 17:34:47 阅读数:7539 安装Erlang 由于RabbitMQ依赖Erlang, 所以需要先安装Erlang. Er ...
随机推荐
- Codeforces 903D Almost Difference
Codeforces 903D Almost Difference time limit per test 2 seconds memory limit per test 256 megabytes ...
- metasploit联动beef启动
(温馨提示:请按照步骤来,否则beef到后面会启动不了) 我们首先进入vim /usr/share/beef-xss/config.yaml 找到metasploit把它改为启动 把false改为tr ...
- java基础,集合,Arraylist,源码解析(基础)
ArrayList 是什么,定义? 这是动态的数组,它提供了动态的增加和减少元素,实现了List接口(List实现Collection,所以也实现Collection接口)灵活的设置数组的大小等好处 ...
- noip级别数论?
TAT快noip了才开始去接触数论(真心不敢学..)这里做一下整理吧(都是些定义之类的东西= =) 欧几里德:gcd(a,b)=gcd(b,a%b);具体证明见百科? 扩展欧几里德: 求a*x+b*y ...
- HttpClient 用于解决测试时候乱码的问题
@Test public void doPostWithParam() throws Exception, IOException { CloseableHttpClient httpClient = ...
- JXLS 2.4.0系列教程(六)番外篇——导出图片(完结)
突然想起来有同学说过能不能导出图片,本来我是想说不懂的,后来我上官网查了查,还挺容易.我就简短的写一写怎么导出图片. 官方提供了导出图片标签: jx:image(lastCell="D10& ...
- UEP-多任务
打开多任务 Function testTabTask(){ openTabTask(","多任务测试",$$pageContextPath+"/componen ...
- [国嵌攻略][077][Linux时间编程]
时间类型 Coordinated Universal Time(UTC):世界标准时间,也就是格林威治时间(Greenwich Mean Time, GMT). Calendar Time:日历时间, ...
- Javascript Array 非常用方法解析
在ECMAScript5的Array中已经有了Array.prototype.forEach,Array.prototype.filter,Array.prototype.map等方法 1. map ...
- ThinkPHP3.2 实现Mysql数据库备份
<?php header("Content-type:text/html;charset=utf-8"); //配置信息 $cfg_dbhost = 'localhost'; ...