Configuring a Peer Template

This section uses examples to demonstrate many of the BGP configuration options and to show how the REST APIs correspond to the CLI commands.

Configuring a Template Configuration for Peer Parameters

Template Configuration for Peer Parameters
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Enters peer template configuration mode.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring the Autonomous System Number of the Neighbor

Configuring the Autonomous System Number of the Neighbor
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "asn": "330",
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"               
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <asn>330</asn>
              <inheritContPeerCtrl></inheritContPeerCtrl>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Configures an AS number for a template peer.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  remote-as 330

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring a Log Message for Neighbor Up/Down Events (Under a Template Configuration for Peer Parameters)

Configuring a Log Message for Neighbor Up/Down Events  (Under a Template Configuration for Peer Parameters)
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "logNbrChgs": "enable",
                 "name": "33.1.1.1"              
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <logNbrChgs>enable</logNbrChgs>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Logs a message for a neighbor up/down events.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  log-neighbor-changes

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring the Local-as Number for the eBGP Neighbor

Configuring the Local-as Number for the eBGP Neighbors
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
               },
               "children": [
                 {
                   "bgpLocalAsn": {
                     "attributes": {
                       "asnPropagate": "none",
                       "localAsn": "100"          
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <localasn-items>
                <asnPropagate>none</asnPropagate>
                <localAsn>100</localAsn>
              </localasn-items>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Configures the local-as.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  local-as 100

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Creating a Neighbor-Specific Description

Creating a Neighbor-Specific Description
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "desc": "oc-bgp-peer",
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"        
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <desc>oc-bgp-peer</desc>
              <inheritContPeerCtrl></inheritContPeerCtrl>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Creates a neighbor-specific description.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  description oc-bgp-peer

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Removing a Private AS Number from Outbound Updates

Removing a Private AS Number from Outbound Updates
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1",
                 "privateASctrl": "replace-as"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <privateASctrl>replace-as</privateASctrl>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Replaces all private AS numbers with the replace-as AS-path value.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  remove-private-as replace-as

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Multihop TTL for a Remote Peer

Configuring Multihop TTL for a Remote Peer
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1",
                 "ttl": "2"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <ttl>2</ttl>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Configures the eBGP TTL value for eBGP multihop.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  ebgp-multihop 2

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring the BGP Transport Connection as Passive Only

Configuring the BGP Transport Connection as Passive Only
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "connMode": "passive",
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <connMode>passive</connMode>
              <inheritContPeerCtrl></inheritContPeerCtrl>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Allows a passive connection setup only.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  transport connection-mode passive

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring the Keepalive and Hold Timers

Configuring the Keepalive and Hold Timers
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "holdIntvl": "181",
                 "inheritContPeerCtrl": "",
                 "kaIntvl": "61",
                 "name": "33.1.1.1"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <holdIntvl>181</holdIntvl>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <kaIntvl>61</kaIntvl>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  timers 61 181

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring an IPv4 Unicast Sub-Address Family

Configuring an IPv4 Unicast Sub-Address Family
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
               },
               "children": [
                 {
                   "bgpPeerAf": {
                     "attributes": {
                       "type": "ipv4-ucast"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <af-items>
                <PeerAf-list>
                  <type>ipv4-ucast</type>
                </PeerAf-list>
              </af-items>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  address-family ipv4 unicast

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Send Community Attribute to this Neighbor

Send Community Attribute to this Neighbor
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
               },
               "children": [
                 {
                   "bgpPeerAf": {
                     "attributes": {
                       "inheritContPeerPolicyCtrl": "",
                       "sendComStd": "enabled",
                       "type": "ipv4-ucast"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <af-items>
                <PeerAf-list>
                  <type>ipv4-ucast</type>
                  <inheritContPeerPolicyCtrl></inheritContPeerPolicyCtrl>
                  <sendComStd>enabled</sendComStd>
                </PeerAf-list>
              </af-items>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Sends the community attribute to this BGP peer. This command triggers an automatic soft clear or refresh of BGP neighbor sessions.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
 address-family ipv4 unicast
  send-community

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring the Maximum Number of Prefixes from this Neighbor

Configuring the Maximum Number of Prefixes from this Neighbor
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
               },
               "children": [
                 {
                   "bgpPeerAf": {
                     "attributes": {
                       "inheritContPeerPolicyCtrl": "",
                       "type": "ipv4-ucast"
                     },
                     "children": [
                       {
                         "bgpMaxPfxP": {
                           "attributes": {
                             "action": "restart",
                             "maxPfx": "21",
                             "restartTime": "90",
                             "thresh": "20"
}}}]}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <af-items>
                <PeerAf-list>
                  <type>ipv4-ucast</type>
                  <inheritContPeerPolicyCtrl></inheritContPeerPolicyCtrl>
                  <maxpfxp-items>
                    <action>restart</action>
                    <maxPfx>21</maxPfx>
                    <restartTime>90</restartTime>
                    <thresh>20</thresh>
                  </maxpfxp-items>
                </PeerAf-list>
              </af-items>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  address-family ipv4 unicast
   maximum-prefix 21 20 restart 90

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring the Advertisement Interval on a Template Peer

Configuring the advertisement-interval
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
               },
               "children": [
                 {
                   "bgpPeerAf": {
                     "attributes": {
                       "advIntvl": "80",
                       "inheritContPeerPolicyCtrl": "",
                       "type": "ipv4-ucast"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <af-items>
                <PeerAf-list>
                  <type>ipv4-ucast</type>
                  <advIntvl>80</advIntvl>
                  <inheritContPeerPolicyCtrl></inheritContPeerPolicyCtrl>
                </PeerAf-list>
              </af-items>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Sets the interval time in seconds between sending advertisement frames. The range is from 1 to 255. The default is 1 second.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  address-family ipv4 unicast
   advertisement-interval 80

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Advertisement to only Active Routes to Peers

Configuring Advertisement to only Active Routes to Peers
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
               },
               "children": [
                 {
                   "bgpPeerAf": {
                     "attributes": {
                       "ctrl": "suppress-inactive",
                       "inheritContPeerPolicyCtrl": "",
                       "type": "ipv4-ucast"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <af-items>
                <PeerAf-list>
                  <type>ipv4-ucast</type>
                  <ctrl>suppress-inactive</ctrl>
                  <inheritContPeerPolicyCtrl></inheritContPeerPolicyCtrl>
                </PeerAf-list>
              </af-items>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Suppresses the advertisement of routes that are not installed in the routing information base (RIB).

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  address-family ipv4 unicast
   suppress-inactive

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Default Originate Toward a Peer

Configuring Default Originate Toward a Peer
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
 "bgpInst": {
   "attributes": {
     "asn": "100"
   },
   "children": [
     {
       "bgpDom": {
         "attributes": {
           "name": "default"
         },
         "children": [
           {
             "bgpPeerCont": {
               "attributes": {
                 "inheritContPeerCtrl": "",
                 "name": "33.1.1.1"
               },
               "children": [
                 {
                   "bgpPeerAf": {
                     "attributes": {
                       "defOrg": "enabled",
                       "defOrgRtMap": "",
                       "inheritContPeerPolicyCtrl": "",
                       "type": "ipv4-ucast"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>33.1.1.1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <af-items>
                <PeerAf-list>
                  <type>ipv4-ucast</type>
                  <defOrg>enabled</defOrg>
                  <defOrgRtMap></defOrgRtMap>
                  <inheritContPeerPolicyCtrl></inheritContPeerPolicyCtrl>
                </PeerAf-list>
              </af-items>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Generates a default route to the BGP peer.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer 33.1.1.1
  address-family ipv4 unicast
   default-originate

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring a BGP Peer Template

Configuring a BGP Peer Template
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
"bgpInst": {
  "attributes": {
    "asn": "100"
  },
  "children": [
    {
      "bgpDom": {
        "attributes": {
          "name": "default"
        },
        "children": [
          {
            "bgpPeer": {
              "attributes": {
                "addr": "192.168.1.2",
                "asn": "65536",
                "inheritContPeerCtrl": "",
                "peerImp": "BasePeer"
}}},{
            "bgpPeerCont": {
              "attributes": {
                "inheritContPeerCtrl": "",
                "name": "BasePeer",
                "sessionContImp": "BaseSession"
              },
              "children": [
                {
                  "bgpPeerAf": {
                    "attributes": {
                      "type": "ipv4-ucast"
                    },
                    "children": [
                      {
                        "bgpPolicyInheritRule": {
                          "attributes": {
                            "name": "BasePolicy",
                            "seq": "1"
}}}]}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peer-items>
            <Peer-list>
              <addr>192.168.1.2</addr>
              <asn>65536</asn>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <peerImp>BasePeer</peerImp>
            </Peer-list>
          </peer-items>
          <peercont-items>
            <PeerCont-list>
              <name>BasePeer</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <sessionContImp>BaseSession</sessionContImp>
              <af-items>
                <PeerAf-list>
                  <type>ipv4-ucast</type>
                  <pol-items>
                    <PolicyInheritRule-list>
                      <name>BasePolicy</name>
                      <seq>1</seq>
                    </PolicyInheritRule-list>
                  </pol-items>
                </PeerAf-list>
              </af-items>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

router bgp 100
 template peer BasePeer
  inherit peer-session BaseSession
  address-family ipv4 unicast
   inherit peer-policy BasePolicy 1
 neighbor 192.168.1.2 remote-as 65536
  inherit peer BasePeer

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring a Fabric Border Leaf for a Neighbor Template

Configuring a Fabric Border Leaf for a Neighbor Template
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
  "bgpInst": {
    "attributes": {
      "asn": "100"
    },
    "children": [
      {
        "bgpDom": {
          "attributes": {
            "name": "default"
          },
          "children": [
            {
              "bgpPeerCont": {
                "attributes": {
                  "inheritContPeerCtrl": "",
                  "name": "p1",
                  "peerType": "fabric-border-leaf"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <peercont-items>
            <PeerCont-list>
              <name>p1</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <peerType>fabric-border-leaf</peerType>
            </PeerCont-list>
          </peercont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Configures a fabric border leaf for a neighbor template.

Note: This example was added in Release 7.0(3)I7(1).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

router bgp 100
 template peer p1
  peer-type fabric-border-leaf

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring a Fabric Border Leaf in a Peer-Session Template

Configuring a Fabric Border Leaf in a Peer-Session Template
POST http://<mgmt0_IP>/api/mo/sys/bgp/inst.json
{
  "bgpInst": {
    "attributes": {
      "asn": "100"
    },
    "children": [
      {
        "bgpDom": {
          "attributes": {
            "name": "default"
          },
          "children": [
            {
              "bgpSessionCont": {
                "attributes": {
                  "inheritContPeerCtrl": "",
                  "name": "ps2",
                  "peerType": "fabric-external"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <bgp-items>
    <inst-items>
      <asn>100</asn>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <sessioncont-items>
            <SessionCont-list>
              <name>ps2</name>
              <inheritContPeerCtrl></inheritContPeerCtrl>
              <peerType>fabric-external</peerType>
            </SessionCont-list>
          </sessioncont-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </bgp-items>
</System>

Configures a fabric border leaf in a peer-session template.

Note: This example was added in Release 7.0(3)I7(1).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

router bgp 100
 template peer-session ps2
  peer-type fabric-external

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Querying a Peer Template

Querying a Peer Template
GET http://<IP_address>/api/mo/sys/bgp/inst/dom-default/peercont-BasePeer.json
{
  "totalCount": "1",
  "imdata": [
    {
      "bgpPeerCont": {
        "attributes": {
          "adminSt": "disabled",
          "asn": "200",
          "childAction": "",
          "connMode": "passive",
          "ctrl": "bfd,cap-neg-off,dis-conn-check",
          "desc": "desc2",
          "dn": "sys/bgp/inst/dom-default/peercont-sample1",
          "holdIntvl": "300",
          "inheritContPeerCtrl": "",
          "kaIntvl": "200",
          "lcOwn": "local",
          "modTs": "2015-07-09T01:39:13.589+00:00",
          "name": "BasePeer",
          "sessionContImp": "BaseSession",
          "srcIf": "eth1/1",
          "status": "",
          "ttl": "100"
}}}]}

This API call queries the settings of the peer template that were set in the previous example Configuring a BGP Peer Template.

Issue an HTTP GET request to verify that the BGP peer template configuration was successful.