DHCP troubleshooting
This documentation is for troubleshooting DHCP with the omapi protocol
Check messages log file on DHCP Server
Check the messages file for evidence that DHCP is functioning
# tail /var/log/messages
May 5 08:53:32 abiquoserver dhcpd: DHCPREQUEST for 192.168.1.2 from 01:50:51:38:b1:ed via eth0.1
May 5 08:53:32 abiquoserver dhcpd: DHCPACK on 192.168.1.2 to 01:50:51:38:b1:ed via eth0.1
May 5 08:53:38 abiquoserver dhcpd: DHCPREQUEST for 192.168.0.2 from 01:16:31:ee:73:14 via eth0.2
May 5 08:53:38 abiquoserver dhcpd: DHCPACK on 192.168.0.2 to 01:16:31:ee:73:14 via eth0.2
DHCPREQUESTs should be followed by DHCPACKs log entries. If not, try restarting the DHCP service:
Restart the DHCPD service
service dhcpd restart
Check the DHCP relay server
Check if the VLAN interfaces were created on the DHCP Relay Server.
ifconfig | more
The above command should display the VLAN interfaces along with their IP address. If the interfaces do not show up, you should run the appropriate scripts that are created by the generator scripts. See the table below.
DHCP relay server creation scripts and configuration files table.
No. of DHCP | Name of generator script | Names of scripts generated by initial script | Other config files | Wiki link |
---|---|---|---|---|
One | abiquo-relay-scripts.py | relay-config | dhcpd.conf | Manually Configuring One DHCP Relay Server |
Multiple | dhcpconf | config-routes-server.sh; and relay-config-X.sh and | dhcpd.conf | Manually configuring multiple DHCP relay servers |
Check the DHCP server
Check the DHCP configuration file
dhcpd.conf
If the file doesn't exist or is wrong, replace it with the above information.
Check for the static route between DHCP server and DHCP relay server
Check that the file /etc/sysconfig/network-scripts/route-eth0 exists on the DHCP Server.
This file should include the following:
If the file doesn't exist or is wrong, replace it with the above information.
Check the leases file on the DHCP server
This file contains a MAC/IP list. Check if the VM's MAC address is in this file:
Sample entries from dhcpd.leases
If there aren't any entries in this file, the problem is likely to be with the DHCP Remote Services configuration. The Abiquo "DHCP Service" entry in the Remote Services configuration of the datacenter should point to the IP address of the DHCP Server, not the DHCP Relay.
Check classless static routes
If you have added classless static routes to your Abiquo network definitions, the leases should also contain lines with the encoded routes.
Check whether the DHCP Server is listening on interfaces
/etc/sysconfig/dhcpd
Output
Both commands should display a list of the interfaces that DHCP is listening on. If they don't, rerun the create-vlans script.
Check hypervisors
Check communication between DHCP and the hypervisor
a. Deploy a VM
b. Check the VLAN that the virtual machine is on (from within the Abiquo GUI or the hypervisor client)
c. Connect to the DHCP Server (Monolithic: Abiquo Server; Distributed: Remote Services) and run the following command: tcpdump -i eth1.n where n is the VLAN ID
d. Connect to the VM console and run a DHCP request: dhclient eth0
e. Check if there are any broadcast (255.255.255.255) packets in the tcpdump. If yes, then the problem points to an issue with the physical switch.
This tcpdump command will show any request on the DHCP Server:
Check switch configuration
Connect to the switch and check if the hypervisors are connected using the right NIC. Also check if the service NIC is listed in the output of 'show mac-address-table' command. Check the VLAN configuration is correct.
For example:
Check virtual machines
Check the virtual machine configuration for classless static routes under RFC3442
Windows 7 VM
Windows 7 will accept the option 249 classless static routes without any special configuration.
Check if you have the static routes.
CentOS VM
Check if you have the static routes.
If the routes are not present, continue to check the configuration as described below.
Check the CentOS VM config files
Check that the following two files exist on the system and are not empty:
/etc/dhclient.conf
/etc/dhclient-exit-hooks
The contents of these files should be as described in Configuring DHCP#Configure CentOS VM Template to Receive Static Routes by DHCP
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved