Home » » Simple DHCP Server with dnsmasq

Simple DHCP Server with dnsmasq

Dynamic Host Configuration Protocol (DHCP) is a standardized networking protocol used by servers on an IP network to allocate IP addresses to computers.

Install on Debian or Ubuntu :
sudo apt-get install dnsmasq

Install on Centos :
yum install dnsmasq

Config for dnsmasq.conf locate at /etc/dnsmasq.conf
add the following config on the top your dnsmasq.conf
port=0
dhcp-option=option:dns-server,8.8.8.8
interface=eth0
dhcp-range=eth0,192.168.1.30,192.168.1.100,12h
dhcp-option=eth0,3,192.168.1.200

which :
dhcp-option=option:dns-server,8.8.8.8 -->DNS for client
interface=eth0 -->interface on your server to use.
dhcp-range=eth0,192.168.1.30,192.168.1.100,12h -->Range ip client computer.
dhcp-option=eth0,3,192.168.1.200 --> 3 for Enable dynamic address allocation for bootp, and 192.168.1.200 is default gateway for client computer.


and then, restart service :
sudo service dnsmasq restart

and try connect your pc/laptop to get automatic ip address.
Share this article :

5 comments:

Please fill your name to response.

Labels