Configuring a DHCP server

The Abiquo DHCP server is already configured to listen to VLANs

Overview

This document will show you how to configure a DHCP server listening to multiple VLANs. However, Abiquo recommends that you use a DHCP relay server to provide VLAN configuration.

A DHCP server only allows 200 VLANs. If more VLANs are needed, you should set up a DHCP relay server.

Abiquo recommends that you always use a DHCP relay server to provide VLAN support because it is difficult to scale this DHCP Server-only Configuration.

Install needed packages

You need to install vconfig (this is used to create VLANs), which is available in the EPEL repository:

# yum install epel-release && yum makecache && yum clean all # yum install vconfig
Create configuration scripts

To generate needed files, we will use Abiquo dhcpd config script.

# ./abiquo-dhcpd-config.py -h Usage: abiquo-dhcpd-config.py [OPTIONS]... Creates configuration files and start scripts for the DHCP server and VLANs. -h --help This help screen. -s --service-interface=INTERFACE Interface of the relay server connected to service network, where VLANs will be created. -v --vlan-range=VLANRANGE VLAN range (e.g. 2-200). -n --service-network=IP Network available for relay service interfaces (has to finish in 0).

It will generate 1 bash script (vlans-config) and 1 config file for DHCP server (/etc/sysconfig/dhcpd). For example:

DHCP server is connected to VLANs through eth1 (service network) DHCP server listens to VLAN range 2-200 Network for service network interfaces: 10.0.0.0



The service network is used to identify each VLAN interface. This network has to be different from every other network that the DHCP server has access to.



Configure DHCP server
VLANs init script
DHCP server
Add a single out-of-range VLAN tag

To create a single out-of-range VLAN tag e.g. a new public VLAN, edit your script at /etc/init.d/vlan-config and look for text like this:

In the above example, we can see that the service interface is eth0, the range is 2-200 and the service IP is 10.0.0.0.

Following the example, if we want to add the VLAN Tag 500, we will add these lines:

The result will look like this:

Now we will add the reverse command to stop the network. Look for text like this:

And add these lines following the above example:

The result will look like this:

Afterwards, save the file and restart the script. Now you need to add the VLAN you will be using to /etc/sysconfig/dhcpd:
Add it between the quotation marks to the end of any existing DHCPDARGS value (represented here as [...]):

Following the example above:



Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved