ROS动态ADSL的端口映射与回流图文教程

/ip fi nat
/add action=masquerade chain=srcnat comment=”" disabled=no out-interface=pppoe-out1
/add action=dst-nat chain=dstnat comment=web disabled=no dst-address=122.231.75.27 dst-address-type=local dst-port=80?protocol=tcp to-addresses=192.168.100.250 to-ports=80
/add action=masquerade chain=srcnat comment=”回流” disabled=no out-interface=LAN src-address=192.168.100.0/24

ROS动态ADSL的端口映射与回流图文教程

ROS动态ADSL的端口映射与回流图文教程

ROS动态ADSL的端口映射与回流图文教程

ROS动态ADSL的端口映射与回流图文教程

ROS动态ADSL的端口映射与回流图文教程

ROS动态ADSL的端口映射与回流图文教程


 

:global ip [ /ip address get [/ip address find interface=pppoe-out1] address ]
:global newip [:pick $ip 0 [:find $ip "/">
:global oldip [/ip fi nat get [/ip fi nat find comment="web"] dst-address]
:if ($newip != $oldip) do={
:log info [/ip fi nat set [/ip firewall nat find comment="web"] dst-address=$newip]
:log info “〖adsl映射修改完毕〗”
}


 

另类方法脚本

ROS Adsl 端口映射 

/ip firewall nat
add chain=dstnat in-interface=pppoe-WAN1 protocol=tcp dst-port=8000 action=dst-nat \
   to-addresses=192.168.0.2 to-ports=80 \
   comment="测试ADSL端口映射--用户发出请求" disabled=no
add chain=srcnat out-interface=pppoe-WAN1 src-address=192.168.0.2 protocol=tcp \
   src-port=80 action=masquerade comment="测试ADSL端口映射--服务器回应" \
   disabled=no