Windows Server DHCP conversion to Cisco CLI

Windows Server DHCP conversion to Cisco CLI

Author: Justin Cooksey

I recently ran in to an issue where I needed to convert a reasonably large DHCP database from a Windows Server in to a Cisco CLI to allow the Cisco to take over DHCP roles for a subnet. I found nothing that realy automated this task, even using the exported XML file. So knowing that this was the second time I needed the tool, and likely to need it again, even if it was for smaller tasks, I set about coding it in Powershell. It is the scripting system well supported in Windows land.

The current version of the script can be found on my GitHub repository: Convert-WindowsDHCPToCisco

Still ha smany DHCP options that it hasn’t been setup to hanle at this point but it does follow the basic ones that most of us use.

Currently handles DHCP Options

CodeOption DescriptionCisco Output
3Default Gatewaydefault-router
4Time Serverignoring
6Domain Nameserverdns-server
15Domain Namedomain-name
42NTP Serversoption 42 ip
51Lease timeignoring
66TFTP Servernext-server
67Boot filenamebootfile
81MS DHCP Name Protectionignoring
121Static routesoption 121 hex
161FTP Serveroption 161 ip
162Pathoption 162 ascii
252Proxy PAC URLoption 252 asicc

DHCP References Used