Jeremy’s IT Lab lecture video:
Commands
Commands List
ACL Show Commands
11. ACL
Link to original
- show access-lists
-->Shows ALL configured access-lists on the router- show ip access-lists
-->Shows IP related access-lists on the routerACL Global Commands
ACL Global
1. General
- access-list number remark description
-->Gives the specified access list a remark/description- ip access-list resequence acl-name/acl-number starting-seq-number increment
-->Modifies the access list’s sequencing numbers according to specified arguments2. Standard
- access-list number { deny
|permit } ip wildcard-mask-->Configures a standard numbered ACL- ip access-list standard acl-name/acl-number
-->Enters standard named ACL configuration mode
- [entry-number] { deny
|permit } ip wildcard-mask3. Extended
Link to original
- access-list number { deny
|permit } protocol src-ip dst-ip-->Configures an extended numbered ACL- ip access-list extended acl-name/acl-number
-->Enters standard named ACL configuration mode
- [entry-number] { deny
|permit } protocol src-ip dst-ip- [entry-number] { deny
|permit } protocol src-ip argument source-port-num dst-ip argument dst-port-num (Arguments: eq/gt/lt/neq/range )ACL Interface Commands
ACL Interface
Link to original
- ip access-group number/name { in
|out }-->Applies the specified access-list onto the interface, either inbound or outbound
ACL Info
ACL Configuration Methods
There are two ways of configuring ACLs. One is done through the ‘global configuration’ mode and the other is through the ‘ACL configuration’ mode where you write the configuration in sub-commands.
- Global configuration is done through the command:
access-list NUMBER { permit | deny } IP WILDCARD-MASK
- ACL configuration is done through the command:
ip access-list standard NAME/NUMBER
Advantages of Named ACL Config Mode
- Going into the ACL configuration mode allows you to delete individual entries in the ACL with
no ENTRY-NUMBER. (Deleting individual entries in global configuration will lead to the deletion of the whole ACL, even if one entry was specified) - You can insert new entries in between other entries by specifying the sequence number.
Resequencing ACLs
ACL has a resequencing function that allows you to edit ACL entries.
- It is done through the command:
ip access-list resequence ACL-ID STARTING-SEQ-NUM INCREMENT
Extended ACLs
Extended ACLs are very similar to Standard ACLs
- Extended ACLs match based on source/destination IP address, source/destination port address, etc.
- Extended ACLs can use the number range (100 - 199) and (2000 - 2699)
- They should be applied as close to the source as possible.
- They include two subtypes:
- Extended numbered ACLs
- Extended named ACLs
Extended ACL Configuration
There are two ways to create a extended ACL:
- Global configuration / directly
- This method only allows you to create numbered ACLs
- Done through the command:
access-list EXTENDED-ACL-NUMBER { permit | deny } PROTOCOL SRC-IP DST-IP
- ACL configuration mode
- Done through the command:
ip access-list extended NUMBER/NAME
- Which puts you in Extended ACL configuration mode. ACEs can be set through the following command format:
- [entry-number] { deny | permit } protocol src-ip dst-ip
- [entry-number] { deny | permit } protocol src-ip argument source-port-num dst-ip argument dst-port-num
- Done through the command:
Standard and Extended ACL - Host addresses
In standard ACLs, you could specify the source IP address, insert the command, and the router would automatically assume that it’s a host route.
However, in extended ACLs, to specify a /32 source or destination you have to use either the host option or specify the wildcard mask. You can’t just write the address without either of those.
Extended ACL Protocols
In extended ACLs you can filter by what protocol is being used in the packet. Some of the important protocols you need to know for the CCNA are these ones:
IP Protocol Numbers
Link to original
Protocol Number ICMP 1 TCP 6 UDP 17 EIGRP 88 OSPF 89
Extended ACL Protocol Arguments
- When matching TCP/UDP, you can optionally specify the source AND/OR destination ports to match.
- This is accomplished through the protocol arguments that can be written after ‘src-ip’ or ‘dst-ip’ while configuring ACLs
| Argument | Effect | Example |
|---|---|---|
| eq (Equal) | Matches ports equal to the specified port | eq 80 equal to port 80 |
| gt (Greater than) | Matches ports higher than the specified port | gt 80 greater than 80 (81 and greater) |
| lt (Less than) | Matches ports lower than the specified port | lt 80 less than 80 (79 and less) |
| neq (Not equal) | Matches ports that aren’t the specified port | neq 80 not equal to 80 |
| range | Matches ports that fit into the specified range | range 80 100 from port 80 to port 100 |
General note on Extended ACLs
If you specify the protocol, source IP, source port, destination IP, destination port, etc, a packet must match ALL of those values to match the ACL entry. Even if it matches all except one of the parameters, the packet won’t match that entry of the ACL.
Jeremy’s IT Lab előadásvideó:
Parancsok
Parancslista
ACL Show Parancsok
11. ACL
Eredeti hivatkozása
- show access-lists
-->Megjeleníti az ÖSSZES konfigurált hozzáférési listát a routeren- show ip access-lists
-->Megjeleníti az IP alapú hozzáférési listákat a routerenACL Globális Parancsok
ACL Globális
1. Általános
- access-list number remark description
-->Megjegyzést/leírást rendel a megadott hozzáférési listához- ip access-list resequence acl-name/acl-number starting-seq-number increment
-->Újraszámozza az ACL bejegyzéseinek sorszámait a megadott paraméterek szerint2. Standard
- access-list number { deny
|permit } ip wildcard-mask-->Számozott standard ACL bejegyzést konfigurál- ip access-list standard acl-name/acl-number
-->Belép a nevesített standard ACL konfigurációs módjába
- [entry-number] { deny
|permit } ip wildcard-mask3. Extended
Eredeti hivatkozása
- access-list number { deny
|permit } protocol src-ip dst-ip-->Számozott kiterjesztett (extended) ACL bejegyzést konfigurál- ip access-list extended acl-name/acl-number
-->Belép a nevesített kiterjesztett (extended) ACL konfigurációs módjába
- [entry-number] { deny
|permit } protocol src-ip dst-ip- [entry-number] { deny
|permit } protocol src-ip argument source-port-num dst-ip argument dst-port-num (Paraméterek: eq/gt/lt/neq/range )ACL Interfész Parancsok
ACL Interfész
Eredeti hivatkozása
- ip access-group number/name { in
|out }-->Alkalmazza a megadott hozzáférési listát az interfészre, bejövő (inbound) vagy kimenő (outbound) irányban
ACL Információk
ACL Konfigurációs Módszerek
Kétféleképpen konfigurálhatunk ACL-eket: a 'globális konfigurációs' módban egyetlen sorban, vagy az ACL 'konfigurációs' módban alparancsok segítségével.
- A globális konfiguráció az alábbi paranccsal történik:
access-list NUMBER { permit | deny } IP WILDCARD-MASK
- Az ACL konfigurációs mód belépése:
ip access-list standard NAME/NUMBER
A Nevesített ACL Konfigurációs Mód Előnyei
- Az ACL konfigurációs mód lehetővé teszi egyedi bejegyzések törlését a
no ENTRY-NUMBERparanccsal. (A globális konfigurációs módban egyetlen bejegyzés `no` paranccsal való törlése a teljes ACL törlését eredményezi!) - Új szabályokat szúrhatsz be a meglévő bejegyzések közé a sequence number (sorszám) megadásával.
ACL-ek Újraszámozása (Resequencing)
Az ACL rendelkezik egy resequencing funkcióval, amellyel a bejegyzések sorszámai újraoszthatók.
- Parancs formátuma:
ip access-list resequence ACL-ID STARTING-SEQ-NUM INCREMENT
Extended (Kiterjesztett) ACL-ek
Az Extended ACL-ek felépítésükben nagyon hasonlítanak a Standard ACL-ekhez:
- Az Extended ACL-ek forrás/cél IP cím, forrás/cél portszám, protokoll stb. alapján szűrnek.
- Az Extended ACL-ek a (100 - 199) és (2000 - 2699) számtartományokat használhatják.
- A lehető legközelebb kell őket alkalmazni a forráshoz (source).
- Két altípusuk van:
- Extended számozott (numbered) ACL-ek
- Extended nevesített (named) ACL-ek
Extended ACL Konfiguráció
Kétféleképpen hozhatunk létre extended ACL-t:
- Globális konfigurációban / közvetlenül
- Ez a módszer csak számozott ACL-ek létrehozását engedi.
- Parancs formátuma:
access-list EXTENDED-ACL-NUMBER { permit | deny } PROTOCOL SRC-IP DST-IP
- ACL konfigurációs módban
- Belépés a paranccsal:
ip access-list extended NUMBER/NAME
- Ez beléptet az Extended ACL konfigurációs módjába. Az ACE szabályok az alábbi formátumokban adhatók meg:
- [entry-number] { deny | permit } protocol src-ip dst-ip
- [entry-number] { deny | permit } protocol src-ip argument source-port-num dst-ip argument dst-port-num
- Belépés a paranccsal:
Standard és Extended ACL - Host címek
A standard ACL-ekben elég megadni a forrás IP címet wildcard nélkül, és a router automatikusan host útvonalként kezeli.
Az extended ACL-ekben viszont a /32-es forrás vagy cél megadásához kötelező vagy a host opciót használni, vagy explicit kiírni a wildcard mask-ot. Nem lehet pusztán a címet beírni ezen kiegészítők nélkül.
Extended ACL Protokollok
Az extended ACL-ekben a csomagban használt protokoll szerint is szűrhetünk. A CCNA vizsgához szükséges legfontosabb protokollok:
IP Protokoll Számok
Eredeti hivatkozása
Protokoll Szám ICMP 1 TCP 6 UDP 17 EIGRP 88 OSPF 89
Extended ACL Protokoll Paraméterek
- TCP/UDP illesztésekor tetszőlegesen megadhatjuk a szűrni kívánt forrás ÉS/VAGY cél portszámokat is.
- Ezt a protokoll paraméterek segítségével érhetjük el, amelyeket az ACL konfigurálásakor a 'src-ip' vagy 'dst-ip' után írhatunk be.
| Paraméter | Hatás | Példa |
|---|---|---|
| eq (Equal) | Pontosan a megadott portszámmal egyező portok | eq 80 egyenlő a 80-as porttal |
| gt (Greater than) | A megadott portszámnál nagyobb portok | gt 80 nagyobb mint 80 (81 és felette) |
| lt (Less than) | A megadott portszámnál kisebb portok | lt 80 kisebb mint 80 (79 és alatta) |
| neq (Not equal) | A megadott portszámmal nem egyező portok | neq 80 nem egyenlő 80-nal |
| range | A megadott tartományba eső portok | range 80 100 80-tól 100-ig tartó portok |
Általános megjegyzés az Extended ACL-ekről
Ha megadod a protokoll, forrás IP, forrás port, cél IP, cél port stb. paramétereket, egy csomagnak az ÖSSZES felsorolt értékre kötelező illeszkednie az ACL bejegyzés érvényesüléséhez. Ha egyetlen paraméter sem egyezik, a csomag nem illeszkedik az adott ACE szabályra.