ARP Management
This section describes the configuration model of ARP and provides examples of XML packets.
Data Model
The configuration model files matching ARP are huawei-arp.yang and huawei-forward-traffic-security.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-arp:system-config/arp-snooping-enable |
Indicates whether to enable ARP snooping globally. |
The value is of the Boolean type:
By default, ARP snooping is disabled globally. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-arp:arp-snooping-enable |
Indicates whether to enable ARP snooping on an interface. |
The value is of the Boolean type:
By default, ARP snooping is disabled on an interface. |
N/A |
/huawei-vlan:vlans/vlan/huawei-arp:arp-snooping-enable |
Indicates whether to enable ARP snooping in a VLAN. |
The value is of the Boolean type:
By default, ARP snooping is disabled in a VLAN. |
N/A |
/huawei-traffic:arp-anti-attack/gateway-duplicate-enable |
Indicates whether to enable ARP gateway anti-collision. |
The value is of the Boolean type:
By default, ARP gateway anti-collision is disabled. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-traffic:arp-trust/source-config |
Indicates whether to enable ARP gateway protection for a specified IP address. |
The value is in dotted decimal notation. |
N/A |
/huawei-arp:arp-entry-get/get-num |
Indicates the maximum number of ARP entries queried at one time. |
The value is an integer. A maximum of 1024 ARP entries can be queried at a time. Even when the maximum value is set to larger than 1024, a maximum of 1024 entries can be queried at a time. |
N/A |
/huawei-arp:arp-entry-get/destination-address/ip-address |
Indicates the IPv4 address of ARP entries to be queried. |
The value is in dotted decimal notation. |
N/A |
/huawei-arp:arp-entry-get/destination-address/vpn-instance |
Indicates the VPN instance name of ARP entries to be queried. |
The value is a string of 1 to 31 case-sensitive characters without spaces. If the string is enclosed in double quotation marks ("), the string can contain spaces. |
N/A |
/huawei-arp:arp-entry-get/destination-address/interface |
Indicates the interface name of ARP entries to be queried. |
The value is a string of 1 to 64 characters. It consists of the interface type and interface number. |
N/A |
/huawei-arp:arp-entry-get/destination-address/search-type |
Indicates the ARP entry query criteria. |
The value is of the enumerated type:
|
N/A |
/huawei-arp:arp-entry-get/last-arp-details/last-ip-address |
Indicates the start IPv4 address of ARP entries with a specified range to be queried. |
The value is in dotted decimal notation. |
N/A |
/huawei-arp:arp-entry-get/last-arp-details/last-vpn-instance |
Indicates the start VPN instance name of ARP entries with a specified range to be queried. |
The value is a string of 1 to 31 case-sensitive characters without spaces. If the string is enclosed in double quotation marks ("), the string can contain spaces. |
N/A |
/huawei-arp:arp-entry-get/last-arp-details/last-interface |
Indicates the start outbound interface name of ARP entries with a specified range to be queried. |
The value is a string of 1 to 64 characters. It consists of the interface type and interface number. |
N/A |
/huawei-arp:arp-entry-get/last-arp-details/last-l3-interface |
Indicates the start Layer 3 interface name of ARP entries with a specified range to be queried. |
The value is a string of 1 to 64 characters. It consists of the interface type and interface number. |
N/A |
/huawei-arp:arp-entry-get/last-arp-details/last-search-type |
Indicates the query criteria for ARP entries with a specified range. |
The value is of the enumerated type:
|
N/A |
/huawei-arp:arp-entry-get/last-arp-details/last-entry-type |
Indicates the type of ARP entries with a specified range to be queried. |
The value is of the enumerated type:
|
N/A |
Object |
Description |
---|---|
/huawei-arp:arp-entry-get/arp-entry-details/ip-address |
Indicates the IPv4 address in an ARP entry. |
/huawei-arp:arp-entry-get/arp-entry-details/vpn-instance |
Indicates the VPN instance name in an ARP entry. |
/huawei-arp:arp-entry-get/arp-entry-details/mac-address |
Indicates the MAC address in an ARP entry. |
/huawei-arp:arp-entry-get/arp-entry-details/peVid |
Indicates the outer VLAN ID in an ARP entry. |
/huawei-arp:arp-entry-get/arp-entry-details/ceVid |
Indicates the inner VLAN ID in an ARP entry. |
/huawei-arp:arp-entry-get/arp-entry-details/forwarding-interface |
Indicates the outbound interface name in an ARP entry. |
/huawei-arp:arp-entry-get/arp-entry-details/forwarding-l3-interface |
Indicates the Layer 3 interface name in an ARP entry. |
/huawei-arp:arp-entry-get/arp-entry-details/expireTime |
Indicates the aging time of an ARP entry. The value is an integer, in seconds. |
/huawei-arp:arp-entry-get/arp-entry-details/entry-type |
Indicates the type of an ARP entry.
|
/huawei-arp:arp-entry-get/summary |
Total number of ARP entries that meet the filtering condition. |
/huawei-arp:arp-entry-get/has-more |
Indicates the query status.
|
Configuring ARP Snooping
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 |
Data Requirements
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. |
Request Example
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>GigabitEthernet1/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>
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="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='GigabitEthernet1/0/1']/type</error-path> <error-message>parse rpc config error.(Failed to resolve identityref "ietf-interfaces:ethernetCsmacd".).</error-message> </rpc-error> </rpc-reply>
Querying ARP Entries
This section provides a sample of querying ARP entries using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
Data Requirements
Item |
Data |
Description |
---|---|---|
Maximum number of ARP entries that can be queried |
1 |
Only one ARP entry can be queried. |
IPv4 address in an ARP entry |
10.1.1.1 |
ARP entries with a specified IPv4 address 10.1.1.1 are queried. |
ARP entry query criteria |
ip-address |
ARP entries are queried based on the IPv4 address. |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <arp-entry-get xmlns="urn:huawei:params:xml:ns:yang:huawei-arp"> <get-num>1</get-num> <destination-address> <ip-address>10.1.1.1</ip-address> <search-type>ip-address</search-type> </destination-address> </arp-entry-get> </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="10"> <arp-entry-get xmlns="urn:huawei:params:xml:ns:yang:huawei-arp"> <arp-entry-details> <ip-address>10.1.1.1</ip-address> <vpn-instance>1</vpn-instance> <mac-address>d8:49:0b:94:27:ee</mac-address> <peVid>-</peVid> <ceVid>-</ceVid> <forwarding-interface>GigabitEthernet1/0/1</forwarding-interface> <forwarding-l3-interface>GigabitEthernet1/0/1</forwarding-l3-interface> <expireTime>1199</expireTime> <entry-type>dynamic</entry-type> </arp-entry-details> <has-more>false</has-more> </arp-entry-get> </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="15"> <arp-entry-get xmlns="urn:huawei:params:xml:ns:yang:huawei-arp"> <has-more>false</has-more> </arp-entry-get> </rpc-reply>