|  | 
 
 发表于 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
 add o}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 编辑 ]
 | 
 |