Install DHCP Server on FreeBSD

The Dynamic Host Configuration Protocol (DHCP) is a network service that enables host computers to be automatically assigned settings from a server as opposed to manually configuring each network host. Computers configured to be DHCP clients have no control over the settings they receive from the DHCP server, and the configuration is transparent to the computer’s user.

1) Install DHCP Server from port system.

# cd /usr/ports/net/isc-dhcp42-server

# make install clean

2) Configure the DHCP Server

# vi /usr/local/etc/dhcp.conf

option domain-name “yourdomain.com“;

option domain-name-servers 10.0.0.100;  # IP address of Name server

option netbios-name-servers 10.0.0.100;  # IP address of Netbios Name Server or WINS Server

default-lease-time 600;

max-lease-time 7200;

ddns-update-style none;

log-facility local7;

 

subnet 10.0.0.0 netmask 255.255.255.0 {    # NetID and Subnet Mask of your network.

range 10.0.0.120 10.0.0.0.169;       # IP range will be assigned to client automatically.

option routers 10.0.0.1;                       # It usually is the IP address of your network default gateway.

}

# Create record that configures a reserved IP address of 10.0.0.46 will be assigned to the client with MAC address of  00:55:31:73:D6:AA. It will be assigned default gateway is 10.0.0.1;

host noname {

hardware ethernet 00:55:31:73:D6:AA;

fixed-address 10.0.0.46;

}

# Configure a reserved IP address of 10.0.0.211 will be assigned to the client with MAC address of  00:78:5a:1d:23:45 and its default gateway is 10.0.0.2;

host ip-phone2 {

hardware ethernet 00:78:5a:1d:23:45;

fixed-address 10.0.0.211;

option routers 10.0.0.2;

}

3) Configure to start  DHCP server  at the system boot time.

# vi /etc/rc.conf

dhcpd_enable=”YES”

dhcpd_ifaces=”dc0″

4) Start DHCP server.

# /usr/local/etc/rc.d/isc-dhcpd start

Be the first to comment

Leave a Reply