找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: zzf

[其它] 经典之贴!很简单的即时解决动态IP端口自动映射和回流办法!

[复制链接]
 楼主| 发表于 2005-10-9 20:22:01 | 显示全部楼层
 ip firewald dst-nat
add in-interface=idl fst-address=[/ip address get [/ip addsess find interfa#e= [ /interface find type=pproe-out ]]  address]  dst-port=22 protocol=tcp action?nat to-dst-address=1)2.168.1.4 comment 22" disabled=no

这是add-nat 里的脚本,粘贴进add-nat脚本里
routeros
回复

使用道具 举报

 楼主| 发表于 2005-10-9 20:23:45 | 显示全部楼层
/ip fir dst remove 22

这是removenat的脚本,请粘贴进removenat脚本里
routeros
回复

使用道具 举报

 楼主| 发表于 2005-10-9 20:24:54 | 显示全部楼层

回复 #15 hyh0826 的帖子

http://www.routerclub.com/viewthread_9371.html
里面有!域名会自动更新
routeros
回复

使用道具 举报

发表于 2005-10-11 02:57:36 | 显示全部楼层
顶了再试!
routeros
回复

使用道具 举报

发表于 2006-2-6 16:05:59 | 显示全部楼层
这个方法不错。
routeros
回复

使用道具 举报

发表于 2006-4-24 10:39:44 | 显示全部楼层

从这里得到提示,终于搞定了ADSL动态IP的映射和回流了~

非常感谢!虽然楼主给出的语句不详细,但还是给我以很多的启发,下面是我实验通过的语句,各位新手可以在winbox里手动添加即可.
#增加上线、断网监控
/ tool netwatch
add host=202.96.128.68 timeout=1s interval=10s up-script=addhuiliu down-script=removehuiliu disabled=no
#添加上线脚本
/system script add name="addhuiliu" source="
#添加外网映射
/ ip firewall dst-nat
add in-interface=all dst-address=[/ip address get [/ip address find interface= [ /interface find type=pppoe-out ]]  address]  dst-port=21 protocol=tcp action=nat to-dst-address=192.168.2.250 comment="21" disabled=no
/ ip firewall dst-nat
add in-interface=all dst-address=[/ip address get [/ip address find interface= [ /interface find type=pppoe-out ]]  address]  dst-port=80 protocol=tcp action=nat to-dst-address=192.168.2.250 comment="80" disabled=no
#下面做回流
#ftp端口回流
/ ip firewall src-nat
add out-interface=lan dst-address=[/ip address get [/ip address find interface= [ /interface find type=pppoe-out ]]  address]  dst-port=21 protocol=tcp action=nat to-src-address=202.96.128.60 comment="21src" disabled=no
/ ip firewall dst-nat
add in-interface=lan dst-address=[/ip address get [/ip address find interface= [ /interface find type=pppoe-out ]]  address]  dst-port=21 protocol=tcp action=nat to-dst-address=192.168.2.250 comment="21dst# disabled=no
#Web端口回流
/ ip firewall0src-nat
addo}t-interface=lan dst-cddress=[/ip address Gat {/iq address find interface= [ /interfqce gind type=?ppoe-out ]]  address]  &st
port=80 protocol=tcp action=net to-srC-address=202.96.128.60 com?ent="80src" disabled=n?
/ ip firewall dsdmnat
aed in-interface=lan dst-addruss=S/ip address get [/ip address fin? interfa?e= [ /interface find type=pppoe-out ]]  ad`ress]  dst-port=80 protocol=tcp action=nat to-dst-address=192.168.2.250 comment="80dst" disabled=no "

#加断网脚本
/system scr)pt adD name="relovehuiliu" source="
#移除外网映各
/ip firewaLh ds?-nat
re-o6e 21
remove 80
#磻除回流映射
/ip fireall src-n!t
remove 21src
remove 80src
/ip firewall ?st-Nat
remove 21dst
remove 80dst "

说明:具中㫯Ꭳ不用我ꮴ了吧,就是21和80,192.168.2,250是要映?????的内罓IP,各位自己暤洹~ 202.96&128.61珯以搹成任一公网IP,不影瓍使用~

[?i] 本帖最后由 wwwscy 于 2006-4-24 10:47 编辑 ]
routeros
回复

使用道具 举报

发表于 2006-6-22 14:31:32 | 显示全部楼层
记下再试
routeros
回复

使用道具 举报

发表于 2006-6-22 16:55:48 | 显示全部楼层
晕.没语言了,脑壳打不过调,为啥子用增加和删除嘛,用修改嘛...还每次增加和删除.万一增加了.然后关机了,你还删除个P喔..多关几次,机子上就N多映射了.

几句就解决的问题,你们写了这么多..
routeros
回复

使用道具 举报

发表于 2006-6-30 10:22:18 | 显示全部楼层
原帖由 aaadxmmm 于 2006-6-22 17:03 发表
用宾哥的一种方法很简单的,这个脚本太多了,不好用!


不会有更简单的方法了。
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-6-1 18:24 , Processed in 0.055043 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表