MIRROR-Netconf
MIRROR
Section titled “MIRROR”Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /mirror | Y | merge, replace, create, delete | — |
| /mirror/session/{id} | Y | merge, replace, create, delete | — |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage Mirror configurations on AsterNOS devices.
Create Mirror Session SPAN/RSPAN/ERSPAN
Section titled “Create Mirror Session SPAN/RSPAN/ERSPAN”Request example to create mirror session via edit-config.
The Vlan must be created before configuring mirror session with Vlan as port.
<config><top> <mirror operation="create"> <session> <id>3</id> <mirror-type>SPAN</mirror-type> <direction>RX</direction> <destination-ports>Ethernet5</destination-ports> <destination-ports>Vlan102</destination-ports> <source-ports>Ethernet6</source-ports> <source-ports>Vlan100</source-ports> </session> <session> <id>4</id> <mirror-type>RSPAN</mirror-type> <direction>TX</direction> <destination-ports>Ethernet7</destination-ports> <source-ports>Ethernet8</source-ports> <remote-vlan>105</remote-vlan> </session> <session> <id>5</id> <mirror-type>ERSPAN</mirror-type> <direction>RX</direction> <source-ports>Ethernet1</source-ports> <src-ip>192.168.1.1</src-ip> <dst-ip>192.168.2.100</dst-ip> </session> </mirror></top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5d15f1d9-2f13-41aa-891e-73fadcc3595b"> <ok/></rpc-reply>Delete Single Mirror Session
Section titled “Delete Single Mirror Session”Request example to delete mirror session via edit-config.
<config><top> <mirror> <session operation="delete"> <id>3</id> </session> </mirror></top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:6145a695-3177-4e48-b09d-f8dcef0fbb18"> <ok/></rpc-reply>Delete All Mirror Sessions
Section titled “Delete All Mirror Sessions”Request example to delete all mirror sessions via edit-config.
<config><top> <mirror operation="delete"/></top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:20ba7726-d0f5-400d-b4d3-1ead94203b7a"> <ok/></rpc-reply>Get All Mirror Sessions
Section titled “Get All Mirror Sessions”Request example to get all mirror sessions via get-config.
<filter type="subtree"> <top xmlns="http://www.asterfusion.com/asternos-schema/1.0/config"> <mirror> <session/> </mirror> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:8a8928ca-d91d-48aa-8c71-b358fa5e107a"> <data> <top> <mirror xmlns="http://asterfusion.com/ns/yang/asternos-mirror"> <session> <id>3</id> <mirror-type>SPAN</mirror-type> <direction>RX</direction> <destination-ports>Ethernet5</destination-ports> <destination-ports>Vlan102</destination-ports> <source-ports>Ethernet6</source-ports> <source-ports>Vlan100</source-ports> </session> <session> <id>4</id> <mirror-type>RSPAN</mirror-type> <direction>TX</direction> <destination-ports>Ethernet7</destination-ports> <source-ports>Ethernet8</source-ports> <remote-vlan>105</remote-vlan> </session> <session> <id>5</id> <mirror-type>ERSPAN</mirror-type> <direction>RX</direction> <source-ports>Ethernet1</source-ports> <src-ip>192.168.1.1</src-ip> <dst-ip>192.168.2.100</dst-ip> </session> </mirror> </top> </data></rpc-reply>Properties Descriptions
Section titled “Properties Descriptions”Top-level configuration for the mirror
Section titled “Top-level configuration for the mirror”Tree Diagram
module: asternos-mirror +--rw mirror +--rw session* [id] +--rw id uint8 +--rw mirror-type identityref +--rw direction? mirror-direction-type +--rw destination-ports* union +--rw source-ports* union +--rw remote-vlan? cmn:vlan-id +--rw src-ip? inet:ipv4-address-no-zone +--rw dst-ip? inet:ipv4-address-no-zone +--rw vrf? vrf:vrf-refTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| mirror | M | Path-only node, has no configurable value. Top-level configuration for the mirror. | |
| session | M | Path-only node, has no configurable value. | |
| id | O | 1..7 | Identify mirror sessions. |
| mirror-type | M | ”SPAN" "ERSPAN" "RSPAN” | Mirror session type. |
| direction | O | ”BOTH" "RX" "TX” | Direction of mirror session. Default value: BOTH |
| destination-ports | O | Ethernet name | Mirror session destination port. When type is RSPAN, only support single ethernet port. Not applicable for ERSPAN type. |
| source-ports | O | Ethernet name | Mirror session source port. |
| remote-vlan | O | cmn:vlan-id | Remote VLAN for RSPAN. |
| src-ip | O | inet:ipv4-address-no-zone | GRE source IP address for ERSPAN. |
| dst-ip | O | inet:ipv4-address-no-zone | GRE destination IP address for ERSPAN. |
| vrf | O | vrf:vrf-ref | VRF for ERSPAN session. Default value: default |
Session
Section titled “Session”Tree Diagram
module: asternos-mirror +--rw mirror +--rw session* [id] +--rw id uint8 +--rw mirror-type identityref +--rw direction? mirror-direction-type +--rw destination-ports* union +--rw source-ports* union +--rw remote-vlan? cmn:vlan-id +--rw src-ip? inet:ipv4-address-no-zone +--rw dst-ip? inet:ipv4-address-no-zone +--rw vrf? vrf:vrf-refTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| session | M | Path-only node, has no configurable value. | |
| id | O | 1..7 | Identify mirror sessions. |
| mirror-type | M | ”SPAN" "ERSPAN" "RSPAN” | Mirror session type. |
| direction | O | ”BOTH" "RX" "TX” | Direction of mirror session. Default value: BOTH |
| destination-ports | O | Ethernet name | Mirror session destination port. When type is RSPAN, only support single ethernet port. Not applicable for ERSPAN type. |
| source-ports | O | Ethernet name | Mirror session source port. |
| remote-vlan | O | cmn:vlan-id | Remote VLAN for RSPAN. |
| src-ip | O | inet:ipv4-address-no-zone | GRE source IP address for ERSPAN. |
| dst-ip | O | inet:ipv4-address-no-zone | GRE destination IP address for ERSPAN. |
| vrf | O | vrf:vrf-ref | VRF for ERSPAN session. Default value: default |