ACL Config
ACL Config
Configuration for
CCNA Students
By
https://www.facebook.com/groups/1720572871550995/
Lab 1 (Standard Numbered ACL):
Objective:
Permit all traffic coming from R2 to R1. And prevent all traffic coming from R3 to R1.
R1(config)#int f0/0
R1(config-if)#no shutdown
R1(config-if)#router eigrp 1
R1(config-router)#no auto-summary
R2(config)#int f0/0
R2(config-if)#no shutdown
R2(config-if)#int f0/1
R2(config-if)#no shutdown
R2(config-if)#router eigrp 1
R2(config-router)#no auto-summary
R3(config)#int f0/0
R3(config-if)#no shutdown
R3(config-if)#int f0/1
R3(config-if)#no shutdown
R3(config-if)#router eigrp 1
R3(config-router)#no auto-summary
C:\Users\pc1>ping 10.0.0.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/84/108 ms
R1(config)#int f0/0
R1(config-if)#ip access-group 1 in
To test:
R2#ping 10.0.0.1
!!!!!
R3#ping 10.0.0.1
UUUUU
C:\Users\pc1>ping 10.0.0.1
The PC can’t reach the 10.0.0.1 IP address due to the explicit deny at the end of the chain.
Note:
R1#ping 192.168.0.100
.....
The Echo request is successful but the Echo reply couldn’t return back to R1.
To verify:
R1#show access-list
If we want to allow all other traffic coming from all other networks:
C:\Users\pc1>ping 10.0.0.1
R1#show access-list
30 permit any
Objective:
1- Permit Telnet coming from R1 to R2 and deny pings coming from R1 to R2.
2- Permit pings coming from R3 to R2 and deny telnet coming from R3 to R2.
R1(config)#no access-list 1
R1(config)#int f0/0
R1(config-if)#no ip access-group 1 in
R2(config)#line vty 0 4
R2(config-line)#password 123
R2(config-line)#login
R2(config-if)#exit
R2(config)#access-list 100 permit tcp host 10.0.0.1 host 10.0.0.2 eq 23
R2(config)#access-list 100 deny icmp host 10.0.0.1 host 10.0.0.2 echo
R2(config)#access-list 100 permit eigrp any any (The control plane must be allowed
too).
R2(config)#access-list 101 permit icmp host 11.0.0.3 host 11.0.0.2 echo
R2(config)#access-list 101 deny tcp host 11.0.0.3 host 11.0.0.2 eq telnet
R2(config)#access-list 101 permit eigrp any any (The control plane must be allowed
too).
R2(config)#int f0/0
R2(config-if)#ip access-group 100 in
R2(config-if)#int f0/1
R2(config-if)#ip access-group 101 in
To test:
R1#telnet 10.0.0.2
R1#ping 10.0.0.2
UUUUU
R3#telnet 11.0.0.2
R3#ping 11.0.0.2
!!!!!
C:\Users\pc1>ping 11.0.0.2
To verify:
C:\Users\pc1>ping 11.0.0.2
To verify:
Notes:
1- The log key word can be used to log the changes:
Ex) R2(config)#access-list 101 deny ip any any log
2- The remark option is used as a description and can be seen in the running-config.
Ex) R2(config)#access-list 101 remark This ACL is applied to all traffic coming from LAN1
Using named ACL allows us to insert sentences and delete some of them without destroying the
whole chain.
10 permit 10.0.0.2
30 permit 11.0.0.3
R1(config-std-nacl)#no 30
10 permit 10.0.0.2
15 permit 11.0.0.3
R1(config-std-nacl)#int f0/0
R1(config-if)#ip access-group 1 in
To test:
R3#ping 10.0.0.1
!!!!!
R2#ping 10.0.0.1 source f0/1 (To simulate that the pings are coming from 11.0.0.2).
UUUUU
R1(config)#end
R1#debug ip packet 2
R1#ping 10.0.0.2
!!!!!
*Mar 1 01:27:07.307: IP: tableid=0, s=10.0.0.1 (local), d=10.0.0.2 (FastEthernet0/0), routed via
FIB
*Mar 1 01:27:07.311: IP: s=10.0.0.1 (local), d=10.0.0.2 (FastEthernet0/0), len 100, sending
R1(config)#int loop 1
R1(config-if)#router eigrp 1
R1(config-router)#net 1.0.0.0
!!!!!
Lab 6 (Access-class):
Since configuring ACL affects all kind of traffic, we can configure the ACL under the line vty to
just affect the telnet process not the whole traffic.
R2(config)#line vty 0 4
R2(config-line)#access-class 1 in
To test:
R1#10.0.0.2
R3#11.0.0.2
But if we want to control connecting to other routers using telnet, the access-class command
must be configured under the line console.
R1(config)#line vty 0 4
R1(config-line)#password 123
R1(config-line)#login
R3(config)#line vty 0 4
R3(config-line)#password 123
R3(config-line)#login
R2#10.0.0.1
R2#11.0.0.3
R2(config)#line con 0
R2(config-line)#access-class 1 out
To test:
R2#10.0.0.1
R2#11.0.0.3
Trying 11.0.0.3 ...
Objective:
2- R1(config)#ipv6 unicast-routing
R1(config)#ipv6 router eigrp 1
R1(config-rtr)#no shut
R1(config-rtr)#router-id 1.1.1.1
R1(config-rtr)#int f0/0
R1(config-if)#ipv6 eigrp 1
R2(config)#ipv6 unicast-routing
R2(config)#ipv6 router eigrp 1
R2(config-rtr)#no shut
R2(config-rtr)#router-id 2.2.2.2
R2(config-rtr)#int f0/0
R2(config-if)#ipv6 eigrp 1
R2(config-if)#int
R2(config-if)#int f0/1
R2(config-if)#ipv6 eigrp 1
R3(config)#ipv6 unicast-routing
R3(config)#ipv6 router eigrp 1
R3(config-rtr)#no shut
R3(config-rtr)#router-id 3.3.3.3
R3(config-rtr)#int f0/0
R3(config-if)#ipv6 eigrp 1
R3(config-if)#int f0/1
R3(config-if)#ipv6 eigrp 1
To test:
R1#ping 2001:3::100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:3::100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/88/136 ms
R1#show ipv6 route
IPv6 Routing Table - 5 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route, M - MIPv6
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
D - EIGRP, EX - EIGRP external
D 2001:3::/64 [90/332800]
via FE80::C001:2FF:FE88:0, FastEthernet0/0
C 2001:12::/64 [0/0]
via ::, FastEthernet0/0
L 2001:12::1/128 [0/0]
via ::, FastEthernet0/0
D 2001:23::/64 [90/307200]
via FE80::C001:2FF:FE88:0, FastEthernet0/0
L FF00::/8 [0/0]
via ::, Null0
C:\Users\abeer>ping 2001:12::1
Pinging 2001:12::1 with 32 bytes of data:
Reply from 2001:12::1: time=117ms
Reply from 2001:12::1: time=93ms
Reply from 2001:12::1: time=78ms
Reply from 2001:12::1: time=78ms
To Test:
R1#2001:12::2
Trying 2001:12::2 ... Open
R3#2001:23::2
Trying 2001:23::2 ...
% Connection refused by remote host
R3#2001:12::2
Trying 2001:12::2 ...
% Connection refused by remote host
To Verify:
R2#show access-list
IPv6 access list R1_TO_R2
permit tcp host 2001:12::1 host 2001:12::2 eq telnet (2 matches) sequence 10
Hint1)
If we want to configure the ACL under the interface, we will use the command:
R2(config-if)#ipv6 traffic-filter R1_TO_R2
Hint2)
Standard ACL must be configured nearest to the destination. Extended ACL should
be configured nearest to the source.
Hint3)
Only one ACL can be applied at the interface level at a direction.
Best Wishes
Abeer