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