PBR-Netconf
此内容尚不支持你的语言。
Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /pbr-maps/{name}/{seq} | Y | merge, replace, create, delete | — |
| /show-pbr-interface | — | — | Y |
| /show-pbr-map | — | — | Y |
| /show-pbr-nexthop-groups | — | — | Y |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage PBR configurations on AsterNOS devices.
Get PBR Configurations
Section titled “Get PBR Configurations”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>Create PBR Map
Section titled “Create PBR Map”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>Modify PBR Map Configurations
Section titled “Modify PBR Map Configurations”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>Delete PBR Map Configurations
Section titled “Delete PBR Map Configurations”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>Bind PBR Map To Interface Configurations
Section titled “Bind PBR Map To Interface Configurations”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>Show PBR Map Information
Section titled “Show PBR Map Information”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>Get Interfaces Bind With Pbr Map
Section titled “Get Interfaces Bind With Pbr Map”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>Get Pbr Map Nexthop Groups
Section titled “Get Pbr Map Nexthop Groups”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>Properties Descriptions
Section titled “Properties Descriptions”Pbr Maps
Section titled “Pbr Maps”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-zoneTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| pbr-maps | M | Path-only node, has no configurable value. | |
| pbr-map | M | Path-only node, has no configurable value. | |
| name | O | string | Name of pbr map. |
| seq | O | 1..700 | Sequence of pbr map entry. |
| match-condition | M | Path-only node, has no configurable value. pbr map match conditions. | |
| src-port | O | 1..65535 | Choose the source port to use. |
| src-ip | O | inet:ip-prefix | Choose the src ip or ipv6 prefix to use. |
| dst-port | O | 1..65535 | Choose the destination port to use. |
| dst-ip | O | inet:ip-prefix | Choose the destination ip or ipv6 prefix to use. |
| ip-protocol | O | ”udp" "tcp” | Choose an ip-protocol. |
| set-action | M | Path-only node, has no configurable value. | |
| nexthop-group | O | string | Set nexthop-group to use |
| nexthop | O | inet:ip-address-no-zone | Choose the nexthop ip or ipv6 without zone to use. |
Show Pbr Interface
Section titled “Show Pbr Interface”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
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-pbr-interface | O | ||
| interface-name | O | string | interface name of ethernet or link-aggregation. |
| type | O | ”json” | Display data in json or detail format. |
| data | O |
Show Pbr Map
Section titled “Show Pbr Map”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
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-pbr-map | O | ||
| name | O | string | pbr map name. |
| type | O | ”json” | Display data in json or detail format. |
| data | O |
Show Pbr Nexthop Groups
Section titled “Show Pbr Nexthop Groups”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
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-pbr-nexthop-groups | O | ||
| name | O | string | nexthop-groups name. |
| type | O | ”json” | Display data in json or detail format. |
| data | O |