Basic Access Control Lists
Basic Access Control Lists
In this lab, you will learn how to configure basic network security using Access Control Lists. You will apply both standard and extended ACLs.
Configure each switch with the appropriate default gateway. Verify full IP connectivity using the ping command.
In standard ACL configuration mode, add a statement that denies any packets with a source address of 192.168.11.0/24 and prints a message to the console for each matched packet. R3(config-std-nacl)#deny 192.168.11.0 0.0.0.255 log
Step 2: Apply the ACL. Apply the ACL STND-1 as a filter on packets entering R3 through Serial interface 0/0/1. R3(config)#interface serial 0/0/1 R3(config-if)#ip access-group STND-1 in R3(config-if)#end R3#copy run start Step 3: Test the ACL. Before testing the ACL, make sure that the console of R3 is visible. This will allow you to see the access list log messages when the packet is denied.
Test the ACL by pinging from PC2 to PC3. Since the ACL is designed to block traffic with source addresses from the 192.168.11.0/24 network, PC2 (192.168.11.10) should not be able to ping PC3. You can also use an extended ping from the Fa0/1 interface on R1 to the Fa0/1 interface on R3. R1#ping ip Target IP address: 192.168.30.1 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: y Source address or interface: 192.168.11.1 Type of service [0]: Set DF bit in IP header? [no]: Validate reply data? [no]: Data pattern [0xABCD]: Loose, Strict, Record, Timestamp, Verbose[none]: Sweep range of sizes [n]: Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.30.1, timeout is 2 seconds: Packet sent with a source address of 192.168.11.1 U.U.U Success rate is 0 percent (0/5) You should see the following message on the R3 console: *Sep 4 03:22:58.935: %SEC-6-IPACCESSLOGNP: list STND-1 denied 0 0.0.0.0 -> 192.168.11.1, 1 packet In privileged EXEC mode on R3, issue the show access-lists command.
You see output similar to the following. Each line of an ACL has an associated counter showing how many packets have matched the rule. Standard IP access list STND-1 10 deny 192.168.11.0, wildcard bits 0.0.0.255 log (5 matches) 20 permit any (25 matches) The purpose of this ACL was to block hosts from the 192.168.11.0/24 network. Any other hosts, such as those on the 192.168.10.0/24 network should be allowed access to the networks on R3. Conduct another test from PC1 to PC3 to ensure that this traffic is not blocked. You can also use an extended ping from the Fa0/0 interface on R1 to the Fa0/1 interface on R3. R1#ping ip Target IP address: 192.168.30.1
Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: y Source address or interface: 192.168.10.1 Type of service [0]: Set DF bit in IP header? [no]: Validate reply data? [no]: Data pattern [0xABCD]: Loose, Strict, Record, Timestamp, Verbose[none]: Sweep range of sizes [n]: Type escape sequence to abort. Packet sent with a source address of 192.168.10.1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms
Recall that the implicit deny all blocks all other traffic without the additional permit statement. Add the permit statement to ensure that other traffic is not blocked. R1(config-ext-nacl)#permit ip any any
Step 2: Apply the ACL. With standard ACLs, the best practice is to place the ACL as close to the destination as possible. Extended ACLs are typically placed close to the source. The EXTEND-1 ACL will be placed on the Serial interface, and will filter outbound traffic. R1(config)#interface serial 0/0/0 R1(config-if)#ip access-group EXTEND-1 out log R1(config-if)#end R1#copy run start
Step 3: Test the ACL. From PC1, ping the loopback interface on R2. These pings should fail, because all traffic from the 192.168.10.0/24 network is filtered when the destination is 209.165.200.225. If the destination is any other address, the pings should succeed. Confirm this by pinging R3 from the 192.168.10.0/24 network device. Note: The extended ping feature on R1 cannot be used to test this ACL, since the traffic will originate within R1 and will never be tested against the ACL applied to the R1 serial interface. You can further verify this by issuing the show ip access-list on R1 after pinging. R1#show ip access-list
Extended IP access list EXTEND-1 10 deny ip 192.168.10.0 0.0.0.255 host 209.165.200.225 (4 matches) 20 permit ip any any
Step 2: Apply the ACL. Enter line configuration mode for VTY lines 04. R2(config)#line vty 0 4
Use the access-class command to apply the ACL to the vty lines in the inbound direction. Note that this differs from the command used to apply ACLs to other interfaces. R2(config-line)#access-class TASK-5 in R2(config-line)#end R2#copy run start
Step 3: Test the ACL Telnet to R2 from R1. Note that R1 does not have IP addresses in the address range listed in the ACL TASK-5 permit statements. Connection attempts should fail. R1# telnet 10.1.1.2
Trying 10.1.1.2 % Connection refused by remote host From R3, telnet to R2. You will be presented with a prompt for the VTY line password. R3# telnet 10.1.1.2
Trying 10.1.1.2 Open CUnauthorized access strictly prohibited, violators will be prosecuted to the full extent of the law. User Access Verification Password: Why do connection attempts from other networks fail even though they are not specifically listed in the ACL? All ACLs include an implicit deny all as a final statement. Any traffic not explicitly permitted is dropped.
Use the show running-config command to confirm that the ACL has been removed from Serial 0/0/1. Step 2: Apply ACL STND-1 on S0/0/1 outbound. To test the importance of ACL filtering direction, reapply the STND-1 ACL to the Serial 0/0/1 interface. This time the ACL will be filtering outbound traffic, rather than inbound traffic. Remember to use the out keyword when applying the ACL. R3(config)#interface serial 0/0/1 R3(config-if)#ip access-group STND-1 out
Step 3: Test the ACL. Test the ACL by pinging from PC2 to PC3. As an alternative, use an extended ping from R1. Notice that this time pings succeed, and the ACL counters are not incremented. Confirm this by issuing the show ip access-list command on R3. Step 4: Restore the ACL to its original configuration. Remove the ACL from the outbound direction and reapply it to the inbound direction. R3(config)#interface serial 0/0/1 R3(config-if)#no ip access-group STND-1 out R3(config-if)#ip access-group STND-1 in
Step 5: Apply TASK-5 to the R2 serial 0/0/0 interface inbound. R2(config)#interface serial 0/0/0 R2(config-if)#ip access-group TASK-5 in
Step 6: Test the ACL. Attempt to communicate to any device connected to R2 or R3 from R1 or its attached networks. Notice that all communication is blocked; however, ACL counters are not incremented. This is because of the implicit deny all at the end of every ACL. This deny statement will prevent all inbound traffic to serial 0/0/0 from any source other than R3. Essentially, this will cause routes from R1 to be removed from the routing table. You should see messages similar to the following printed on the consoles of R1 and R2 (It will take some time for the OSPF neighbor relationship to go down, so be patient): *Sep 4 09:51:21.757: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.11.1 on Serial0/0/0 from FULL to DOWN, Neighbor Down: Dead timer expired Once you receive this message, issue the command show ip route on both R1 and R2 to see which routes have been removed from the routing table. Remove ACL TASK-5 from the interface, and save your configurations. R2(config)#interface serial 0/0/0 R2(config-if)#no ip access-group TASK-5 in R2(config)#exit R2#copy run start
Enable OSPF area 0 on all routers for all networks. Verify full IP connectivity using the ping command.