Pick IP From Route (add WAN to your WAN connection name. ie. ether1-WAN)
:global Stat [/ip route get [find gateway~“WAN”] pref-src]
Pick IP from Address (add WAN to your WAN connection name. ie. ether1-WAN)
:global OnEtherSub [/ip address get [find interface~“WAN”] address]
:global OnEther [:pick $OnEtherSub 0 [:find $OnEtherSub “/”]]
Pick IP from DHCP-Client (add WAN to your WAN connection name. ie. ether1-WAN)
:global OnEtherSub [/ip dhcp-client get [find interface~“WAN”] address]
:global OnEther [:pick $OnEtherSub 0 [:find $OnEtherSub “/”]]
Get Public IP from IP Cloud
:global ipCloud [/ip cloud get public-address]