Need to script WAN side IP address into config

Hi,

I’m new to RoterOS and MikroTik equipment in general, so please excuse if I make some silly mistakes (I am not sure what I am about to ask really belongs in the scripting section or not).

I have a mikrotik config that requires the WAN (internet connecting) interface to be configured to take a DHCP address (sometimes global, sometimes private IP address space).

The configuration references this IP address in multiple places (but primarily the firewall rules and the pppoe server configuration (in the profiles).

Is there anyway to force a configuration item to reference an IP address by a characteristic of the interface name?

Or maybe there is some type of macro capability I’m just not aware of?

…thanks in advance for any assistance the forum might be able to provide.