Reply

Obtain IP through MAC

Not applicable
Posts: 1
3859     0

Hello,

How can I obtain de IP through a search of MAC ?

I obtain the MAC through a search of IP with:

curl -k -u userSmiley Tonguewd -X GET https://ip_infoblox/wapi/v1.0/ipv4address?ip_address=[ip_to_search]

But for obtain de IP I prove:

curl -k -u userSmiley Tonguewd -X GET https://ip_infoblox/wapi/v1.0/ipv4address?mac_address=[mac_to_search]

or

curl -k -u userSmiley Tonguewd -X GET https://ip_infoblox/wapi/v1.0/ipv4address?mac=[mac_to_search]

or

curl -k -u userSmiley Tonguewd -X GET https://ip_infoblox/wapi/v1.0/macfilteraddress?mac=[mac_to_search]

But I find nothing.

So, How can I do for search specific MAC?

 

Thanks,

Ruben

 

I'm not really familiar with

Authority
Posts: 39
3859     0

I'm not really familiar with the WAPI but I have found this when only the MAC address is searched :

{ "Error": "AdmConDataError: None (IBDataError: IB.Data:Search fields must contain a parent member or network view.)", 
  "code": "Client.Ibap.Data", 
  "text": "Search fields must contain a parent member or network view."
}

 

When I add '&network_view=default' (as indicated by the error message) the search works. It also returns results if you specify the network.

I would also suggest in using ':=' instead of '=' when searching on mac_address as the search becomes case insensitive.

 

Obtain IP through MAC

Member
Posts: 1
3859     0

Ruben,

I notice that you're running Version 1 of the WAPI.  I don't think that there's a way to search by MAC address in that version.  I've been trying to do the same thing and IB support says that I need to upgrade NIOS to get the WAPI version up to 1.2.1 to do this.  Until then, I have to use the perl API.

Infoblox sent to me this procedure that would work if you're at WAPI v1.2.1:

FIRST:
                Figure out what MAC (in the example below) or IP you want data on.
 
SECOND:
                Search for the lease for that particular device (I’m using the MAC address) as follows:
 
                WAPI
 
•         curl -k3 -c cookie.txt -b cookie.txt -X GET https://192.168.0.121/wapi/v1.2.1/search -d objtype=lease -d search_string:=F8:1ESmiley Very HappyFSmiley Very HappyA:4DSmiley Very HappyF
 
                RESULTS
 
[
    {
        "_ref": "lease/ZG5zLmxlYXNlJDAvMTkyLjE2OC4xLjg5LzAv:192.168.1.89/default",
        "address": "192.168.1.89",
        "network_view": "default"
    }
]
 
 
THIRD:
                Take the “_ref” data and replace the “search” part of the URL.  You’ll be adding in a different “-d” option as well.
 
                WAPI
 
•         curl -k3 –u admin -X GET https://192.168.0.121/wapi/v1.2.1/lease/ZG5zLmxlYXNlJDAvMTkyLjE2OC4xLjg5LzAv:192.168.1.89/default –d -return_fields="address,client_hostname,discovered_data,network,network_view,server_host_name,uid,username,variable"
 
RESULTS
 
{
    "_ref": "lease/ZG5zLmxlYXNlJDAvMTkyLjE2OC4xLjg5LzAv:192.168.1.89/default",
    "address": "192.168.1.89",
    "client_hostname": "\"dsmith-mac\"",
    "discovered_data": {
        "discovered_name": "dhcp-192-168-1-89.home.local",
        "discoverer": "NetMRI",
        "first_discovered": 1282763425,
        "last_discovered": 1382980048,
        "mac_address": "f8:1e:df:da:4d:df",
        "netbios_name": "DSMITH-MAC",
        "network_component_description": "Switch",
        "network_component_ip": "192.168.0.6",
        "network_component_name": "cisco3524xl-1",
        "network_component_port_description": "Uplink to home network",
        "network_component_port_name": "Fa0/24",
        "network_component_port_number": 38,
        "network_component_type": "Switch",
        "os": "Microsoft",
        "port_link_status": "Connected",
        "port_speed": "100M",
        "port_status": "Up",
        "port_vlan_name": "default",
        "port_vlan_number": 1
    },
    "network": "192.168.0.0/23",
    "network_view": "default",
    "server_host_name": "gm.lab.local",
    "uid": "\"\\001\\370\\036\\337\\332M\\337\"",
    "username": "don-mac-wireless",
    "variable": "ddns-rev-name=\"89.1.168.192.in-addr.arpa.\" ddns-txt=\"3100247a8bcc5cdfd51aa21e6603f75db5\" ddns-fwd-name=\"dsmith-mac.home.local\" lt=\"undefined\""
}
 

Showing results for 
Search instead for 
Did you mean: 

Recommended for You