< Home

(Optional) Configuring User-defined Options

Context

Vendors can define DHCP options. The device can function as a DHCP server to allocate vendor-defined network parameters to clients. When the device functions as a DHCP Server, it can allocate network parameters to clients based on the Option fields in the requests from the clients.

The device inserts an option configured using the dhcp server option (based on an interface address pool) or option (based on a global address pool) command into DHCP Reply messages to be sent to a client only when the client requests this option.

When a global address pool is used to allocate network parameters, configuration commands are different for dynamic and static DHCP clients.

Procedure

  • Configure user-defined options based on an interface address pool.
    1. Enter the system view.

      system-view

    2. (Optional) Enable the DHCP server to trust Option 82.

      dhcp server trust option82

      By default, the device is enabled to trust Option 82.

    3. Enter the interface view.

      interface interface-type interface-number

    4. Configure user-defined options.

      dhcp server option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }

      By default, no user-defined option is configured.

      If an option carries a password, the option code in ascii or hex type is insecure. Therefore, you are advised to set the option code type to cipher. For security purposes, use a password that is at least six characters long and contains at least two types of the following: lowercase letters, uppercase letters, digits, and special characters.

      After an option is configured, the device inserts the option into DHCP Reply messages to be sent to clients only when the clients request this option.

      Not all options can be configured using the preceding command. The following table lists the options and their commands.
      Table 1 Commands for configuring options

      Option

      Configuration Command

      Description

      Option1

      mask-length in the ip address ip-address { mask | mask-length } command

      Subnet mask

      Option3

      ip-address in the ip address ip-address { mask | mask-length } command

      Gateway address

      Option6

      dhcp server dns-list ip-address &<1-8>

      DNS server IP address

      Option15

      dhcp server domain-name (interface view) domain-name

      Domain name

      Option44

      dhcp server nbns-list ip-address &<1-8>

      NetBIOS server IP address

      Option46

      dhcp server netbios-type { b-node | h-node | m-node | p-node }

      NetBIOS node type

      Option50

      N/A

      Requested IP address

      Option51

      dhcp server lease { day day [ hour hour [ minute minute ] ] | unlimited }

      IP address lease

      Option52

      N/A

      Additional option

      Option53

      N/A

      DHCP message type

      Option54

      N/A

      Server identifier

      Option55

      N/A

      Parameter request list

      Option57

      N/A

      Maximum length of a DHCP message

      Option58

      N/A

      Lease renewal time (T1), which is 50% of the lease time

      Option59

      N/A

      Lease renewal time (T2), which is 87.5% of the lease time

      Option61

      N/A

      Client identifier

      Option82

      N/A

      Relay agent information

      Option120

      dhcp server sip-server { ip-address ip-address &<1-2> | list domain-name &<1-2> }

      SIP server IP address

      Option121

      dhcp server option121 ip-address { ip-address mask-length gateway-address } &<1-8>

      A group of classless routes

      Option184

      dhcp server option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }

      Voice parameters

  • Configure user-defined options based on a global address pool.

    • In the global address pool view:

      1. Enter the system view.
        system-view
      2. (Optional) Enable the DHCP server to trust Option 82.

        dhcp server trust option82

        By default, the device is enabled to trust Option 82.

      3. Enter the global address pool view.
        ip pool ip-pool-name
      4. Configure user-defined options.

        option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }

        By default, no user-defined option is configured.

        If an option carries a password, the option code in ascii or hex type is insecure. Therefore, you are advised to set the option code type to cipher. For security purposes, use a password that is at least six characters long and contains at least two types of the following: lowercase letters, uppercase letters, digits, and special characters.

        Not all options can be configured using the preceding command. The following table lists the options and their commands.
        Table 2 Commands for configuring options

        Option

        Configuration Command

        Description

        Option1

        mask-length in the network (IP address pool view) ip-address [ mask { mask | mask-length } ]

        Subnet mask

        Option3

        gateway-list ip-address &<1-8>

        Gateway address

        Option6

        dns-list ip-address &<1-8>

        DNS server IP address

        Option15

        domain-name domain-name

        Domain name suffix

        Option44

        nbns-list ip-address &<1-8>

        NetBIOS server IP address

        Option46

        netbios-type { b-node | h-node | m-node | p-node }

        NetBIOS node type

        Option50

        N/A

        Requested IP address

        Option51

        lease { day day [ hour hour [ minute minute ] ] | unlimited }

        IP address lease

        Option52

        N/A

        Additional option

        Option53

        N/A

        DHCP message type

        Option54

        N/A

        Server identifier

        Option55

        N/A

        Parameter request list

        Option57

        N/A

        Maximum length of a DHCP message

        Option58

        N/A

        Lease renewal time (T1), which is 50% of the lease time

        Option59

        N/A

        Lease renewal time (T2), which is 87.5% of the lease time

        Option61

        N/A

        Client identifier

        Option82

        N/A

        Relay agent information

        Option120

        sip-server { ip-address ip-address &<1-2> | list domain-name &<1-2> }

        SIP server IP address

        Option121

        option121 ip-address { ip-address mask-length gateway-address } &<1-8>

        A group of classless routes

        Option184

        option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }

        Voice parameters

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