OC-BGP-POLICY

Configuring AS-Path

Configuring AS-Path
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <routing-policy xmlns="http://openconfig.net/yang/routing-policy">
        <defined-sets>
          <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
            <as-path-sets>
              <as-path-set>
                <as-path-set-name>aspath_new</as-path-set-name>
                <config>
                  <as-path-set-name>aspath_new</as-path-set-name>
                  <as-path-set-member>1:1</as-path-set-member>
                  <as-path-set-member>65535:1</as-path-set-member>
                </config>
              </as-path-set>
            </as-path-sets>
          </bgp-defined-sets>
        </defined-sets>
      </routing-policy>
    </config>
  </edit-config>
</rpc>

Note: This example was added in Release 9.3(5).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

ip as-path access-list ANY_aspath_new seq 5 permit "1:1"
ip as-path access-list ANY_aspath_new seq 10 permit "65535:1"
ip as-path access-list INVERT_aspath_new seq 5 deny "1:1"
ip as-path access-list INVERT_aspath_new seq 10 deny "65535:1"
ip as-path access-list INVERT_aspath_new seq 4294967294 permit ".*"

Configuring BGP Conditions

Configuring  BGP Conditions
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <routing-policy xmlns="http://openconfig.net/yang/routing-policy">
        <policy-definitions>
          <policy-definition>
            <name>pol_new</name>
            <statements>
              <statement>
                <name>10</name>
                <conditions>
                  <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
                    <config>
                      <med-eq>0</med-eq>
                      <next-hop-in>1.1.1.1</next-hop-in>
                      <next-hop-in>1001::1</next-hop-in>
                      <route-type>EXTERNAL</route-type>
                      <community-set>comm1</community-set>
                    </config>
                  </bgp-conditions>
                </conditions>
              </statement>
            </statements>
          </policy-definition>
        </policy-definitions>
      </routing-policy>
    </config>
  </edit-config>
</rpc>

Note: This example was added in Release 9.3(5).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

ip prefix-list IPV4_PFX_LIST_OPENCONFIG_pol_new_10 seq 5 permit 1.1.1.1/32
ipv6 prefix-list IPV6_PFX_LIST_OPENCONFIG_pol_new_10 seq 5 permit 1001::1/128
route-map pol_new permit 10
 match ip next-hop prefix-list IPV4_PFX_LIST_OPENCONFIG_pol_new_10
 match ipv6 next-hop prefix-list IPV6_PFX_LIST_OPENCONFIG_pol_new_10
 match metric 0
 match community comm1_std comm1_exp
 match route-type external

Configuring BGP Condition Match As-Path-Set Option ANY

Configuring BGP Condition Match As-Path-Set Option ANY
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <routing-policy xmlns="http://openconfig.net/yang/routing-policy">
        <policy-definitions>
          <policy-definition>
            <name>pol_latest</name>
            <statements>
              <statement>
                <name>10</name>
                <conditions>
                  <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
                    <match-as-path-set>
                      <config>
                        <as-path-set>aspath_new</as-path-set>
                        <match-set-options>ANY</match-set-options>
                      </config>
                    </match-as-path-set>
                  </bgp-conditions>
                </conditions>
              </statement>
            </statements>
          </policy-definition>
        </policy-definitions>
      </routing-policy>
    </config>
  </edit-config>
</rpc>

Note: This example was added in Release 9.3(5).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

route-map pol_latest permit 10
 match as-path ANY_aspath_new

Configuring BGP Condition Match As-Path-Set Option INVERT

Configuring BGP Condition Match As-Path-Set Option INVERT
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <routing-policy xmlns="http://openconfig.net/yang/routing-policy">
        <policy-definitions>
          <policy-definition>
            <name>pol_latest</name>
            <statements>
              <statement>
                <name>10</name>
                <conditions>
                  <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
                    <match-as-path-set>
                      <config>
                        <as-path-set>aspath_new</as-path-set>
                        <match-set-options>INVERT</match-set-options>
                      </config>
                    </match-as-path-set>
                  </bgp-conditions>
                </conditions>
              </statement>
            </statements>
          </policy-definition>
        </policy-definitions>
      </routing-policy>
    </config>
  </edit-config>
</rpc>

Note: This example was added in Release 9.3(5).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

route-map pol_latest permit 10
 match as-path INVERT_aspath_new

Configuring BGP Action Set-As-Path-Prepend

Configuring BGP Action Set-As-Path-Prepend
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <routing-policy xmlns="http://openconfig.net/yang/routing-policy">
        <policy-definitions>
          <policy-definition>
            <name>pol_lat</name>
            <statements>
              <statement>
                <name>10</name>
                <actions>
                  <config>
                    <policy-result>ACCEPT_ROUTE</policy-result>
                  </config>
                  <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
                    <set-as-path-prepend>
                      <config>
                        <repeat-n>1</repeat-n>
                        <asn>100</asn>
                      </config>
                    </set-as-path-prepend>
                  </bgp-actions>
                </actions>
              </statement>
            </statements>
          </policy-definition>
        </policy-definitions>
      </routing-policy>
    </config>
  </edit-config>
</rpc>

Note: This example was added in Release 9.3(5).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

route-map pol_lat permit 10
 set as-path prepend 100
 set as-path prepend last-as 1