This section provides a sample of configuring the device to send DHCP option information to the authentication server when triggering MAC address authentication through DHCP packets using the merge method.
Operation |
XPATH |
---|---|
edit-config:merge |
/huawei-nac-mac:mac-access/configure-mode/unified-mode/mac-access-profile/get-dhcp-option |
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. |
get-dhcp-option |
option-82 |
Send DHCP option information to the authentication server. |
<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:get-dhcp-option>option-82</hw-nac-mac:get-dhcp-option> </hw-nac-mac:mac-access-profile> </hw-nac-mac:mac-access> </config> </edit-config> </rpc>
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="1"> <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']/get-dhcp-option[.='option-16']</error-path> <error-message>parse rpc config error.(Invalid value "option-16" in "get-dhcp-option" element.).</error-message> </rpc-error> </rpc-reply>