Configuring an external DHCP server

IMPORTANT:

During the initial deployment of a Blueprint through NPS, the Image Service pod in NPS provides the DHCP services for IP allocation during PXE boot process. The Image Service pod performs the PXE boot of master and worker nodes. To ensure continuity of DHCP service post removal of NPS, you must configure an external DHCP server for the nodes (existing and additional) in the environment.

Prerequisites
  • Ensure that you delete the Image service pod in NPS before you configure and start the external DHCP server. To delete the image service pod, run the following command:
    nps baremetal -a delete -nos <nos_type>
    
    The supported nos_type is cumulus or aruba.
  • An external server is needed and it must be connected to the core switch and accessible to the master and worker nodes.

    NOTE:

    External server is an external DHCP server that a user is configuring in this procedure.

Procedure
  1. Configure a DHCP relay with the external server IP address.
    • In case of Cumulus switches, configure a DHCP relay with external server IP address.

      1. Log in to all data switches.

      2. Update the /etc/default/isc-dhcp-relay-vrf-mgmt file with the following information:
        SERVERS= “<external_server_IP_address>”
        INTF_CMD= “-i vlan <pxe_vlan> -i vlan <pxe_vlan> -v0”
        OPTIONS=""
      3. Run the following command to enable the dhcrelay@vrf-mgmt.service service:
        systemctl enable dhcrelay@vrf-mgmt.service
      4. Run the following command to start the dhcrelay@vrf-mgmt.service service:
        systemctl start dhcrelay@vrf-mgmt.service
    • In case of Aruba switches, configure a DHCP relay in CFM with the external server IP address.

  2. Retrieve the MAC address of the management NIC and OS hostname of all the servers.
  3. Install the DHCP server packages in the external server and configure the dhcpd.conf file as per the following sample.

    Update the dhcpd.conf file located at /etc/dhcp/dhcpd.conf on the external DHCP server. Refer the following sample configuration file:

    <applicable ISC DHCP server>
    authoritative;
    subnet <external_dhcp_start_ip> netmask <external_dhcp_server_netmask>{
    }
    subnet <OCP_network_start_ip> netmask <OCP_network_netmask>{
    range <OCP_network_dhcp_start_ip> <OCP_network_dhcp_end_ip>;
    option routers <OCP_network_gateway>;
    option broadcast-address <OCP_network_broadcast>;
    option interface-mtu 9000;
    default-lease-time -1;
    max-lease-time -1;
    allow booting;
    allow bootp;
    next-server <external_dhcp_server_ip>;
    option domain-name-servers <dns address>;
    option domain-name <domain name>;
    deny unknown-clients;
    host <master1_hostname> {                               
                  hardware ethernet <master1_management_mac address>; fixed-address <master1_ocp_ip_to_be_assined>;
    }host <master2_hostname> {
                  hardware ethernet <master2_management_mac address>; fixed-address <master2_ocp_ip_to_be_assined>;
    }host <master3_hostname> {
                  hardware ethernet <master3_management_mac address>; fixed-address <master3_ocp_ip_to_be_assined>;
    }host <worker1_hostname> {
                  hardware ethernet <worker1_management_mac address>; fixed-address <worker1_ocp_ip_to_be_assined>;
    }host <worker2_hostname> {
                  hardware ethernet <worker1_management_mac address>; fixed-address <worker2_ocp_ip_to_be_assined>;
    }
    }
  4. Restart the DHCP service.
  5. Verify that DHCP is configured on the switches.
    • In case of Cumulus switches, verify that DHCP is configured on all data switches.
      service isc-dhcp-server status
    • In case of Aruba switches, verify that DHCP is configured on the borderleaf switch.
      show running-config
      interface vlan3401
          vrf attach cfm_vpc_2
          ip mtu 9198
          ip address XX.XX.XX.XX/24
          active-gateway ip mac 00:50:56:aa:bb:dd
          active-gateway ip XX.XX.XX.XX
          ip helper-address XX.XX.XX.XX
      NOTE:

      ip helper-address XX.XX.XX.XX shows the IP of the DHCP server.