Nov 05 2007
Net::DHCP
The aim of Net::DHCP (hosted at RubyForge) is to provide a set of classes to low level handle the specifics of DHCP (rfc2131, rfc2132, etc.) in ruby.
With Net::DHCP you will be able to craft custom DHCP packages and have access to all the fields defined for the protocol.
The Dynamic Host Configuration Protocol (DHCP) provides a framework for passing configuration information to hosts on a TCPIP network.
UDP is used as transport protocol, all packets sent by the client have a source port of 68 and a destination port of 67. Likewise, packets originated in the server will have source port 67 and destination port 68.
You can create messages, attach options and pack them as the payload of a UDP packet. In the same way, you can use a capturing library such as Ruby/pcap to get packages from the network and parse their contents into well formed and comprehensible ruby objects.
This project’s SVN repository can be checked out through anonymous access with the following command(s):-
svn checkout http://netdhcp.rubyforge.org/svn/
or
svn checkout svn://rubyforge.org/var/svn/netdhcp
I hope you find the library useful. Let me know if you are using it for something!
References
- rfc2131: Dynamic Host Configuration Protocol
- rfc2132: DHCP Options and BOOTP Vendor Extensions
- rfc2563: DHCP Option to Disable Stateless Auto-Configuration in IPv4 Clients
- rfc4578: DHCP Options for the Intel Preboot eXecution Environment (PXE)
- rfc4702: The DHCP Client Fully Qualified Domain Name (FQDN) Option




