×

RouterOS NAT端口隐射IP地址更拨号地址变化

chen chen 发表于2021-07-27 22:32:58 浏览555 评论0

抢沙发发表评论

:global dstlast [/ip cloud get public-address ]
:global dstcurr [/ip firewall nat get [find comment="dnat1"] dst-address ]
:if ($dstlast != $dstcurr ) do={
   :log info ("*** dnat IP address $dstlast updat ***")
   /ip firewall nat set [/ip firewall nat find comment="dnat1"] dst-address=$dstlast 
   /ip firewall nat set [/ip firewall nat find comment="dnat2"] dst-address=$dstlast 
   /ip firewall nat set [/ip firewall nat find comment="dnat3"] dst-address=$dstlast 
   /ip firewall nat set [/ip firewall nat find comment="dnat4"] dst-address=$dstlast 
/////dnat1 2 3 4  这些名字


群贤毕至

访客