This section provides a sample of configuring port attack defense using the edit-config method.
Operation |
XPATH |
---|---|
edit-config |
|
Item |
Data |
Description |
---|---|---|
Name of the attack defense policy |
test |
The name of the attack defense policy is test. |
Whether port attack defense is enabled |
true |
Port attack defense is enabled. |
Policy application mode |
all |
The attack defense policy test is applied to all cards of a device. |
Protocols to which port attack defense is applied. |
dhcp |
Port attack defense is applied to DHCP packets. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="6" 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:policy> <hw-traffic:policy-list> <hw-traffic:name>test</hw-traffic:name> <hw-traffic:auto-port-defend> <hw-traffic:enable>true</hw-traffic:enable> <hw-traffic:protocol> <hw-traffic:protocol-port-type-list> <hw-traffic:protocol-port-type>dhcp</hw-traffic:protocol-port-type> </hw-traffic:protocol-port-type-list> </hw-traffic:protocol> </hw-traffic:auto-port-defend> <hw-traffic:apply-list> <hw-traffic:applied-type>all</hw-traffic:applied-type> </hw-traffic:apply-list> </hw-traffic:policy-list> </hw-traffic:policy> </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>