Configuring Community Lists
You can use community lists to filter BGP routes based on the community attribute. The community number consists of a 4-byte value in the aa:nn format. The first two bytes represent the autonomous system number, and the last two bytes represent a user-defined network number. When you configure multiple values in the same community list statement, all community values must match to satisfy the community list filter. When you configure multiple values in separate community list statements, the first list that matches a condition is processed. Use community lists in a match statement to filter BGP routes based on the community attribute.
For more information, see the Cisco Nexus 9000 Series NX-OS Unicast Routing Configuration Guide:
Configuring a Standard Community List to Accept
Configuring a Standard Community List to Accept
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"rpmEntity": {
"children": [
{
"rtregcomRule": {
"attributes": {
"name": "SampleString_123"
},
"children": [
{
"rtregcomEntry": {
"attributes": {
"action": "permit",
"order": "1243"
},
"children": [
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:65535:0"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:65535:65283"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:123:12"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:0:0"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:65535:65282"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:65535:65281"
}
}
}
]
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<rpm-items>
<rtregcom-items>
<Rule-list>
<name>SampleString_123</name>
<ent-items>
<Entry-list>
<order>1243</order>
<action>permit</action>
<item-items>
<Item-list>
<community>regular:as2-nn2:65535:0</community>
</Item-list>
<Item-list>
<community>regular:as2-nn2:65535:65283</community>
</Item-list>
<Item-list>
<community>regular:as2-nn2:123:12</community>
</Item-list>
<Item-list>
<community>regular:as2-nn2:0:0</community>
</Item-list>
<Item-list>
<community>regular:as2-nn2:65535:65282</community>
</Item-list>
<Item-list>
<community>regular:as2-nn2:65535:65281</community>
</Item-list>
</item-items>
</Entry-list>
</ent-items>
</Rule-list>
</rtregcom-items>
</rpm-items>
</System>
Note: This example was added in Release 9.3(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.
ip community-list standard SampleString_123 seq 1243 permit internet no-advertise no-export local-AS graceful-shutdown 123:12
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
rpmEntity | sys/rpm |
rtregcomRule | sys/rpm/rtregcom-[SampleString_123] |
rtregcomEntry | sys/rpm/rtregcom-[SampleString_123]/ent-1243 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:65535:0 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:65535:65283 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:123:12 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:0:0 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:65535:65282 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:65535:65281 |
rtregcomRule Properties
The following table contains information about the rtregcomRule 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 Name | Data Type | Description | Values |
---|---|---|---|
name | pol:ObjName string:Basic | The name of the object. | RANGE: Min: "1" Max: "64" |
rtregcomEntry Properties
The following table contains information about the rtregcomEntry 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 Name | Data Type | Description | Values |
---|---|---|---|
action | rtflt:Action (scalar:Enum8) | Action | SELECTION: 0 - deny 1 - permit DEFAULT: permit |
order | rtflt:Order (scalar:Uint32) | Order | RANGE: [0 , 65535] |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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:
Deleting a Standard Community List to Accept
Deleting a Standard Community List to Accept
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"rpmEntity": {
"children": [
{
"rtregcomRule": {
"attributes": {
"name": "SampleString_123"
},
"children": [
{
"rtregcomEntry": {
"attributes": {
"order": "1243"
},
"children": [
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:65535:0",
"status": "deleted"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:65535:65283",
"status": "deleted"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:123:12",
"status": "deleted"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:0:0",
"status": "deleted"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:65535:65282",
"status": "deleted"
}
}
},
{
"rtregcomItem": {
"attributes": {
"community": "regular:as2-nn2:65535:65281",
"status": "deleted"
}
}
}
]
}
}
]
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<rpm-items>
<rtregcom-items>
<Rule-list>
<name>SampleString_123</name>
<ent-items>
<Entry-list>
<order>1243</order>
<item-items>
<Item-list nc:operation="delete">
<community>regular:as2-nn2:65535:0</community>
</Item-list>
<Item-list nc:operation="delete">
<community>regular:as2-nn2:65535:65283</community>
</Item-list>
<Item-list nc:operation="delete">
<community>regular:as2-nn2:123:12</community>
</Item-list>
<Item-list nc:operation="delete">
<community>regular:as2-nn2:0:0</community>
</Item-list>
<Item-list nc:operation="delete">
<community>regular:as2-nn2:65535:65282</community>
</Item-list>
<Item-list nc:operation="delete">
<community>regular:as2-nn2:65535:65281</community>
</Item-list>
</item-items>
</Entry-list>
</ent-items>
</Rule-list>
</rtregcom-items>
</rpm-items>
</System>
Note: This example was added in Release 9.3(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.
no ip community-list standard SampleString_123 seq 1243 permit internet no-advertise no-export local-AS graceful-shutdown 123:12
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
rpmEntity | sys/rpm |
rtregcomRule | sys/rpm/rtregcom-[SampleString_123] |
rtregcomEntry | sys/rpm/rtregcom-[SampleString_123]/ent-1243 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:65535:0 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:65535:65283 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:123:12 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:0:0 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:65535:65282 |
rtregcomItem | sys/rpm/rtregcom-[SampleString_123]/ent-1243/item-regular:as2-nn2:65535:65281 |
rtregcomRule Properties
The following table contains information about the rtregcomRule 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 Name | Data Type | Description | Values |
---|---|---|---|
name | pol:ObjName string:Basic | The name of the object. | RANGE: Min: "1" Max: "64" |
rtregcomEntry Properties
The following table contains information about the rtregcomEntry 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 Name | Data Type | Description | Values |
---|---|---|---|
order | rtflt:Order (scalar:Uint32) | Order | RANGE: [0 , 65535] |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community | |
status | mo:ModificationStatus (scalar:Bitmask32) | Modification status | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community | |
status | mo:ModificationStatus (scalar:Bitmask32) | Modification status | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community | |
status | mo:ModificationStatus (scalar:Bitmask32) | Modification status | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community | |
status | mo:ModificationStatus (scalar:Bitmask32) | Modification status | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community | |
status | mo:ModificationStatus (scalar:Bitmask32) | Modification status | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
rtregcomItem Properties
The following table contains information about the rtregcomItem 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 Name | Data Type | Description | Values |
---|---|---|---|
community | base:Community | Community | |
status | mo:ModificationStatus (scalar:Bitmask32) | Modification status | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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: