Infoblox Exchange Cybersecurity Roadshow 2020 – Join us!
North America | Europe | Middle East/Africa | Asia-Pacific

API & Integration

Reply
Accepted Solution

How to get details for fixed address hosts by mac-address

Posts: 2
1947     0

Hi,

I need to fetch details for a fixed mac-address hosts. I tried:

/search?mac_address=00:11:22:333:44:55

but I only get the ip-address configured for this host. How can I get the gateway, mask and dns by mac-address? This host it's configured as fixed address.


Thank you

Re: How to get details for fixed address hosts by mac-address

MRichard Community Manager
Community Manager
Posts: 141
1947     0

The search will return any objects associated with the MAC address, including fixed addresses, hosts, leases, discovered devices, etc.

For example it might return:


    {
        "_ref": "fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuOS4xNi45OC4wLi4:10.9.16.98/default",
        "ipv4addr": "10.9.16.98",
        "network_view": "default"
    }


Most likely the gateway is not defined in the fixed address, but is only defined on the network where the fixed address is defined.  If it is defined on the fixed address, it is one of the DHCP options. The mask always belongs to the network.


/fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuOS4xNi45C4wLi4:10.9.16.98/default?_return_fields%2b=network,mac,options

The response might look like this:


{
    "_ref": "fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuOS4xNi45OC4wLi4:10.9.16.98/default",
    "ipv4addr": "10.9.16.98",
    "mac": "00:11:22:33:44:55",
    "network": "10.9.16.0/24",
    "network_view": "default",
    "options": [
        {
            "name": "dhcp-lease-time",
            "num": 51,
            "use_option": false,
            "value": "43200",
            "vendor_class": "DHCP"
        }
    ]
}

and no gateway defined in this example.


We can search for the IP address, which will return the fixed address, the network where it's configured, and any DNS records with this IP address:


/search?address=10.9.16.98


[
    {
        "_ref": "fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuOS4xNi45OC4wLi4:10.9.16.98/default",
        "ipv4addr": "10.9.16.98",
        "network_view": "default"
    },
    {
        "_ref": "record:a/ZG5zLmJpbmRfYSQuX2RlZmF1bHQub3JnLmV4YW1wbGUsY29mZmVlbWFrZXIsMTAuOS4xNi45OA:coffeemaker.example.org/Internal",
        "ipv4addr": "10.9.16.98",
        "name": "coffeemaker.example.org",
        "view": "Internal"
    },
    {
        "_ref": "recordSmiley Tonguetr/ZG5zLmJpbmRfcHRyJC5fZGVmYXVsdC5hcnBhLmluLWFkZHIuMTAuOS4xNi45OC5jb2ZmZWVtYWtlci5leGFtcGxlLm9yZw:98.16.9.10.in-addr.arpa/Internal",
        "ptrdname": "coffeemaker.example.org",
        "view": "Internal"
    },
    {
        "_ref": "network/ZG5zLm5ldHdvcmskMTAuOS4xNi4wLzI0LzA:10.9.16.0/24/default",
        "comment": "Infobox Lab",
        "network": "10.9.16.0/24",
        "network_view": "default"
    }
]



Now you would search for the network in the network view to return the gateway.

/network?network=10.9.16.0/24&network_view=default&_return_fields%2b=options


[
    {
        "_ref": "network/ZG5zLm5ldHdvcmskMTAuOS4xNi4wLzI0LzA:10.9.16.0/24/default",
        "comment": "Infobox Lab",
        "network": "10.9.16.0/24",
        "network_view": "default",
        "options": [
            {
                "name": "dhcp-lease-time",
                "num": 51,
                "use_option": false,
                "value": "43200",
                "vendor_class": "DHCP"
            },
            {
                "name": "routers",
                "num": 3,
                "use_option": true,
                "value": "10.9.16.1",
                "vendor_class": "DHCP"
            }
        ]
    }
]

Highlighted

Re: How to get details for fixed address hosts by mac-address

[ Edited ]
MRichard Community Manager
Community Manager
Posts: 141
1947     0

sorry about the automatic emoticon conversion...  that should read "colon ptr" instead of Smiley Tonguetr

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You