Automatically Configure Multiple DHCP Relay Servers Using Abiquo Installation ISO
You can configure multiple DHCP relay servers using the Abiquo DHCP Relay appliance. However, if you wish to configure them manually, follow this document.
If you are using DHCP relay servers, Abiquo recommends that no VLANs should be managed by the DHCP Server, i.e., 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.
Perform a CentOS/RHEL 5.4 x86_64 Core Install on each DHCP relay server
- Download CentOS 5.4 x86_64 DVD from a CentOS mirror
- Minimal install, no graphical environment needed.
See the official RedHat/CentOS documentation for install guidance: RHEL-5-manual/Installation_Guide-en-US on RedHat site
- SELinux and Firewall must be disabled. See Disabling SELinux.
- IPv6 can be disabled during the install process
Install Required Packages
- DHCP provides dhcrelay.
- Vconfig is used to create VLANs.
These packages are needed on each dhcrelay server.
Create Configuration Scripts
To automate dhcrelays configuration, we will use "dhcpconf" script (attached to this wiki page):
$ ./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 and relay-run-X.sh, and one bash script for DHCP server routes config. For example:
3 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
The server managing VLANs (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.
However, it is recommended that the IP address range 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, 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.
$ ./dhcpconf \-r eth0 \-i 192.168.1.2-192.168.1.4 \-s eth1 \-v 2-200 \-x 192.168.1.1 \-n 10.0.0.0 \-b 24
-- Generating files --
* dhcpd.conf Configuration file for the dhcp server
* relay-config-1.sh Script to generate VLANs and assign IPs for relay 1
* relay-run-1.sh Script to start the dhcrelay process in relay 1
* relay-config-2.sh Script to generate VLANs and assign IPs for relay 2
* relay-run-2.sh Script to start the dhcrelay process in relay 2
* relay-config-3.sh Script to generate VLANs and assign IPs for relay 3
* relay-run-3.sh Script to start the dhcrelay process in relay 3
* config-routes-server.sh Script to configure static routes to relays in the server
-- End --
Copy each one to the right server.
$ scp config-routes-server.sh email@example.com:
$ scp relay-*-1.sh firstname.lastname@example.org:
$ scp relay-*-2.sh email@example.com:
$ scp relay-*-3.sh firstname.lastname@example.org:
Configure and Run
Execute the scripts generated on the corresponding servers.
To configure dhcrelay X:
To init dhcrelay X:
$ sh config-routes-server.sh