Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7043175
  • 博文数量: 3857
  • 博客积分: 6409
  • 博客等级: 准将
  • 技术积分: 15948
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 16:48
个人简介

迷彩 潜伏 隐蔽 伪装

文章分类

全部博文(3857)

文章存档

2017年(5)

2016年(63)

2015年(927)

2014年(677)

2013年(807)

2012年(1241)

2011年(67)

2010年(7)

2009年(36)

2008年(28)

分类:

2012-07-23 20:44:30

原文地址:iptables 路由转发应用 作者:asteriskchina

=======外网访问内网 –J DNAT=====

DNAT
only valid in PREROUTING
--to-destination ipaddr[-ipaddr][:port-port]
DNAT:目的网络地址转换,重写包的目的IP地址
典型的DNAT的例子
外部访问ip:192.168.1.2
内部转发ip:192.168.1.1

#清除预定表filter中,所有规则链中的规则
iptables -F
#清除预定表filter中,使用者自定链中的规则
iptables -X

#清除预定表mangle中,所有规则链中的规则
iptables -F -t mangle
#清除预定表mangle中,使用者自定链中的规则
iptables -X -t mangle

#清除nat表中的规则
iptables -F -t nat
iptables -X -t nat
iptables -Z -t nat

//设置全部接受
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

iptables -t nat -A PREROUTING -d 192.168.1.2 -p tcp --dport 21 -j DNAT --to 192.168.1.1
iptables -t nat -A PREROUTING -d 192.168.1.2 -p tcp --dport 80 -j DNAT --to 192.168.1.1
阅读(944) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~