Bookmark this page

Managing Access Control Lists on IOS

Objectives

After completing this section, you should be able to create an ACL on a Cisco IOS device.

Managing Access Control Lists (ACLs)

On IOS devices, ACLs are used to control access to services.

This playbook creates a MGMT-ACCESS ACL, which can then be associated with SNMP or SSH, for instance.

---
- name: A play that creates a management access ACL
  hosts: ios
  gather_facts: no

  tasks:
    - name: create a standard ACL
      ios_config:
        lines:
          # each of the following two items consist of a single line
          # with no line breaks
          - 10 permit {{ workstation_ipv4 | ipaddr('address') }} {{ workstation_ipv4 | ipaddr('wildcard') }} log
          - 20 permit {{ tower_ipv4 | ipaddr('address') }} {{ tower_ipv4 | ipaddr('wildcard') }} log
        parents: ["access-list standard 1"]
        before: ["no access-list standard 1"]
        match: exact
Revision: do457-2.5-4693601