跳转到内容
Ask AI

PBR-Netconf

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

YANG Pathget/get-configedit-configrpc
/pbr-maps/{name}/{seq}Ymerge, replace, create, delete—
/show-pbr-interface——Y
/show-pbr-map——Y
/show-pbr-nexthop-groups——Y

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

Request example to get all pbr configurations via get-config.

<filter type="subtree">
<top>
<pbr-maps>
</pbr-maps>
</top>
</filter>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:3275a152-4163-421b-832d-97f128fad8b4">
<data>
<top>
<pbr-maps xmlns="http://asterfusion.com/ns/yang/asternos-pbr">
<pbr-map>
<name>pbr-map-1</name>
<seq>60</seq>
<match-condition>
<src-port>80</src-port>
<src-ip>1.2.3.4/24</src-ip>
<dst-port>50</dst-port>
<dst-ip>10.20.30.40/24</dst-ip>
<ip-protocol>udp</ip-protocol>
</match-condition>
<set-action>
<nexthop>1.2.3.4</nexthop>
</set-action>
</pbr-map>
</pbr-maps>
</top>
</data>
</rpc-reply>

Request example to create pbr map configuration via edit-config.

<config>
<top>
<pbr-maps>
<pbr-map operation="create">
<name>pbr-map-1</name>
<seq>60</seq>
<match-condition>
<ip-protocol>udp</ip-protocol>
<dst-ip>10.20.30.40/24</dst-ip>
<src-ip>1.2.3.4/24</src-ip>
<dst-port>50</dst-port>
<src-port>80</src-port>
</match-condition>
<set-action>
<nexthop>1.2.3.4</nexthop>
</set-action>
</pbr-map>
</pbr-maps>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:805ba8e7-bff9-4323-bb23-3bbdaabbd4bb">
<ok/>
</rpc-reply>

Request example to modify pbr map configuration via edit-config.

<config>
<top>
<pbr-maps>
<pbr-map operation="merge">
<name>pbr-map-1</name>
<seq>60</seq>
<match-condition>
<src-ip>2.2.3.4/24</src-ip>
<src-port>120</src-port>
</match-condition>
</pbr-map>
</pbr-maps>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:7d2b6e6a-9155-4144-ad1d-5a9be8a86147">
<ok/>
</rpc-reply>

Request example to delete pbr map configuration via edit-config.

<config>
<top>
<pbr-maps>
<pbr-map operation="delete">
<name>pbr-map-1</name>
</pbr-map>
</pbr-maps>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5d2b6e6a-9155-4144-ad1d-5a9be8a841548">
<ok/>
</rpc-reply>

Request example to bind pbr map to interface configuration via edit-config.

<config>
<top>
<interfaces>
<interface operation="merge">
<name>Ethernet1</name>
<pbr-policy>pbr-map-1</pbr-policy>
</interface>
</interfaces>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:a74c26e6-a739-423b-b1c1-1a524554406a">
<ok/>
</rpc-reply>

Request example to show pbr map via rpc show-pbr-map.

<show-pbr-map/>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:ac6a5232-48f1-42ae-ab96-f76e71ec55e0">
<data xmlns="http://asterfusion.com/ns/yang/asternos-pbr">
pbr-map pbr-map-1 valid: no
Seq: 60 rule: 359
Installed: no Reason: Invalid NH
IP Protocol Match: udp
SRC IP Match: 2.2.3.4/24
DST IP Match: 10.20.30.40/24
SRC Port Match: 120
DST Port Match: 50
nexthop 1.2.3.4
Installed: no Tableid: 10002
</data>
</rpc-reply>

Request example to show pbr map bind to interface via rpc show-pbr-interface.

<show-pbr-interface/>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:db04baad-f088-4e7b-aeac-f3e215a3f90c">
<data xmlns="http://asterfusion.com/ns/yang/asternos-pbr">
Ethernet1(11) with pbr-policy pbr-map-1
</data>
</rpc-reply>

The Nexthop-Group name is generated by concatenating the PBR Map name with the sequence number.

Request example to show pbr nexthop-groups via rpc show-pbr-nexthop-groups.

<show-pbr-nexthop-groups/>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:86b98ba4-0f32-45d4-a5ce-4ed6dc92cb58">
<data xmlns="http://asterfusion.com/ns/yang/asternos-pbr">
Nexthop-Group: pbr-map-160 Table: 10002 Valid: 1 Installed: 0
Valid: 1 nexthop 1.2.3.4
</data>
</rpc-reply>

Tree Diagram

module: asternos-pbr
+--rw pbr-maps
+--rw pbr-map* [name seq]
+--rw name string
+--rw seq uint16
+--rw match-condition
| +--rw src-port? uint16
| +--rw src-ip? inet:ip-prefix
| +--rw dst-port? uint16
| +--rw dst-ip? inet:ip-prefix
| +--rw ip-protocol? enumeration
+--rw set-action
+--rw (set-action)?
+--:(nexthop-group)
| +--rw nexthop-group? string
+--:(nexthop)
+--rw nexthop* inet:ip-address-no-zone

Table of Properties

NameRequiredType/RangeDescription
pbr-mapsMPath-only node, has no configurable value.
pbr-mapMPath-only node, has no configurable value.
nameOstringName of pbr map.
seqO1..700Sequence of pbr map entry.
match-conditionMPath-only node, has no configurable value.
pbr map match conditions.
src-portO1..65535Choose the source port to use.
src-ipOinet:ip-prefixChoose the src ip or ipv6 prefix to use.
dst-portO1..65535Choose the destination port to use.
dst-ipOinet:ip-prefixChoose the destination ip or ipv6 prefix to use.
ip-protocolO”udp"
"tcp”
Choose an ip-protocol.
set-actionMPath-only node, has no configurable value.
nexthop-groupOstringSet nexthop-group to use
nexthopOinet:ip-address-no-zoneChoose the nexthop ip or ipv6 without zone to use.

Tree Diagram

module: asternos-pbr
rpcs:
+---x show-pbr-interface
+---w input
| +---w interface-name? string
| +---w type? enumeration
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-pbr-interfaceO
interface-nameOstringinterface name of ethernet or link-aggregation.
typeO”json”Display data in json or detail format.
dataO

Tree Diagram

module: asternos-pbr
rpcs:
+---x show-pbr-map
+---w input
| +---w name? string
| +---w type? enumeration
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-pbr-mapO
nameOstringpbr map name.
typeO”json”Display data in json or detail format.
dataO

Tree Diagram

module: asternos-pbr
rpcs:
+---x show-pbr-nexthop-groups
+---w input
| +---w name? string
| +---w type? enumeration
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-pbr-nexthop-groupsO
nameOstringnexthop-groups name.
typeO”json”Display data in json or detail format.
dataO