This section provides a sample of configuring user-level rate limiting using the edit-config method.
Operation |
XPATH |
|---|---|
edit-config |
|
Item |
Data |
Description |
|---|---|---|
Whether user-level rate limiting is enabled |
true |
User-level rate limiting is enabled. |
Packet types to which user-level rate limiting applies |
eap, arp |
User-level rate limiting applies to 802.1X and ARP packets. |
Rate limit for specified MAC addresses |
MAC address 2: 02:00:00:22:22:aa; rate limit 2: 13 MAC address 1: 00:00:00:22:22:aa; rate limit 1: 12 |
The rate limit for the host with MAC address 00:00:00:22:22:aa is 12 pps. The rate limit for the host with MAC address 02:00:00:22:22:aa is 13 pps. |
User-level rate limit |
7 |
The user-level rate limit is 7 pps. |
Request Example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<hw-traffic:defend xmlns:hw-traffic="urn:huawei:params:xml:ns:yang:huawei-traffic">
<hw-traffic:host-car>
<hw-traffic:enable>true</hw-traffic:enable>
<hw-traffic:protocol>
<hw-traffic:protocol-typelist>
<hw-traffic:protocol-type>eap</hw-traffic:protocol-type>
</hw-traffic:protocol-typelist>
<hw-traffic:protocol-typelist>
<hw-traffic:protocol-type>arp</hw-traffic:protocol-type>
</hw-traffic:protocol-typelist>
</hw-traffic:protocol>
<hw-traffic:user>
<hw-traffic:user-list>
<hw-traffic:mac-address>02:00:00:22:22:aa</hw-traffic:mac-address>
<hw-traffic:threshold>13</hw-traffic:threshold>
</hw-traffic:user-list>
<hw-traffic:user-list>
<hw-traffic:mac-address>00:00:00:22:22:aa</hw-traffic:mac-address>
<hw-traffic:threshold>12</hw-traffic:threshold>
</hw-traffic:user-list>
</hw-traffic:user>
<hw-traffic:threshold>7</hw-traffic:threshold>
</hw-traffic:host-car>
</hw-traffic:defend>
</config>
</edit-config>
</rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"> <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="7">
<rpc-error>
<error-type>application</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-message>parse rpc config error.</error-message>
</rpc-error>
</rpc-reply>
Item |
Data |
Description |
|---|---|---|
Whether user-level rate limiting is disabled on an interface |
false |
User-level rate limiting is disabled on an interface. |
Request Example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="7" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<hw-traffic:defend xmlns:hw-traffic="urn:huawei:params:xml:ns:yang:huawei-traffic">
<hw-traffic:host-car>
<hw-traffic:enable>true</hw-traffic:enable>
</hw-traffic:host-car>
</hw-traffic:defend>
<if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<if:interface>
<if:name>GigabitEthernet1/4/0/1</if:name>
<if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
<hw-traffic:host-car xmlns:hw-traffic="urn:huawei:params:xml:ns:yang:huawei-traffic">
<hw-traffic:enable>false</hw-traffic:enable>
</hw-traffic:host-car>
</if:interface>
</if:interfaces>
</config>
</edit-config>
</rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"> <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="7">
<rpc-error>
<error-type>application</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-message>parse rpc config error.</error-message>
</rpc-error>
</rpc-reply>