Home > Server Management > How to Setup DHCP Server in OpenBSD

How to Setup DHCP Server in OpenBSD

Introduction:

 


Dynamic Host Configuration Protocol Server or DHCP Server is a solution in automatic IP address assignment to a workstation in a network. This will give us great advantage especially in large network with multiple workstations.

The server will be assigning a lease to a workstation configured to search a DHCP Server. After the lease time will expire a new IP address will be assigned to that workstation. The IP address will also change if the workstation will be restarted. This can be altered by using the MAC address of an Ethernet device. The physical address of the Ethernet will be bind to a specific address. In effect the IP address will be the same even if the workstation will be restarted.

We can also control on workstations that will access the network by adding a directive to dhcpd.conf that block unregistered Ethernet physical address from accessing the network.

 

Purpose:



DHCP makes the life of the Network Administrator a bit easier because it will only be a onetime setup and the workstations will automatically be assigned with IP address and solving conflict in IP addressing and reducing the time in troubleshooting. The down side is when the DHCP server will have maintenance or worst the server will be corrupted then the workstations will not be able to have its IP address rendering the Network communication useless. As an advice always have a backup on servers as much as possible because we don’t know what will happen in the near future. As an administrator be ready round the clock and prepare for the worst scenarios.

 

Installation:

 


SERVER SIDE:

Operating System: OpenBSD 4.x

–          Make sure that squid is already installed in order for us to try whether the DHCP is working or not through client testing.

CLIENT SIDE:

Operating System: OpenBSD 4.x, CentOS 5.x, Windows 95-Up and any other Operating System

–          Install the OS and don’t forget to choose the option botton “Obtain IP address automatically” in Network properties.

Configuration:



SERVER SIDE:

Edit the rc.conf.local using your favorite editor.

# nano /etc/rc.conf.local

pflogd_flags=256     # add more flags, ie. “-s 256″

dhcpd_flags=”rl0”    # for normal use: “”

ftpproxy_flags=””                # for normal use: “”

Using your favorite editor edit the dhcpd.conf located at /etc/

#nano  /etc/dhcpd.conf

#$OpenBSD: dhcpd.conf,v 1.2 2008/10/03 11:41:21 sthen Exp $

# DHCP server options.

# See dhcpd.conf(5) and dhcpd(8) for more information.

# Network:                            192.168.1.0/255.255.255.0

# Domain name:                   my.domain

# Name servers:                   192.168.1.3 and 192.168.1.5

# Default router:  192.168.1.1

# Addresses:                         192.168.1.32 – 192.168.1.127

#

option  domain-name “<internal domain name>”;

option  domain-name-servers 203.177.160.46, 8.8.8.8, 8.8.4.4;

subnet 192.168.0.0 netmask 255.255.255.0 {

option routers 192.168.0.1;

range 192.168.0.3 192.168.0.254;

#              host static-client {

#                              hardware ethernet 22:33:44:55:66:77;

#                              fixed-address 192.168.1.200;

#              }

#              host pxe-client {

#                              hardware ethernet 02:03:04:05:06:07;

#                              filename “pxeboot”;

#                              next-server 192.168.1.1;

#              }

# +—————————————————–+

# | Custom config                                            |

# +—————————————————–+

# July

host ws01 {

hardware ethernet 00:11:D8:59:17:CE;

fixed-address 192.168.0.101;

}

# +—————————————————–+# | DESIGNERS                                           |

# +—————————————————–+

#dado

host ws06 {

hardware ethernet 00:13:D4:18:27:BA;

fixed-address 192.168.0.131;

}

#sebastianhost ws09 {

hardware ethernet 00:11:D8:59:17:D0;

fixed-address 192.168.0.134;

}

#sebastian

host ws10 {

hardware ethernet 00:13:46:3B:FE:F6;

fixed-address 192.168.0.135;

}

#network printer

host ws11 {

hardware ethernet 00:13:46:3C:0D:EF;

fixed-address 192.168.0.136;

}

}

Sources / References


http://www.opensolutions101.com/openbsd-installation-configuration/openbsd-dhcp-configuration/

  1. No comments yet.
  1. No trackbacks yet.

Leave a comment