Manually configuring multiple DHCP relay servers
This page describes how to manually configure multiple DHCP relay servers
Introduction to DHCP relay server configuration
If you are using DHCP relay servers, Abiquo recommends that NO VLANs should be managed by the DHCP Server.
This means that NO VNICs should be created on the DHCP Server for the VLAN networks.
This configuration is scalable because you can configure a new relay server in order to add more VLANs.
Design your DHCP relay network configuration
Any server that manages VLANs (whether a DHCP Relay or DHCP Server) must have one VNIC or NIC with an IP address for each VLAN that will identify the VLAN to the DHCP Server.Â
The DHCP Server and VM communicate through broadcasts, which are also relayed, until the IP address of the VM is set, so there is no specific requirement for the IP address of the VNIC or NIC. But we recommend that you use an IP address range that is not part of any other networks. For example, you could use the upper range of the management network. If you have complex requirements, you may need to adapt these configurations.
The relay service network mask is used for subnetting. Each dhcrelay will have one subnet allocated to assign IP addresses to the VNICs to support the VLAN networks. The number of addresses in the subnet must be greater than the number of VLANs the server will manage.
In the example below, the network with a subnet mask of 24 has 256 addresses, which is greater than the 198 VLANs that will be managed by the relay.
Steps to configure DHCP relay servers
Perform a CentOS/RHEL core install on each DHCP relay server. This can be a minimal install with no GUI
Disable SELinux and Firewall
During the install process, optionally, disable IPv6.
On each DHCrelay server, install required packages
DHCP for dhcrelay.
Vconfig to create VLANs.
yum install dhcp vconfig
Download the
dhcpconf
script from this wiki page. The script uses Python 2.To automatically create the dhcrelay configuration, run the script
$ ./dhcpconf \--help Usage: dhcpconf [OPTIONS]... Creates configuration files and start scripts for the dhcp server and relays. \-h \--help This help screen. \-r \--relay-server-interface=INTERFACE Interface of relay servers connected to the DHCP server. \-i \--relay-server-ip-range=IPRANGE IP range for the relays in the server interface (e.g. 10.0.0.6-10.0.0.10). \-s \--relay-service-interface=INTERFACE Interface of the relay to the clients, where VLANs will be created. \-v \--vlan-range=VLANRANGE VLAN range for clients (e.g. 10-1010). \-x \--dhcp-server-ip=IP IP of the DHCP server. \-n \--relay-service-network=IP Network addresses available for relay service interfaces. \-b \--relay-service-network-bits=INTEGER Number of bits assigned to the network part of the address (the mask).
This script will generate two bash scripts for each dhcrelay:
relay-config-X.sh
andrelay-run-X.sh
, and one bash script for DHCP server routes config.Â
This is an example configuration3 dhcrelay servers: 192.168.1.2, 192.168.1.3, 192.168.1.4 DHCP Server IP: 192.168.1.1 Each dhcrelay is connected to the DHCP server through eth0 (management network) Each dhcrelay is connected to VLANs through eth1 (service network) Each dhcrelay manages VLAN range 2-200 Network for the relay service interface: 10.0.0.0/24
This is how the script is run for the example and its output.
Copy each of the scripts output by the dhcpconf script to the appropriate server
Run the scripts on the corresponding servers. Replace
X
with your server number.
 To configure dhcrelay X:To init dhcrelay X:
On your DHCP server:
Â
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved