Configuring ACL (Egress Direction)
This section contains payload examples and CLIs to demonstrate how to use the NX-API REST API to configure IP ACLs on Cisco Nexus 3000 and 9000 Series switches and to show how the REST APIs correspond to the CLI commands. For more information, see the Cisco Nexus 9000 Series NX-OS Security Configuration Guide, Release 7.x.
Attaching an IPv4 ACL to an Interface in the Egress Direction
Attaching an IPv4 ACL to an Interface in the Egress Direction
POST http://<mgmt0_IP>/api/mo/sys/acl/ipv6/policy/egress.json
{
"aclEgress": {
"children": [
{
"aclIf": {
"attributes": {
"name": "eth1/2"
},
"children": [
{
"aclInst": {
"attributes": {
"name": "bar"
}}}]}}]}}
{
imdata": []
}
<System>
<acl-items>
<ipv4-items>
<policy-items>
<egress-items>
<intf-items>
<If-list>
<name>eth1/2</name>
<acl-items>
<name>bar</name>
</acl-items>
</If-list>
</intf-items>
</egress-items>
</policy-items>
</ipv4-items>
</acl-items>
</System>
Attaches an IPv4 ACL to an interface in the egress direction.
CLI Commands
The CLI commands and options listed below are the 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.
interface eth1/2
ip access-group bar out
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
Attaching an IPv6 ACL to an Interface in the Egress Direction
Attaching an IPv6 ACL to an Interface in the Egress Direction
POST http://<mgmt0_IP>/api/mo/sys/acl/ipv6/policy/egress.json
{
"aclEgress": {
"children": [
{
"aclIf": {
"attributes": {
"name": "eth1/3"
},
"children": [
{
"aclInst": {
"attributes": {
"name": "bar6"
}}}]}}]}}
{
imdata": []
}
<System>
<acl-items>
<ipv6-items>
<policy-items>
<egress-items>
<intf-items>
<If-list>
<name>eth1/3</name>
<acl-items>
<name>bar6</name>
</acl-items>
</If-list>
</intf-items>
</egress-items>
</policy-items>
</ipv6-items>
</acl-items>
</System>
Attaches and an IPv6 ACL to an interface in the egress direction.
Note: This example was added in Release 7.0(3)I6(1).
CLI Commands
The CLI commands and options listed below are the 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.
interface eth1/3
ipv6 traffic-filter bar6 out
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