This section provides a sample of configuring MAC addresses as user names for MAC address authentication using the merge method. You can also use the create method to configure MAC addresses as user names for MAC address authentication.
Operation |
XPATH |
---|---|
edit-config:merge |
/huawei-nac-mac:mac-access/configure-mode/unified-mode/mac-access-profile/user-name-format/mac-address/mac-address-format |
Item |
Data |
Description |
---|---|---|
name |
test |
Configure MAC addresses as user names for MAC address authentication. The MAC access profile must exist on the switch. |
mac-address-format |
with-hyphen-normal |
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="43a8e485-35d2-499e-895c-e2d2d5f555a8"> <edit-config> <target> <running/> </target> <error-option>rollback-on-error</error-option> <config> <mac-access xmlns="urn:huawei:params:xml:ns:yang:huawei-nac-mac"> <mac-access-profile> <name>test</name> <mac-address-format>with-hyphen-normal</mac-address-format> </mac-access-profile> </mac-access> </config> </edit-config> </rpc>
Sample of successful response
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="43a8e485-35d2-499e-895c-e2d2d5f555a8"> <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="11"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>CMD is incomplete, para fixed or macaddress must have one.</error-message> <error-info>Error on node /huawei-nac-mac:mac-access/mac-access-profile[name="mactest"]/letter</error-info> </rpc-error> </rpc-reply>