---
title: PBR
slug: enterprise-v6p1/pbr
createdAt: 2025-12-18T08:30:48.073Z
---

# <font color="#1d50a2">AsterNOS-PBR</font>

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

## <font color="#1d50a2">Get PBR Configurations</font>

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

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

Response example

```xml
<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>
```

## <font color="#1d50a2">Create PBR Map</font>

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

```xml
<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

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

## <font color="#1d50a2">Modify PBR Map Configurations</font>

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

```xml
<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

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

## <font color="#1d50a2">Delete PBR Map Configurations</font>

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

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

Response example

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

## <font color="#1d50a2">Bind PBR Map To Interface Configurations</font>

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

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

Response example

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

## <font color="#1d50a2">Show PBR Map Information</font>

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

```xml
<show-pbr-map/>
```

Response example

```xml
<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>
```

## <font color="#1d50a2">Get Interfaces Bind With Pbr Map</font>

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

```xml
<show-pbr-interface/>
```

Response example

```xml
<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>
```

## <font color="#1d50a2">Get Pbr Map Nexthop Groups</font>

:::hint{type="warning"}
**NOTE:**
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**.

```xml
<show-pbr-nexthop-groups/>
```

Response example

```xml
<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>
```

