Varun Chopra
Varun Chopra

Reputation: 43

Specfying lease time in DHCP request packet

I am trying to create a Dhcp request packet using scapy. Is there any way in which I can specify DHCP lease time in my request packet?

Upvotes: 0

Views: 753

Answers (1)

Barmar
Barmar

Reputation: 780869

Put option #51, with the desired lease time as its value, in the options section of the DHCPREQUEST or DHCPDISCOVER packet.

From RFC 2131 Section 3.5:

In addition, the client may suggest values for the network address and lease time in the DHCPDISCOVER message. The client may include the 'requested IP address' option to suggest that a particular IP address be assigned, and may include the 'IP address lease time' option to suggest the lease time it would like.

Upvotes: 1

Related Questions