System Setup and Software Installation Guide for Cisco NCS 1001

PDF

System Setup and Software Installation Guide for Cisco NCS 1001

iPXE network boot

Want to summarize with AI?

Log in

This section explains how iPXE network boot enables routers to recover from boot failures by downloading and installing a system image from a network server.


An iPXE network boot is a preboot execution environment included in the network card of management interfaces that

  • operates at the Unified Extensible Firmware Interface (UEFI) level of the chassis,

  • reimages and boots the system after a boot failure or when no valid bootable partition is available, and

  • downloads an ISO image, installs it, and bootstraps the chassis inside the new installation.

iPXE image download requirements

Note

The time taken for iPXE to download the ISO image depends on the network speed. Ensure that the network speed is sufficient to complete the image download in less than 10 minutes. The chassis reloads if the image is not downloaded by 10 minutes.

iPXE acts as a boot loader and provides the flexibility to choose the image that the system will boot based on the Platform Identifier (PID), the Serial Number, or the management mac-address. iPXE must be defined in the DHCP server configuration file.

Note

For IPv6 configuration, see Configure a DHCP server for iPXE boot.


Configure a DHCP server for iPXE boot

Set up a DHCP server to provide network settings and an ISO image location to a chassis for iPXE booting.

The DHCP configuration can support IPv4, IPv6, or both protocols, and can select a boot image based on the chassis MAC address or serial number.

Before you begin

If using DHCPv6, configure the Router Advertisement Daemon (radvd) so router advertisement (RA) messages instruct nodes to obtain their IPv6 addresses through DHCP.

Install radvd by entering this command:

yum install radvd

Configure the interface in the radvd configuration. This example advertises a documentation-safe IPv6 prefix:

interface eth3
{
        AdvSendAdvert on;
        MinRtrAdvInterval 60;
        MaxRtrAdvInterval 180;
        AdvManagedFlag on;
        AdvOtherConfigFlag on;
        prefix 2001:DB8:C622:1::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        };
};
Follow these steps to configure the DHCP server for iPXE boot:

Procedure

1.

Create the required DHCP configuration files in the /etc/ directory.

Create dhcpd.conf for IPv4, IPv6, or both protocols. Create dhcpv6.conf for IPv6.

Store the network information in these files, including the script path, ISO image location, provisioning configuration location, chassis serial number, and chassis MAC address.

2.

For IPv4 identification by MAC address, add a host declaration to dhcpd.conf.

Example:

host ncs1001
{
hardware ethernet ab:cd:ef:01:23:45;
fixed-address <ip-address>;
filename "http://<http-server-address>/<path-to-image>/ncs1001-mini-x.iso";
}

The server can match the chassis MAC address to a fixed address and boot-image location.

3.

For IPv4 identification by serial number, add a host declaration that uses the DHCP client identifier.

The chassis derives its serial number from the BIOS and uses the value as an identifier.

Example:

host demo {
  option dhcp-client-identifier "<chassis-serial-number>";
  filename "http://<ip-address>/<hardware-platform>-mini-x.iso";
  fixed-address <ip-address>;
}

This example selects an ISO image for an iPXE client and a provisioning configuration for another client:

host 10.89.205.202 {
       hardware ethernet 40:55:39:56:0c:e8;
       if exists user-class and option user-class = "iPXE" {
          filename "http://10.89.205.127/box1/ncs1001-mini-x-7.1.1.iso";
       } else {
          filename "http://10.89.205.127/box1/StartupConfig.cfg";
       }
       fixed-address 10.89.205.202;
}
4.

For IPv6 identification by serial number, convert the serial number to a DHCP unique identifier (DUID) and add a DHCPv6 host declaration.

Obtain the chassis serial number from the show inventory command. Convert the serial number to the IPv6 DUID format before you add it to the host declaration.

Example:

host ncs1001 {
  host-identifier option dhcp6.client-id "<ipv6-duid>";
  filename "<http-or-tftp>://<ipv6-dhcp-server-address>/<hardware-platform>-mini-x.iso";
}

This example uses a documentation-safe IPv6 address:

host mys-p1b-212 {

   # PID: NCS1001-K9, VID: V01, SN: CAT2018B02M

   host-identifier option dhcp6.client-id 00:02:00:00:00:09:43:41:54:32:30:31:38:42:30:32:4d:00;

   if exists dhcp6.user-class and substring(option dhcp6.user-class, 2, 4) = "iPXE" {
     option dhcp6.bootfile-url "http://[2001:DB8:4491:2005::227:11]/rosco/mys-p1b-212/ncs1001-mini-mod.iso";
   }
   else {
     option dhcp6.bootfile-url "http://[2001:DB8:4491:2005::227:11]/rosco/mys-p1b-212/ztp.ipv6.sh";
   }
}
5.

Use a conversion script if you need to generate an enterprise-number-based DUID from the chassis serial number.

Example:

#! /bin/sh

# Comply with the IPv6 enterprise-number-based DUID format.
## 00:02 = Enterprise-number-based DUID
## 00:00:00:09 = Cisco enterprise number
## 00 = Terminator

SERIALNUMBER=$1
en_duid=0002
cisco_en=00000009

sn=`xxd -l11 -pu <<< ${SERIALNUMBER}`
null=00
DHCPv6_DUID=`sed 's/\(..\)/\1:/g;s/:$//' <<< ${en_duid}${cisco_en}${sn}${null}`

echo $DHCPv6_DUID
6.

After the DHCP server is running, test the applicable host declaration with the chassis.

A successful match provides the configured network address and boot-file location to the chassis.

The DHCP server provides an IPv4 or IPv6 address and the appropriate iPXE boot file to the chassis for network boot.


Boot the router through iPXE

Start the iPXE network boot process to download an ISO image and restore the router's operating system.

Before you begin

  • DHCP server is set and is running.

  • You have logged in to the System Admin console using the admin command.

Follow these steps to boot your router through iPXE:

Procedure

1.

Start the iPXE boot process.

Example:

hw-module location all bootmedia network reload

The router displays a confirmation prompt:

sysadmin-vm:0_RP0# hw-module location all bootmedia network reload
Wed Dec 23 15:29:57.376 UTC
Reload hardware module ? [no,yes]
This example shows the output of the command:
iPXE 1.0.0+ (3e573) -- Open Source Network Boot Firmware -- http://ipxe.org
Features: DNS HTTP TFTP VLAN EFI ISO9660 NBI Menu
Trying net0...
net0: c4:72:95:a6:14:e1 using dh8900cc on PCI01:00.1 (open)
[Link:up, TX:0 TXE:0 RX:0 RXE:0]
Configuring (net0 c4:72:95:a6:14:e1).................. Ok << Talking to DHCP/PXE server to obtain network information
net0: 10.37.1.101/255.255.0.0 gw 10.37.1.0
net0: fe80::c672:95ff:fea6:14e1/64
net0: 2001:DB8:5000:1:C672:95FF:FEA6:14E1/64 gw fe80::20c:29ff:fefb:b9fe
net1: fe80::c672:95ff:fea6:14e3/64 (inaccessible)
Next server: 10.37.1.235
Filename: http://10.37.1.235/ncs1001/ncs1001-mini-x.iso
http://10.37.1.235/ncs1001/ncs1001-mini-x.iso ncs1000/ncs1001-mini-x.iso... 58% << Downloading file as indicated by DHCP/PXE server to boot install image
2.

Enter yes at the confirmation prompt.

The chassis reloads and starts the iPXE network boot process.

The router downloads and installs the ISO image specified by the DHCP/PXE server, re-imaging the chassis and restoring normal operation.