Automatic IRF setup

Network requirements

As shown in Figure 10, Switch A and Switch B do not have a configuration file.

Configure the servers so the switches can obtain a Python script to complete their respective configurations and form an IRF fabric.

Figure 44: Network diagram

Configuration procedure

  1. Assign IP addresses to the interfaces. Make sure the devices can reach each other. (Details not shown.)

  2. Configure the following files on the HTTP server:

File

Content

Remarks

.cfg configuration file

Commands required for IRF setup.

You can create a configuration file by copying and modifying the configuration file of an existing IRF fabric.

sn.txt

Serial numbers of the member switches.

Each SN uniquely identifies a switch.

These SNs will be used for assigning a unique IRF member ID to each member switch.

(Optional.) .ipe or .bin software image file

Software images.

If the member switches are running different software versions, you must prepare the software image file used for software upgrade.

.py Python script file

Python commands and APIs that complete the following tasks:

  1. (Optional.) Verifies that the flash memory has sufficient space for the files to be downloaded.

  2. Downloads the configuration file and sn.txt.

  3. (Optional.) Downloads the software image file and specifies it as the main startup image file.

  4. Resolves sn.txt and assigns a unique IRF member ID to each SN.

  5. Specifies the configuration file as the main next-startup configuration file.

  6. Reboots the member switches.

For more information about Python script configuration, see "Using Python."

  1. Configure Device A as the DHCP server:

    # Enable DHCP.

    <DeviceA> system-view
    [DeviceA] dhcp enable
    

    # Configure address pool 1 to assign IP addresses on subnet 192.168.1.0/24 to clients.

    [DeviceA] dhcp server ip-pool 1
    [DeviceA-dhcp-pool-1] network 192.168.1.0 24
    

    # Enable the DHCP server on Ten-GigabitEthernet 1/0/1.

    [DeviceA] interface Ten-GigabitEthernet 1/0/1
    [DeviceA-Ten-GigabitEthernet1/0/1] dhcp select server
    [DeviceA-Ten-GigabitEthernet1/0/1] quit
    

    # Specify the URL of the script file for the clients.

    [DeviceA-dhcp-pool-1] bootfile-name http://192.168.1.40/device.py
    [DeviceA-dhcp-pool-1] quit
    
  2. Power on Switch A and Switch B.

    Switch A and Switch B will obtain the Python script file from the DHCP server and execute the script. After completing the IRF configuration, Switch A and Switch B reboot.

  3. After Switch A and Switch B start up again, use a cable to connect Switch A and Switch B through their IRF physical ports.

    Switch A and Switch B will elect a master member. The subordinate member will reboot to join the IRF fabric.

Verifying the configuration

# On Switch A, display IRF member devices. You can also use the display irf command on Switch B to display IRF member devices.

<Switch A> display irf
MemberID  Slot  Role    Priority  CPU-Mac         Description
   1      1     Standby 1         00e0-fc0f-8c02  ---
 *+2      1     Master  30        00e0-fc0f-8c14  ---
--------------------------------------------------
 * indicates the device is the master.
 + indicates the device through which the user logs in.

 The Bridge MAC of the IRF is: 000c-1000-1111
 Auto upgrade                : yes
 Mac persistent              : always
 Domain ID                   : 0
 Auto merge                  : yes

The output shows that the switches have formed an IRF fabric.