跳转到内容
Ask AI

MIRROR-Netconf

此内容尚不支持你的语言。

YANG Pathget/get-configedit-configrpc
/mirrorYmerge, replace, create, delete—
/mirror/session/{id}Ymerge, replace, create, delete—

This chapter provides examples on how to use Netconf to manage Mirror configurations on AsterNOS devices.

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>

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>

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>

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>

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-ref

Table of Properties

NameRequiredType/RangeDescription
mirrorMPath-only node, has no configurable value.
Top-level configuration for the mirror.
sessionMPath-only node, has no configurable value.
idO1..7Identify mirror sessions.
mirror-typeM”SPAN"
"ERSPAN"
"RSPAN”
Mirror session type.
directionO”BOTH"
"RX"
"TX”
Direction of mirror session.
Default value: BOTH
destination-portsOEthernet nameMirror session destination port.

When type is RSPAN, only support single ethernet port.

Not applicable for ERSPAN type.
source-portsOEthernet nameMirror session source port.
remote-vlanOcmn:vlan-idRemote VLAN for RSPAN.
src-ipOinet:ipv4-address-no-zoneGRE source IP address for ERSPAN.
dst-ipOinet:ipv4-address-no-zoneGRE destination IP address for ERSPAN.
vrfOvrf:vrf-refVRF for ERSPAN session.
Default value: default

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-ref

Table of Properties

NameRequiredType/RangeDescription
sessionMPath-only node, has no configurable value.
idO1..7Identify mirror sessions.
mirror-typeM”SPAN"
"ERSPAN"
"RSPAN”
Mirror session type.
directionO”BOTH"
"RX"
"TX”
Direction of mirror session.
Default value: BOTH
destination-portsOEthernet nameMirror session destination port.

When type is RSPAN, only support single ethernet port.

Not applicable for ERSPAN type.
source-portsOEthernet nameMirror session source port.
remote-vlanOcmn:vlan-idRemote VLAN for RSPAN.
src-ipOinet:ipv4-address-no-zoneGRE source IP address for ERSPAN.
dst-ipOinet:ipv4-address-no-zoneGRE destination IP address for ERSPAN.
vrfOvrf:vrf-refVRF for ERSPAN session.
Default value: default