Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 <> scope s.s.s.s show client | find "MACAddress" ?

share|improve this question
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


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.