I see. However, that doesn’t actually simplify things. The point is I’m either in ipv4 mode or ipv6 mode and want to add the current address to either the ipv4 or ipv6 address list depending on which mode I’m in. Hence I wanted to put “/ip/firewall/address-list” or “/ipv6/firewall/address-list” into a variable (or similar) so that I could issue the appropriate one depending on which mode I’m in. It seem like I need to use that function so that I can send the mode to it and it has the if statement. I think I know what to do now, so thanks for your help.
Assuming is ROS v6 with IPv6 packet enabled, or v7, and just for teaching
because before add one address must be checked if the address is already present, or it do error and exit:
Automatic IP type detection with or without netmask (and also if is valid or not): On IPv6 do not support prefix/netmask