Reply
Accepted Solution

Find MAC address

grzybek
Techie
Posts: 3
3323     2
Hi, I need the script to check if the specific fixed mac address is already in the system ( in all networks). How can I do it using CURL or even Python script ? I tested a little bit curl examples but with networks and attributes, but can't find solution for mac address. Regards, grzybek

Re: Find MAC address

GHorne Community Manager
Community Manager
Posts: 254
3323     2

MAC addresses aren't in networks, not strictly speaking. 

They are attached to other objects, so you will need to search for those instead.

 

There are (at least) 3 possible places a MAC address could be:

 - in a fixed address

 - in a Host

 - in a MAC filter

 

You will need to search each of those. 

 

If you want to know a MAC-network association, searching fixedaddresses will be the best bet.

 

 

Re: Find MAC address

grzybek
Techie
Posts: 3
3323     2
Thank you for a fast reply. I've found fixedaddresses before but I couldn't use it. Could you give me an example how to use it ? Can I search it in all system ? Regards, grzybek
Highlighted

Re: Find MAC address

Adviser
Posts: 93
3323     2

This Curl example will return all fixed addresses that match the given mac address.  The matches can be an exact (using =) or can be a regular expression match (using ~=, as in my example, all addresses that start with the match).

 

 

curl -k -u admin:infoblox -X GET 'https://192.168.1.2/wapi/v2.3/fixedaddress' -d 'mac~=^11:22:33:44:' -d '_return_fields=ipv4addr,mac'

 

This curl example will return all objects with a specific mac address, incuding fixes addresses, DHCP leases, host addresses, filters, etc.  This one is an exact match search only, we cannot use regular expressions.

 

 

curl -k1 -u admin:infoblox -X GET  'https://192.168.1.2/wapi/v2.3/search' -d 'mac_address=11:22:33:44:55:66'

 

 

Re: Find MAC address

grzybek
Techie
Posts: 3
3324     2
Hi, Thank you very much Smiley Happy It is what I wanted. Best Regards, grzybek
Showing results for 
Search instead for 
Do you mean 

Recommended for You