Configuring SVIs
After you have configured VLANs, you can configure switched virtual interfaces (SVIs). An SVI is a virtual routed interface that connects a VLAN on the device to the Layer 3 router engine on the same device.
This section contains payload examples to demonstrate how to use the NX-API REST API to configure SVIs on the Cisco Nexus 3000 and 9000 Series switches.
Note: Configuring SVIs requires enabling interface VLAN.
Enabling Interface VLAN
Enabling Interface VLAN
POST http://<IP_Address>/api/node/mo/sys.json
{
"topSystem": {
"children": [
{
"fmEntity": {
"children": [
{
"fmInterfaceVlan": {
"attributes": {
"adminSt": "enabled"
}
}
}
]
}
}
]
}
}
{
imdata": []
}
<System>
<fm-items>
<ifvlan-items>
<adminSt>enabled</adminSt>
</ifvlan-items>
</fm-items>
</System>
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
feature interface-vlan
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
Disabling Interface VLAN
Disabling Interface VLAN
POST http://<IP_Address>/api/node/mo/sys.json
{
"topSystem": {
"children": [
{
"fmEntity": {
"children": [
{
"fmInterfaceVlan": {
"attributes": {
"adminSt": "disabled"
}
}
}
]
}
}
]
}
}
{
imdata": []
}
<System>
<fm-items>
<ifvlan-items>
<adminSt>disabled</adminSt>
</ifvlan-items>
</fm-items>
</System>
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
no feature interface-vlan
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 and Configuring an SVI Interface
Creating and Configuring an SVI Interface
POST http://<IP_Address>/api/node/mo/sys/intf/svi-[vlan1000].json
{
"sviIf": {
"attributes": {
"id": "vlan1000",
"adminSt": "up",
"autostate": "no",
"bw": "100000",
"carDel": "50",
"delay": "10",
"descr": "MDP SVI vlan 1000",
"inbMgmt": "no",
"loadIntvl1": "70",
"mac": "2.3.4",
"medium": "p2p",
"mtu": "9216",
"snmpTrap": "yes"
}
}
}
{
imdata": []
}
This example creates an SVI named vlan1000.
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
[no] interface vlan <vlan_id>
[no] shutdown
[no] autostate
bandwidth <bw>
carrier-delay <msec>
delay <msec>
description <string>
load-interval {interval seconds {1 | 2 | 3}}
mac-address <mac>
[no] management
medium { broadcast | p2p }
mtu <mtu>
[no] snmp trap link-status
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 an SVI Configuration
Querying an SVI Configuration
GET http://<IP_Address>/api/node/mo/sys/intf/svi-[vlan1000].json
{
"totalCount": "1",
"imdata": [
{
"sviIf": {
"attributes": {
"adminSt": "up",
"autostate": "no",
"bw": "100000",
"carDel": "50",
"childAction": "",
"delay": "10",
"descr": "MDP SVI vlan 1000",
"dn": "sys/intf/svi-[vlan1000]",
"id": "vlan1000",
"inbMgmt": "no",
"iod": "19",
"loadIntvl1": "70",
"loadIntvl2": "300",
"loadIntvl3": "60",
"mac": "00:02:00:03:00:04",
"medium": "p2p",
"modTs": "2016-12-01T23:50:37.569+00:00",
"monPolDn": "uni/fabric/monfab-default",
"mtu": "9216",
"mtuInherit": "yes",
"name": "",
"operSt": "down",
"operStQual": "no-vlan",
"osSum": "failed",
"persistentOnReload": "true",
"snmpTrap": "yes",
"status": "",
"uid": "15214",
"vlanId": "1000",
"vlanT": "0"
}
}
}
]
}
This example reads the configuration of the SVI named vlan1000
The HTTP request in this example queries the SVI configuration that was set in the previous example.
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