No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R011C10 NETCONF YANG API Reference

This document describes the NETCONF API functions supported by the switch, including the data model and samples.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
MAC Address Table Query

MAC Address Table Query

This section describes the configuration model of MAC address table query and provides examples of XML packets.

Data Model

The configuration model file matching MAC address table query is huawei-mac.yang.

Table 2-127  Querying the MAC address table

Object

Description

Value Range

Remarks

huawei-mac: mac-address-table-get/get-num

Indicates the maximum number of MAC address entries queried at one time.

The value is an integer that ranges from 1 to 1024. Even when the value is larger than 1024, a maximum of 1024 entries can be queried.

NA

huawei-mac: mac-address-table-get / destination-address/mac-address

Indicates the MAC address.

The value is in HH:HH:HH:HH:HH:HH format. An H is a hexadecimal number of 1 digit. The MAC address cannot be FF:FF:FF:FF:FF:FF, 00:00:00:00:00:00, or a multicast MAC address.

NA

huawei-mac: mac-address-table-get / destination-address/id-type

Indicates the MAC address type.

Enumerated value:
  • VLAN
  • VSI

NA

huawei-mac: mac-address-table-get / destination-address/id

Indicates the VLAN ID or VSI name of the MAC address.

  • When the value of id-type is VLAN, id is a VLAN ID. The value is an integer that ranges from 1 to 4096.
  • When the value of id-type is VSI, id is a VSI name. 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.

NA

huawei-mac: mac-address-table-get / destination-address/interface

Indicates the interface name.

The value is a string of 1 to 64 characters. It consists of the interface type and interface number.

NA

huawei-mac: mac-address-table-get / destination-address/search-type

Indicates the MAC address search criteria.

Enumerated type:
  • interface: MAC address entries are queried based on the interface.
  • vlan: MAC address entries are queried based on the VLAN ID.
  • mac: MAC address entries are queried based on the specified MAC address.
  • all: All MAC address entries are queried.

NA

huawei-mac: mac-address-table-get / last-mac-address-details/last-mac-address

Indicates that MAC addresses with a specified range are queried.

The value is in HH:HH:HH:HH:HH:HH format. An H is a hexadecimal number of 1 digit. The MAC address cannot be FF:FF:FF:FF:FF:FF, 00:00:00:00:00:00, or a multicast MAC address.

NA

huawei-mac: mac-address-table-get / last-mac-address-details/last-id-type

Indicates the type of MAC addresses with a specified range to be queried.

Enumerated value:
  • VLAN
  • VSI

NA

huawei-mac: mac-address-table-get / last-mac-address-details/last-id

Indicates the VLAN ID or VSI name of MAC addresses with a specified range to be queried.

  • When the value of last-id-type is VLAN, last-id is a VLAN ID. The value is an integer that ranges from 1 to 4096.
  • When the value of last-id-type is VSI, last-id is a VSI name. 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.

NA

huawei-mac: mac-address-table-get / last-mac-address-details/interface

Indicates the name of an interface where detailed MAC address entry information is queried.

The value is a string of 1 to 64 characters. It consists of the interface type and interface number.

NA

huawei-mac: mac-address-table-get / last-mac-address-details/search-type

Indicates the search criteria for querying MAC address entry information.

Enumerated value:
  • interface: MAC address entries are queried based on the interface.
  • vlan: MAC address entries are queried based on the VLAN ID.
  • mac: MAC address entries are queried based on the specified MAC address.
  • all: All MAC address entries are queried.

NA

huawei-mac: mac-address-table-get/ mac-address-details/mac-address

Indicates the MAC address of which MAC address entry information is queried.

The value is in HH:HH:HH:HH:HH:HH format. An H is a hexadecimal number of 1 digit. The MAC address cannot be FF:FF:FF:FF:FF:FF, 00:00:00:00:00:00, or a multicast MAC address.

NA

huawei-mac: mac-address-table-get/ mac-address-details/id-type

Indicates the type of the MAC address of which MAC address entry information is queried.

Enumerated value:
  • VLAN
  • VSI

NA

huawei-mac: mac-address-table-get/ mac-address-details/id

