: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 这些名字