Configuring Virtual Port Channels
This section contains payload examples to demonstrate how to use the NX-API REST API to configure virtual port channels on the Cisco Nexus 3000 and 9000 Series switches.
Configuring a vPC Domain
Configuring a vPC Domain
POST http://<IP_Address>/api/node/mo/sys/vpc/inst/dom.json
{
"vpcDom": {
"attributes": {
"autoRecovery": "enabled",
"delayRestoreSVI": "333",
"excludeSVI": "555",
"grcflCnstncyChck": "enabled",
"id": "1",
"peerGw": "enabled",
"peerSwitch": "enabled",
"rolePrio": "222",
"sysMac": "00:03:00:04:00:05",
"sysPrio": "111"
},
"children": [
{
"vpcKeepalive": {
"attributes": {
"destIp": "192.0.20.11"
}}}]}}
This example:
- Ensures that VLAN interface 555 does not go down on the vPC secondary device when the vPC peer link fails
- Enables graceful consistency checking
- Configures vPC peer devices to act as peer gateways
- Configures a pure vPC peer switch topology
- Manually configures the VPC peer device role
- Manually configures a VPC domain MAC address
- Manually configures the system priority
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
vpc domain 1
auto-recovery
delay restore interface-vlan 333
dual-active exclude interface-vlan 555
graceful consistency-check
peer-gateway
peer-switch
role priority 222
system-mac 3.4.5
system-priority 111
peer-keepalive destination 192.0.20.11
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 the vPC Peer Link
Creating the vPC Peer Link
POST http://<IP_Address>/api/node/mo/sys/vpc/inst/dom.json
{
"vpcKeepalive": {
"children": [
{
"vpcPeerLink": {
"attributes": {
"id": "po10"
}
}
}
]
}
}
Configures the selected port channel as the vPC peer link.
Prerequisites:
- The port-channel must already exist. See Configuring Port Channels for detailed information about port channels.
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
interface port-channel 10
vpc peer-link
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
Moving Other Port Channels into a vPC
Moving Other Port Channels into a vPC
POST http://<IP_Address>/api/node/mo/sys/vpc/inst/dom/if-20.json
{
"vpcIf": {
"attributes": {
"id": "20"
},
"children": [
{
"vpcRsVpcConf": {
"attributes": {
"tDn": "sys/intf/aggr-[po10]"
}
}
}
]
}
}
This example configures the selected port channel into the vPC to connect to the downstream device.
Prerequisites:
- The port-channel must already exist. See Configuring Port Channels for detailed information about port channels.
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
interface port-channel 10
vpc 20
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 Address Synchronization
Configuring Address Synchronization
POST http://<IP_Address>/api/node/mo/sys/intf/aggr-[po13].json
{
"pcAggrIf": {
"attributes": {
"id": "po13"
}
}
}
IPv4 and IPv6 ND address synchronization supports faster convergence of address tables between the vPC peers.
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
ip arp synchronize
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 the vPC Domain
Querying the vPC Domain
HTTP GET http://<IP_Address>/api/node/mo/sys/vpc/inst/dom.json
{
"totalCount": "1",
"imdata": [
{
"vpcDom": {
"attributes": {
"adminSt": "enabled",
"autoRecovery": "disabled",
"autoRecoveryIntvl": "240",
"batchedVpcInv": "",
"childAction": "",
"compatQual": "1102512194",
"compatQualStr": "Consistency Check Not Performed",
"compatSt": "fail",
"deadIntvl": "200",
"delayPeerLinkBringup": "0",
"delayRestoreSVI": "10",
"delayRestoreVPC": "30",
"dn": "sys/vpc/inst/dom",
"dualActiveSt": "false",
"excludeSVI": "",
"grcflCnstncyChck": "disabled",
"id": "1",
"ipv4CfsSync": "disabled",
"ipv6CfsSync": "disabled",
"issuFromVer": "",
"issuToVer": "",
"lacpRole": "election-not-done",
"localMAC": "74:26:AC:EC:91:87",
"localPrio": "0",
"modTs": "2016-10-13T13:42:24.010+00:00",
"monPolDn": "",
"name": "",
"oldRole": "election-not-done",
"operRole": "election-not-done",
"operSt": "configured-master",
"orphanPortList": "0",
"peerGw": "enabled",
"peerIp": "0.0.0.0",
"peerMAC": "00:00:00:00:00:00",
"peerPrio": "0",
"peerSt": "down",
"peerStQual": "success",
"peerSwitch": "disabled",
"peerVersion": "23",
"persistentOnReload": "true",
"rolePrio": "3",
"status": "",
"summOperRole": "election-not-done",
"sysMac": "00:03:02:02:01:01",
"sysPrio": "11",
"track": "0",
"type2CompatQual": "1102512194",
"type2CompatQualStr": "Consistency Check Not Performed",
"type2CompatSt": "fail",
"vIpAnnounceDelay": "45",
"virtualIp": "0.0.0.0",
"vpcCfgFailedBmp": "",
"vpcCfgFailedTs": "00:00:00:00.000",
"vpcCfgState": "0",
"vpcMAC": "00:00:00:00:00:00",
"vpcPrio": "32667"
}}}]}
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