FDB-Netconf
此内容尚不支持你的语言。
Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /fdb | Y | merge | — |
| /fdb/fdb-entry/{vlan-id}/{mac-address} | Y | merge, replace, create, delete | — |
| /show-mac-address | — | — | Y |
| /show-mac-learning | — | — | Y |
| clear-mac-address | — | — | Y |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage FDB configurations on AsterNOS devices.
Get All Static FDB Entries
Section titled “Get All Static FDB Entries”Dynamic learned FDB entries cannot be retrieved via get-config. To get dynamic learned FDB entries, please refer to rpc show-mac-address. aging-time is 1800 seconds by default.
Request example to get all static FDB entries via get-config with subtree filter.
<filter type="subtree"> <top> <fdb/> </top></filter>Response example
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <top> <fdb xmlns="http://asterfusion.com/ns/yang/asternos-fdb"> <aging-time>300</aging-time> <fdb-entries> <fdb-entry> <mac-address>12:34:56:78:9a:bc</mac-address> <vlan-id>1000</vlan-id> <type>static</type> <port>Ethernet1</port> </fdb-entry> <fdb-entry> <mac-address>ee:ee:ee:ee:ee:ee</mac-address> <vlan-id>1001</vlan-id> <type>static</type> <blackhole>true</blackhole> </fdb-entry> <fdb-entry> <mac-address>cc:cc:cc:cc:cc:cc</mac-address> <vlan-id>1002</vlan-id> <type>static</type> <port>PortChannel0002</port> </fdb-entry> </fdb-entries> </fdb> </top></data>Get All FDB Entries on device
Section titled “Get All FDB Entries on device”Both static and dynamic learned FDB entries will be retrieved.
Request example to get all FDB entries via rpc show-mac-address
<show-mac-address> <interface-type>all</interface-type></show-mac-address>Response example
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <fdb-entries> <fdb-entry> <mac-address>00:11:22:33:44:55</mac-address> <vlan-id>1000</vlan-id> <type>dynamic</type> <port>Ethernet1</port> </fdb-entry> <fdb-entry> <mac-address>66:77:88:99:aa:bb</mac-address> <vlan-id>1001</vlan-id> <type>dynamic</type> <port>Ethernet2</port> </fdb-entry> <fdb-entry> <mac-address>dd:dd:dd:dd:dd:dd</mac-address> <vlan-id>1002</vlan-id> <type>dynamic</type> <port>PortChannel0001</port> </fdb-entry> </fdb-entries></data>Clear All FDB Entries on device
Section titled “Clear All FDB Entries on device”Request example to clear all FDB via rpc clear-mac-address.
<rpc> <clear-mac-address/></rpc>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0435992a-fec6-45d5-ae5b-56f8d584d952"> <data xmlns="http://asterfusion.com/ns/yang/asternos-fdb">FDB entries are cleared.</data></rpc-reply>Show MAC Learning Information
Section titled “Show MAC Learning Information”Request example to show mac learning info via rpc show-mac-learning.
<rpc> <show-mac-learning/></rpc>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c9c752c1-1331-4fc1-9567-a37c596ef20c"> <data xmlns="http://asterfusion.com/ns/yang/asternos-fdb"> Interface Mac-learning ----------- -------------- Ethernet1 enable Ethernet2 enable Ethernet3 enable Ethernet4 enable Ethernet5 enable Ethernet6 enable Ethernet7 enable Ethernet8 enable Ethernet9 enable Ethernet10 enable </data></rpc-reply>Create Static/Blackhole MAC in FDB
Section titled “Create Static/Blackhole MAC in FDB”Request example to create static MAC or blackhole MAC via edit-config.
The VLAN must be created before port switch to L2.
<config> <top> <fdb xmlns="http://asterfusion.com/ns/yang/asternos-fdb"> <aging-time>4000</aging-time> <fdb-entry> <mac-address>12:34:56:78:9a:bc</mac-address> <vlan-id>100</vlan-id> <type>static</type> <port>Ethernet1</port> </fdb-entry> <fdb-entry> <mac-address>ee:ee:ee:ee:ee:ee</mac-address> <vlan-id>123</vlan-id> <type>static</type> <blackhole>true</blackhole> </fdb-entry> <fdb-entry> <mac-address>cc:cc:cc:cc:cc:cc</mac-address> <vlan-id>102</vlan-id> <type>static</type> <port>PortChannel0001</port> </fdb-entry> </fdb> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c6c88e9e-79fe-4633-9249-cedcfe32aea7"> <ok/></rpc-reply>Delete Static/Blackhole MAC in FDB
Section titled “Delete Static/Blackhole MAC in FDB”Request example to delete static MAC or blackhole MAC via edit-config.
<config> <top> <fdb xmlns="http://asterfusion.com/ns/yang/asternos-fdb"> <fdb-entry operation="delete"> <mac-address>12:34:56:78:9a:bc</mac-address> <vlan-id>100</vlan-id> </fdb-entry> <fdb-entry operation="delete"> <mac-address>ee:ee:ee:ee:ee:ee</mac-address> <vlan-id>123</vlan-id> </fdb-entry> </fdb> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c6c88e9e-79fe-4633-9249-cedcfe32aea7"> <ok/></rpc-reply>Properties Descriptions
Section titled “Properties Descriptions”Tree Diagram
module: asternos-fdb +--rw fdb +--rw fdb-entry* [vlan-id mac-address] | +--rw mac-address yang:mac-address | +--rw vlan-id uint16 | +--ro type? enumeration | +--rw (outer-if-type) | +--:(port) | | +--rw port? fdb-outif-interface-name | +--:(blackhole) | +--rw blackhole? boolean +--rw aging-time? unionTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| fdb | M | Path-only node, has no configurable value. | |
| fdb-entry | M | Path-only node, has no configurable value. | |
| mac-address | O | yang:mac-address | MAC address for the fdb entry |
| vlan-id | O | 1..4094 | |
| type | O | ”static" "dynamic” | The type of fdb |
| port | O | Ethernet name | The name of the port |
| blackhole | O | ”true" "false” | Configure blackhole mac address |
| aging-time | O | 30..7200 ”never” | Mac aging time, default is 1800 seconds Default value: 600 |
Fdb Entry
Section titled “Fdb Entry”Tree Diagram
module: asternos-fdb +--rw fdb +--rw fdb-entry* [vlan-id mac-address] +--rw mac-address yang:mac-address +--rw vlan-id uint16 +--ro type? enumeration +--rw (outer-if-type) +--:(port) | +--rw port? fdb-outif-interface-name +--:(blackhole) +--rw blackhole? booleanTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| fdb-entry | M | Path-only node, has no configurable value. | |
| mac-address | O | yang:mac-address | MAC address for the fdb entry |
| vlan-id | O | 1..4094 | |
| type | O | ”static" "dynamic” | The type of fdb |
| port | O | Ethernet name | The name of the port |
| blackhole | O | ”true" "false” | Configure blackhole mac address |
Show Mac Address
Section titled “Show Mac Address”Tree Diagram
module: asternos-fdb
rpcs: +---x show-mac-address +---w input | +---w interface-name? union +--ro output +--ro data +--ro mac-address-info* [] | +--ro mac-address? yang:mac-address | +--ro vlan-id? uint16 | +--ro type? enumeration | +--ro port? string | +--ro index? uint32 +--ro aging-time? unionTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-mac-address | O | ||
| interface-name | O | Ethernet name | Name of the Ethernet or PortChannel or VLAN. |
| data | M | Path-only node, has no configurable value. A hierarchy of MAC address information include a list named mac-address-info and a leaf named aging-time. | |
| mac-address-info | M | Path-only node, has no configurable value. A table that show information of mac address | |
| mac-address | O | yang:mac-address | MAC address for the fdb entry |
| vlan-id | O | 1..4094 | |
| type | O | ”static" "dynamic” | The type of fdb |
| port | O | string | The name of the port |
| index | O | integer | |
| aging-time | O | 30..7200 ”never” | Mac aging time, default is 1800 seconds Default value: 1800 |
Show Mac Learning
Section titled “Show Mac Learning”Tree Diagram
module: asternos-fdb
rpcs: +---x show-mac-learning +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-mac-learning | O | ||
| data | O | A table that shows MAC learning information |
Clear Mac Address
Section titled “Clear Mac Address”Tree Diagram
module: asternos-fdb
rpcs: +---x clear-mac-address +---w input | +---w interface-name? union | +---w fdb-type? enumeration +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| clear-mac-address | O | ||
| interface-name | O | Ethernet name | Name of the Ethernet or link-aggregation interface. |
| fdb-type | O | ”static" "dynamic" "all” | The type of fdb to clear. Default value: dynamic |
| data | O | The string indicates success or failure of this operation |