Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to create a dynamic IP resolver using python3 on linux to query a windows DHCP server and return the IP that it would be given. My purpose is to supply the returned IP address as a Framed-IP-Address in FreeRADIUS and forward it to a SSO agent.

I have modified this python script to take a mac address argument and build the DHCP request. When I run it through WireShark, I see the DHCP request is using the argument, but the DHCP server is returning an IP different than what it should.

Are there any safeguards on a Windows 2008 DHCP server that prevent a "spoofed" DHCP request? Is there a similar command on linux like there is on windows: netsh dhcp server <type.srvIP.here> scope s.s.s.s show client | find "MACAddress" ?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

a DHCP DISCOVERY/REQUEST packet carries the source MAC address in 2 places

  1. At Ethernet packet level (Source MAC)
  2. At UDP payload level (Client Mac address field)

You can fake 2) from Python but you cannot fake 1). Any good DHCP server will check both addresses match or it'll prioritize the hardware level MAC (1)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.