This section provides a sample of configuring ARP snooping using the config method.
Operation |
XPATH |
|---|---|
config |
/huawei-arp:system-config/arp-snooping-enable /ietf-interfaces:interfaces/interface/huawei-arp:arp-snooping-enable /huawei-vlan:vlans/vlan/huawei-arp:arp-snooping-enable |
Item |
Data |
Description |
|---|---|---|
Whether to enable ARP snooping globally |
true |
Enable ARP snooping globally. |
Whether to enable ARP snooping on an interface |
true |
Enable ARP snooping on an interface. |
Whether to enable ARP snooping in a VLAN |
true |
Enable ARP snooping in a VLAN. |
Enable ARP snooping globally.
<?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-arp:system-config xmlns:hw-arp="urn:huawei:params:xml:ns:yang:huawei-arp">
<hw-arp:arp-snooping-enable>true</hw-arp:arp-snooping-enable>
</hw-arp:system-config>
</config>
</edit-config>
</rpc>
Enable ARP snooping on an interface.
<?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>
<if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<if:interface>
<if:name>GigabitEthernet0/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-arp:arp-snooping-enable xmlns:hw-arp="urn:huawei:params:xml:ns:yang:huawei-arp">true</hw-arp:arp-snooping-enable>
</if:interface>
</if:interfaces>
</config>
</edit-config>
</rpc>
Enable ARP snooping in a VLAN.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<huawei-vlan:vlans xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
<huawei-vlan:vlan>
<huawei-vlan:id>2</huawei-vlan:id>
<hw-arp:arp-snooping-enable xmlns:hw-arp="urn:huawei:params:xml:ns:yang:huawei-arp">true</hw-arp:arp-snooping-enable>
</huawei-vlan:vlan>
</huawei-vlan:vlans>
</config>
</edit-config>
</rpc>
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="1"> <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="4">
<rpc-error>
<error-type>application</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-path>/ietf-interfaces:interfaces/interface[name='GigabitEthernet0/0/1']/type</error-path>
<error-message>parse rpc config error.(Failed to resolve identityref "ietf-interfaces:ethernetCsmacd".).</error-message>
</rpc-error>
</rpc-reply>