PBR
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”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>