Indicates the VLAN ID or VSI name of the MAC address of which MAC address entry information is queried.

  • When the value of id-type is VLAN, id is a VLAN ID. The value is an integer that ranges from 1 to 4096.
  • When the value of id-type is VSI, id is a VSI name. 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.

NA

huawei-mac: mac-address-table-get/ mac-address-details/mac-type

Indicates the type of MAC address entries.

Enumerated value. The values are as follows:
  • static: indicates a static MAC address entry, which is manually configured and will not be aged out.
  • blackhole: indicates a blackhole MAC address entry, which is manually configured and will not be aged out.
  • dynamic: indicates a MAC address entry learned by the device. Dynamic MAC address entries can be aged.
  • security: indicates a MAC address entry that an interface learns after port security is enabled.
  • sec-config: indicates a static secure MAC address entry configured by using the port-security mac-address command.
  • sticky: indicates a MAC address entry that an interface learns after the sticky MAC function is enabled.
  • mux: indicates a MAC address entry learned by an interface enabled with MUX VLAN.
  • snooping: indicates a static MAC address entry that is generated based on the DHCP snooping binding table.
  • authen: indicates a MAC address entry corresponding to the NAC authentication user that obtains an IP address (excluding the Layer 3 authentication user of which the MAC address cannot be generated and wireless user in direct forwarding mode).
  • pre-authen: indicates a MAC address entry corresponding to a user that is in pre-connection state and does not obtain an IP address after NAC authentication is enabled.

NA

huawei-mac: mac-address-table-get/ mac-address-details/forwarding-interface

Indicates the queried interface information.

The value is a string of 1 to 64 characters. It consists of the interface type and interface number.

NA

huawei-mac: mac-address-table-get/has-more

Query status.

Boolean value:
  • true: MAC address information can still be queried.
  • false: Query ends.

NA

Querying the MAC Address Table

This section describes how to query the MAC address table using the rpc method.

Table 2-128  Querying the MAC address table

Operation

XPATH

rpc

/huawei-mac:mac-address-table-get

Data Requirement

Item

Data

Description

Maximum number of MAC address entries

1

Only one MAC address entry is queried.

MAC address

00:00:c0:06:d3:00

MAC address entries with the specified MAC address are queried.

MAC address type

vlan

The MAC address type is VLAN.

VLAN ID

1

The VLAN that the MAC address belongs to is VLAN 1.

Interface name

GigabitEthernet0/0/24

The interface that the MAC address belongs to is GigabitEthernet0/0/24.

Query type

mac

MAC address entries are queried based on MAC addresses.

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5149ccae-4028-11e7-b553-f0be7a3afb52">
	<huawei-mac:mac-address-table-get xmlns:huawei-mac="urn:huawei:params:xml:ns:yang:huawei-mac">
		<huawei-mac:get-num>1</huawei-mac:get-num>
		<huawei-mac:destination-address>
			<huawei-mac:mac-address>00:00:c0:06:d3:00</huawei-mac:mac-address>
			<huawei-mac:id-type>vlan</huawei-mac:id-type>
			<huawei-mac:id>1</huawei-mac:id>
			<huawei-mac:interface>GigabitEthernet0/0/24</huawei-mac:interface>
			<huawei-mac:search-type>mac</huawei-mac:search-type>
		</huawei-mac:destination-address>
	</huawei-mac:mac-address-table-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="7d83014f-4048-11e7-86a3-f0be7a3afb52">
	<data>
		<mac-address-table-get xmlns="urn:huawei:params:xml:ns:yang:huawei-mac">   
			<mac-address-details>
				<mac-address>00:00:c0:06:d3:00</mac-address>
				<id>1</id>
				<forwarding-interface>GigabitEthernet0/0/24</forwarding-interface>
				<id-type>vlan</id-type>
				<mac-type>dynamic</mac-type>
			</mac-address-details>
			<has-more>false</has-more>
		</mac-address-table-get>
	</data>
</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="5149ccae-4028-11e7-b553-f0be7a3afb52">
	<data>
		<mac-address-table-get xmlns="urn:huawei:params:xml:ns:yang:huawei-mac">
			<has-more>false</has-more>
		</mac-address-table-get>
	</data>
</rpc-reply>
Translation
Download
Updated: 2019-10-18

Document ID: EDOC1000178028

Views: 5006

Downloads: 0

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next