Infoblox’s global team of threat hunters uncovers a DNS operation with the ability to bypass traditional security measures and control the Great Firewall of China. Read about “Muddling Meerkat” and the many other threat actors discovered by Infoblox Threat Intel here.

API & Integration, DevOps,NetOps,SecOps

Reply

Add existing MS Dhcp Failover Association to DHCP range

Techie
Posts: 9
3664     1

The following code returns a 400 when ran. I think it may have something to do with the ms_server fields. Does anyone know what these should be? 

I know the server_association_type is correct as thats clearly documented, however im not sure if for the ms_server fields, do i need to specify the "name" of the failover assoation etc ... 

dhcp_range_payload = json.dumps({"start_addr": dhcp_ib_range_prefix + '100',
"end_addr": dhcp_ib_range_prefix + '245',
"server_association_type": "MS_FAILOVER",
"network_view": "default",
"name": comment_dict[ib_subnet],
"ms_server": {"_struct": "msdhcpserver",
"ipv4addr": "dcedhcp02.insightglobal.net"},
"ms_options":
[{"name": "routers",
"num": 3,
"value": ib_gateway_ip}],
})

 

Re: Add existing MS Dhcp Failover Association to DHCP range

Techie
Posts: 9
3665     1

I found a field i was missing for "failover associtation" With this code i am not getting: 

{ "Error": "AdmConDataError: expected single object, got 2"}

 

# Add DHCP ranges to subnets
dhcp_clean_ip_address_list = ib_subnet.replace(' ', '').split('.')
dhcp_clean_ip_address_list.pop(3)
dhcp_clean_ip_address_list.append('')
dhcp_ib_range_prefix = '.'.join(dhcp_clean_ip_address_list)
ranges_url = "https://172.18.101.100/wapi/v2.7/range"
dhcp_range_payload = json.dumps({"start_addr": dhcp_ib_range_prefix + '100',
"end_addr": dhcp_ib_range_prefix + '245',
"server_association_type": "MS_FAILOVER",
"failover_association": "dcedhcp02.insightglobal.net-dcwdhcp02.insightglobal.net",
"network_view": "default",
"name": comment_dict[ib_subnet],
"ms_options":
[{"name": "routers",
"num": 3,
"value": ib_gateway_ip}],
})
ib_dhcp_response = requests.request("POST", ranges_url, headers=headers, data=dhcp_range_payload, verify=False)
bar.finish()
print(ib_dhcp_response.content)

 Any ideas ??

Re: Add existing MS Dhcp Failover Association to DHCP range

Moderator
Moderator
Posts: 293
3665     1

I'm getting the same error message.  It works through the NIOS GUI.  It works when I assign the range to a single MS server. But not when I try to assign the range to the failover association. It appears to be a defect.  Can you please open a support case and give them the details, along with your NIOS and Windows Server versions.  You're welcome to refer to this forum post also, when you open the case.

Re: Add existing MS Dhcp Failover Association to DHCP range

New Member
Posts: 2
3665     1

Hi,

 

This is a known bug: NIOS-85974.  Support told me it it is targeted to be fixed in 8.6.3 and 9.0.  In the meantime you can work around generating a CSV import file and using a CSV upload over WAPI. 

 

Regards,

Christina.

Re: Add existing MS Dhcp Failover Association to DHCP range

Techie
Posts: 10
3665     1

Hi Christina,

 

I have 8.6.3, but still having issue in python code.  It works fine in postman.  Can you help shred some light, please?

 

Peter

 

https://community.infoblox.com/t5/api-examples/quot-404-client-error-not-found-for-url-quot-with-ran...

Re: Add existing MS Dhcp Failover Association to DHCP range

Techie
Posts: 9
3665     1
Hey, I wanted to check in on this… has support been aware of that this feature is still not working?
Showing results for 
Search instead for 
Did you mean: 

Recommended for You