< Home

Configuring DHCP Options as User Names for MAC Address Authentication

This section provides a sample of configuring DHCP options as user names for MAC address authentication using the merge method.

Table 1 Configuring DHCP options as user names for MAC address authentication

Operation

XPATH

edit-config:merge

/huawei-nac-mac:mac-access/configure-mode/unified-mode/mac-access-profile/dhcp-option-format

Data Requirements

Table 2 Configuring DHCP options as user names for MAC address authentication

Item

Data

Description

name

test

Configure the MAC access profile named test.

dhcp-option-format

option82-circuit-id

Set the user name for MAC address authentication to a specified DHCP option.

separate

#

Set the delimiter in the user name of MAC address authentication to #.

code-format

format-hex

Set the user name for MAC address authentication in hexadecimal format.

password

huawei@123

Set the password for MAC address authentication to huawei@123.

Request Example

<rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <hw-nac-mac:mac-access xmlns:hw-nac-mac="urn:huawei:params:xml:ns:yang:huawei-nac-mac">
        <hw-nac-mac:mac-access-profile>
          <hw-nac-mac:name>test</hw-nac-mac:name>
          <hw-nac-mac:dhcp-option-format>option82-circuit-id</hw-nac-mac:dhcp-option-format>
          <hw-nac-mac:separate>#</hw-nac-mac:separate>
          <hw-nac-mac:code-format>format-hex</hw-nac-mac:code-format>
          <hw-nac-mac:password>huawei@123</hw-nac-mac:password>
        </hw-nac-mac:mac-access-profile>
      </hw-nac-mac:mac-access>
    </config>
  </edit-config>
</rpc>

Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0">
 <ok/>
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-path>/huawei-nac-mac:mac-access/mac-access-profile[name='laoyu']/dhcp-option-format</error-path>
    <error-message>parse rpc config error.(Invalid value "circuit-id" in "dhcp-option-format" element.).</error-message>
  </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >