Is there a way to make my NAT settings automatically detect or change to my public IP?

I have several NAT rules to open up different network devices on my network. Phone server, file server etc.

However at the moment we have a dynamic IP from our ISP. Whenever theres a power cut or the MT is turned off it gets a new IP address from our ISP.

I am going to call them and try sort it out, it might be due to the fact we’re not connecting via PPPoE.

But I am just wondering is there a way to make it so, when the IP changes, I dont have to go in and manually change the NAT rules?

Here are my NAT rules. I have removed my public ip and put ‘MY.PUBLIC.IP.ADDRESS’ in place of it.

Whenever our public IP changes, that IP address thats in there is the old one so the rules don’t work correctly. When I change it to the new IP, everything works again okay.

/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
    ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat dst-address=192.168.88.0/24 src-address=\
    192.168.88.0/24
add action=dst-nat chain=dstnat comment="PRIVATE" dst-address=\
    MY.PUBLIC.IP.ADDRESS dst-port=PRIVATE protocol=udp to-addresses=192.168.88.27 \
    to-ports=PRIVATE
add action=dst-nat chain=dstnat comment="PRIVATE" dst-address=\
    MY.PUBLIC.IP.ADDRESS dst-port=PRIVATE protocol=tcp to-addresses=192.168.88.194 \
    to-ports=PRIVATE
add action=dst-nat chain=dstnat comment="PRIVATE" dst-address=\
    MY.PUBLIC.IP.ADDRESS dst-port=PRIVATE protocol=tcp to-addresses=192.168.88.27 \
    to-ports=PRIVATE
add action=dst-nat chain=dstnat comment="PRIVATE" dst-address=\
    MY.PUBLIC.IP.ADDRESS dst-port=PRIVATE protocol=tcp to-addresses=192.168.88.27 \
    to-ports=PRIVATE
add action=dst-nat chain=dstnat comment="PRIVATE" dst-address=\
    MY.PUBLIC.IP.ADDRESS dst-port=PRIVATE protocol=tcp to-addresses=192.168.88.27 \
    to-ports=PRIVATE
add action=dst-nat chain=dstnat comment="PRIVATE" dst-address=\
    MY.PUBLIC.IP.ADDRESS dst-port=PRIVATE protocol=tcp to-addresses=192.168.88.194 \
    to-ports=PRIVATE
add action=dst-nat chain=dstnat comment="PRIVATE" dst-address=MY.PUBLIC.IP.ADDRESS \
    dst-port=PRIVATE protocol=tcp to-addresses=192.168.88.30 to-ports=PRIVATE

Thanks

If your WAN uses dedicated interface (e.g. ether1, connected directly to ISP device, or PPPoE interface), then you can use in-interface= (or in-interface-list=WAN) instead of dst-address=WAN.IP.ADDRESS. Then dst-nat rules are not dependant on (changing) WAN IP address any more. However, this then complicates setup of hairpin NAT … but it’s not impossible.

The only time to use your WANIP address is if its a static WANIP.
As mkx noted, if your WANIp is dynamic the default rule is typically in-interface-list=WAN or in-interface=etherX.

Assuming you are in a hairpin nat scenario based on your second sourcenat rule, then your best bet is to use your iP cloud address.

/firewall address-list
add ipcloudname name=myWAN

Then the rules look like
add action=dst-nat chain=dstnat comment=“PRIVATE” dst-address-list=myWANP
dst-port=PRIVATE protocol=udp to-addresses=192.168.88.27
to-ports=PRIVATE

https://www.youtube.com/watch?v=_kw_bQyX-3U&t=257s
https://forum.mikrotik.com/viewtopic.php?t=179343