This is just a short post to walk through setting up a quick DHCP server in Linux with dnsmasq. In Kali Linux 2.0 to be precisely. You can read more about dnsmasq here. Why might you want to do this? Well, couple of reasons spring to mind whilst on a pentest, setting up application testing, network boot a laptop that’s under review or setting up a wifi/rougue access point are a few that spring to mind.
First install dnsmasq with:
apt-get install dnsmasq
Then edit the dnsmasq config file with your favourite editor:
The config that we might use in a couple of different scenarios would look something similar to the below. You can comment lines out that you don’t want with a ‘#’:
interface=eth1 server=22.214.171.124 dhcp-range=192.168.101.100,192.168.101.200,12h dhcp-boot=pxelinux.0 enable-tftp tftp-root=/tftpboot/ dhcp-option=3,192.168.101.1 dhcp-option=6,126.96.36.199,188.8.131.52
Once you have made your changes restart the dnsmasq service with:
service dnsmasq restart
Simple. Hope this quick tip helps.