This section provides a sample of creating an authentication-free rule profile using the merge method. You can also use the create method to create an authentication-free rule profile.
Operation |
XPATH |
|---|---|
edit-config:merge |
/huawei-nac/nac-access/authentication-free-rule-profile/name |
| Item | Data | Description |
|---|---|---|
| name | default_free_rule | Create the authentication-free rule profile default_free_rule. |
| ipv4-acl | 6000 | Configure an authentication-free rule defined by ACL. |
| rule-id | 1 | Configure a common authentication-free rule. |
| destination | any |
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_012824316d704d43adb16b1a4245d273">
<edit-config>
<target>
<running/>
</target>
<error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<nac-access xmlns="urn:huawei:params:xml:ns:yang:huawei-nac" xc:operation="replace">
<authentication-free-rule-profile>
<name>default_free_rule</name>
<free-acl>
<ipv4-acl>6000</ipv4-acl>
</free-acl>
</authentication-free-rule-profile>
</nac-access>
</config>
</edit-config>
</rpc>
# Configure a common authentication-free rule.
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_012824316d704d43adb16b1a4245d273">
<edit-config>
<target>
<running/>
</target>
<error-option>rollback-on-error</error-option>
<config>
<nac-access xmlns="urn:huawei:params:xml:ns:yang:huawei-nac">
<authentication-free-rule-profile xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
<name>default_free_rule</name>
<free-rule>
<rule-id>1</rule-id>
<destination>
<any>any</any>
</destination>
</free-rule>
</authentication-free-rule-profile>
</nac-access>
</config>
</edit-config>
</rpc>
# Sample of successful response.
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_012824316d704d43adb16b1a4245d273"> <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="45">
<rpc-error>
<error-app-tag>-1</error-app-tag>
<error-message>Free-rule-template name cmd executing failed.</error-message>
<error-info>Error on node /huawei-nac:nac-access/authentication-free-rule-profile[name="default_free_rule1"]/name</error-info>
</rpc-error>
</rpc-reply>