Querying Advertised Routes

Querying Advertised Routes
GET http://<IP_Address>/api/node/mo/sys/bgp/inst/dom-default/peer-[19.0.101.1]/af-ipv4-ucast/advtdrt.json     
{
    "totalCount": "1",
    "imdata": [
        {
            "bgpAdvtdRoutes": {
                "attributes": {
                    "dn": "sys/bgp/inst/dom-default/peer-[19.0.101.1]/af-ipv4-ucast/advtdrt"
                },
                "children": [
                    {
                        "bgpRoute": {
                            "attributes": {
                                "bestPathId": "1",
                                "numPaths": "1",
                                "pfx": "104.0.0.0/8",
                                "rn": "rt-[104.0.0.0/8]",
                                "rtFlags": "best,rib,vpn,xmit",
                                "ver": "3"
                            },
                            "children": [
                                {
                                    "bgpPath": {
                                        "attributes": {
                                            "aggr": "0.0.0.0",
                                            "aggrAs": "0",
                                            "asPath": "",
                                            "clusterLst": "",
                                            "extComm": "RT:100:1 RT:400:400",
                                            "flags": "advertise,best-path,imported,metric",
                                            "id": "0",
                                            "importedRd": "rd:nn4-nn4:4240651637:0",
                                            "localPref": "100",
                                            "metric": "0",
                                            "nh": "0.0.0.0",
                                            "nhMetric": "0",
                                            "operSt": "valid",
                                            "origImportedRd": "unknown:unknown:0:0",
                                            "origin": "incomplete",
                                            "originatorId": "0.0.0.0",
                                            "peer": "0.0.0.0",
                                            "peerRtrId": "19.0.0.6",
                                            "rcvdLbl": "",
                                            "regComm": "",
                                            "rn": "path-[0.0.0.0]-id-0-nh-[0.0.0.0]-imprd-rd:nn4-nn4:4240651637:0-origimprd-unknown:unknown:0:0",
                                            "type": "redistribute",
                                            "unknownAttrData": "",
                                            "unknownAttrLen": "0",
                                            "weight": "32768"
                                        },
                                        "children": [
                                            {
                                                "bgpExtComm": {
                                                    "attributes": {
                                                        "encap": "unknown",
                                                        "rn": "ecomm",
                                                        "rtrMac": "00:00:00:00:00:00"
                                                    },
                                                    "children": [
                                                        {
                                                            "bgpExtCommRt": {
                                                                "attributes": {
                                                                    "community": "extended:as2-nn2:400:400",
                                                                    "rn": "rt-extended:as2-nn2:400:400"
                                                                }
                                                            }
                                                        },
                                                        {
                                                            "bgpExtCommRt": {
                                                                "attributes": {
                                                                    "community": "extended:as2-nn2:100:1",
                                                                    "rn": "rt-extended:as2-nn2:100:1"
                                                                }
                                                            }
                                                        }
                                                    ]
                                                }
                                            }
                                        ]
                                    }
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "warning": {
                "attributes": {
                    "text": "backend rv=43700005, No more data. Done"
                }
            }
        }
    ]
}

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show bgp ipv4 unicast neighbors 19.0.101.1 advertised-routes 

Peer 19.0.101.1 routes for address family IPv4 Unicast:
BGP table version is 318, Local Router ID is 19.0.0.6
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup

   Network            Next Hop            Metric     LocPrf     Weight Path
*>r104.0.0.0/8        0.0.0.0                  0        100      32768 ?

Note: The property information for this example was added in Release 9.3(3).


bgpAdvtdRoutes Properties

The following table contains information about the bgpAdvtdRoutes properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
dn
reference:BinRef
A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module.


bgpRoute Properties

The following table contains information about the bgpRoute properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
bestPathIdbgp:PathId
(scalar:Uint32)
Bestpath IdRANGE: [0, 4294967295]
numPathsscalar:Uint32
Number of paths availableRANGE: [0, 4294967295]
pfxaddress:Ip
PrefixValue must match ipv4 or ipv6 known format
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
rtFlagsbgp:RtFlags
(scalar:Bitmask32)
FlagsSELECTION:
1 - new
2 - xmit
4 - rib
8 - best
16 - suppressed
32 - exported
64 - locked
128 - vpn
256 - label
512 - l2rib-evpn
1024 - hw
2048 - table-map-filtered
verbgp:RtVer
(scalar:Uint32)
Version of the routeRANGE: [0, 4294967295]


bgpPath Properties

The following table contains information about the bgpPath properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
aggraddress:Ip
AggregatorValue must match ipv4 or ipv6 known format
aggrAsbgp:AsnNum
(string:Basic)
Aggregator ASA sequence of characters
asPathstring:Basic
AS-PathA sequence of characters
clusterLststring:Basic
Cluster-ListA sequence of characters
extCommstring:Basic
ExtcommunityA sequence of characters
flagsbgp:PathFlags
(scalar:Bitmask32)
Path flagsSELECTION:
1 - max-as-limit
2 - best-path
4 - rcvd-only
8 - modified
16 - multipath
32 - imported
64 - metric
128 - atomic-aggr
256 - unk-attr
512 - advertise
1024 - discarded-attr
idbgp:PathId
(scalar:Uint32)
Path idRANGE: [0, 4294967295]
importedRdbase:Community
Imported route distinguisher
localPrefrtmap:LocalPref
(scalar:Uint32)
Local preferenceRANGE: [0, 4294967295]
metricrtmap:Metric
(scalar:Uint32)
MetricRANGE: [0, 4294967295]
nhaddress:Ip
Next hopValue must match ipv4 or ipv6 known format
nhMetricbgp:Metric
(scalar:Uint32)
Nexthop metricRANGE: [0, 4294967295]
operStbgp:PathSt
(scalar:Enum8)
The path status.SELECTION:
0 - deleted
1 - staled
2 - valid
3 - invalid
4 - history
5 - suppressed
6 - dampened
origImportedRdbase:Community
Original Imported Src Route Distinguisher
originbgp:Origin
(scalar:Enum8)
OriginSELECTION:
1 - igp
2 - egp
3 - incomplete
DEFAULT: igp
originatorIdaddress:Ip
Originator IdValue must match ipv4 or ipv6 known format
peeraddress:Ip
Peer source of route pathValue must match ipv4 or ipv6 known format
peerRtrIdstring:Basic
Peer router id ipaddressA sequence of characters
rcvdLblstring:Basic
Received labelA sequence of characters
regCommstring:Basic
The regular community.A sequence of characters
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
typebgp:PathT
(scalar:Enum8)
Path typeSELECTION:
1 - internal
2 - external
3 - confederation
4 - local
5 - aggregate
6 - redistribute
7 - injected
DEFAULT: internal
unknownAttrDatastring:Basic
Unknown Attribute DataA sequence of characters
unknownAttrLenbgp:UnknownAttrLen
(scalar:Uint32)
Unknown Attribute Length
RANGE: [0 , 0xffffffff]
weightrtmap:Weight
(scalar:Uint16)
WeightRANGE: [0, 65535]


bgpExtComm Properties

The following table contains information about the bgpExtComm properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
encapbase:Encap
EncapsulationSELECTION: unknown, vlan-%d or vxlan-%d
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
rtrMacaddress:MAC
Router Mac address from nveValue must match MM:MM:MM:SS:SS:SS format


bgpExtCommRt Properties

The following table contains information about the bgpExtCommRt properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
communitybase:Community
Community value
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.


Related Documentation

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