< Home

(Optional) Configuring a Configuration File for a DHCP Client

Context

DHCP can be used to deliver configuration files to clients that require them for startup. You can save the configuration files on the DHCP server or specify the IP address of a dedicated file server. When a configuration file exists on a dedicated file server, the DHCP server needs to specify the IP address of the file server for clients. You can also specify an IP address for the file server by configuring user-defined options for clients.

If the startup configuration file is saved on a file server, the route between the DHCP client and file server must be reachable.

Procedure

  • Configure a configuration file based on an interface address pool.
    1. Enter the system view.

      system-view 

    2. Enter the interface or sub-interface view.

      interface interface-type interface-number[.subinterface-number ]

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731S-H, S5731-S, S5731S-S, S6720-HI, S5732-H, S6730-H, S6730S-H, S6730-S, S6730S-S, S6720-EI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.

    4. Specify the name of the configuration file.

      dhcp server bootfile bootfile

      By default, the name is not configured.

    5. Specify the name of the server that hosts the configuration file.

      dhcp server sname sname

      By default, the name of the server is not configured.

    6. (Optional) Specify the IP address of the file server that hosts the configuration file.

      dhcp server next-server ip-address

      By default, the file server IP address is not configured.

  • Configure a configuration file based on a global address pool.

    1. Enter the system view.

      system-view
    2. Enter the global address pool view.

      ip pool ip-pool-name
    3. Specify the name of the configuration file.

      bootfile bootfile

      By default, the name is not configured.

    4. Specify the name of the server that hosts the configuration file.

      sname sname

      By default, the name of the server is not configured.

    5. Specify the IP address of the file server that hosts the configuration file.

      next-server ip-address 

      By default, the file server IP address is not configured.

  • In the DHCP Option template view:

    1. Enter the system view.

      system-view
    2. Create a DHCP Option template and enter the DHCP Option template view.

      dhcp option template template-name

      By default, no DHCP Option template is created.

      To allocate network parameters except IP addresses to static clients, configure a DHCP Option template. Network parameters configured in the DHCP Option template view take effect only for static clients. For static clients, if a network parameter is configured in both the DHCP Option template view and global address pool view, only the configuration in the DHCP Option template view takes effect.

      To allocate only IP addresses to static clients (for details, see (Optional) Configuring Fixed IP Addresses in an Address Pool), you do not need to configure a DHCP Option template.

    3. Specify the name of the configuration file.

      bootfile bootfile

      By default, the name of the startup configuration file for DHCP clients is not configured.

    4. Specify the name of the server that hosts the configuration file.

      sname sname

      By default, the name of the server from which a DHCP client obtains the startup configuration file is not configured.

    5. (Optional) Specify the name of the server that hosts the configuration file.

      next-server ip-address

      By default, the server IP address is not configured for the client after the client automatically obtains the IP address.

      If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.

    6. (Optional) Return to the system view.
      quit
    7. (Optional) Enter the global address pool view.
      ip pool ip-pool-name
    8. (Optional) Bind a DHCP Option template to static clients.
      static-bind ip-address ip-address mac-address mac-address option-template template-name

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >