Community discussions

MUM Europe 2020
 
User avatar
Edoras
newbie
Topic Author
Posts: 32
Joined: Wed Apr 05, 2006 12:03 am
Location: Prague, Czech rep.

get IP ADDRESSES on interface

Tue Jun 20, 2017 1:36 pm

I want to use IP of interface in my script. I get IP address by command
:global addr [/ip address get [find interface="bridge1"] address]
If on the interface is just one IP, it works. But when on the interface are two or more IPs, it displays error message "invalid internal item number" . Any ideas?

Thanks, Jiri
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5956
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: get IP ADDRESSES on interface

Tue Jun 20, 2017 1:39 pm

because it will return an array of all address IDs on that interface.
Run loop through the array to get individual ids.

Who is online

Users browsing this forum: Kazek and 16 guests