Objective: configure extended access lists to filter out network-to-network traffic, host-to-host traffic, and network-to-host traffic.
Lab Equipment: Router 1 and Router 2 from the eRouters menu and PC 1, PC 2, PC 3, PC 4, and PC 5 from the eStations menu
Background Reading: Lab Primer Lesson 10: Access Lists
Lab Equipment: Router 1 and Router 2 from the eRouters menu and PC 1, PC 2, PC 3, PC 4, and PC 5 from the eStations menu
Background Reading: Lab Primer Lesson 10: Access Lists
![](https://i-blog.csdnimg.cn/blog_migrate/93383a4092f5f2853163f4e3cfe2563e.png)
1. Establish the configurations outlined in the tables below.
Router1:
![](https://i-blog.csdnimg.cn/blog_migrate/8a2d496f32b4cf78499976774495c5f9.png)
Router2:
![](https://i-blog.csdnimg.cn/blog_migrate/62d3544c887d6af0c8793b97e055e26e.png)
PC1:
![](https://i-blog.csdnimg.cn/blog_migrate/947a488bc7a18eccba5a1722beca524f.png)
PC2:
![](https://i-blog.csdnimg.cn/blog_migrate/4a68a6c9d93de0ea31c8c09c928f3dae.png)
PC3:
![](https://i-blog.csdnimg.cn/blog_migrate/2b4b4ee1d2c326fe22ea7213a586e100.png)
PC4:
![](https://i-blog.csdnimg.cn/blog_migrate/b330379e1cb864b536d3589c7d1b54e9.png)
PC5:
![](https://i-blog.csdnimg.cn/blog_migrate/6a4d783bbd9676b2825bd6e811cb1bb8.png)
2. configure RIP on the two routers. Be sure to use the proper network statements.
Router1#conf t
Router1(config)#router rip
Router1(config-router)#network 192.168.2.0
Router1(config-router)#network 192.168.3.0
![](https://i-blog.csdnimg.cn/blog_migrate/410258a2c706f354283e8dcf2c285715.png)
Router2#conf t
Router2(config)#router rip
Router2(config-router)#network 192.168.1.0
Router2(config-router)#network 192.168.2.0
![](https://i-blog.csdnimg.cn/blog_migrate/e56ca70c79348776ea0ad64309d9f1a6.png)
3. Use the show ip route command on each router to make sure that the routes have been received.
Router1#show ip route
![](https://i-blog.csdnimg.cn/blog_migrate/9bd05a209fece3786a37b9488666b024.png)
Router2#show ip route
![](https://i-blog.csdnimg.cn/blog_migrate/855ae69f79eb0394e6a0aae9aa4eb70f.png)
4. Verify that you can ping PC 1 from PC 2.
C:>ping 192.168.3.2
![](https://i-blog.csdnimg.cn/blog_migrate/ee6945c28ae3efe2516f2d442f20b06e.png)
Network-to-Network Access List
5. Examine the network diagram below. The first access list you create should allow only traffic from the Administration network (PC 4 and PC 5) destined for PC 1 on the Corporate HQ network. To accomplish this, use an extended access list. Because you are allowing all traffic, you should use IP as the protocol. The access list should look something like the following:
Router1(config)#access-list 100 permit ip 192.168.1.0 0.0.0.127
192.168.3.0 0.0.0.255 log
Router1(config)#access-list 100 permit ip 192.168.2.0 0.0.0.0 any
![](https://i-blog.csdnimg.cn/blog_migrate/d8b6344d64f05cb924f6ca3e3d1303af.png)
This access list is very simple because you are only allowing two types of traffic and denying all other traffic. Because there is an implicit deny statement at the end of all access lists, you only need a permit statement for the pings and a permit statement for the RIP broadcasts.
![](https://i-blog.csdnimg.cn/blog_migrate/6ffa29a20a3d68d7eb3d0647f4c866c7.png)
6. Now you need to apply the access list to the interface. Because the traffic is coming from Router2 and going to Router1, you should place the access list on Router1’s serial 0 interface. The access list will check all inbound traffic.
Router1#conf t
Router1(config)#interface serial 0
Router1(config-if)#ip access-group 100 in
![](https://i-blog.csdnimg.cn/blog_migrate/db945755f1178c4469a2306555ab0703.png)
7. To test the access list, try to ping PC 1 from PC 2, PC 3, PC 4, and PC 5. PC 2 and PC 3 should not be able to ping PC 1, but PC 4 and PC 5 should be able to. If this access list works, continue on to the next step.
C:>ping 192.168.3.2
PC2&PC3:
![](https://i-blog.csdnimg.cn/blog_migrate/fefb2d6c11ad286c1057746f8cef3fe1.png)
PC4:
![](https://i-blog.csdnimg.cn/blog_migrate/0e64b7234ff01da6be8156175c15b300.png)
PC5:
![](https://i-blog.csdnimg.cn/blog_migrate/e9ce6c75e8a36ca9889425f9864d5eeb.png)
Host-to-Host Access List
8. In this portion of the lab, you will block an individual PC from accessing the central file server. PC 2 is being used by a new employee whom you do not want to have access to the file server (PC 5) for 30 days. To accomplish this, you decide to implement an access list on Router2 that will block access to PC 5 only from PC 2. In this instance, you are setting the access list manually. The list must be manually removed after 30 days.For lab scenario purposes, you should use the log keyword. This will show logging output on the screen of Router2 when the access list is invoked. For this part of the lab, the log will show up on the screen only when you deny access from PC 2.
Router2(config)#access-list 101 deny ip host 192.168.1.130 192.168.1.3
0.0.0.0 log
Router2(config)#access-list 101 permit ip any any
![](https://i-blog.csdnimg.cn/blog_migrate/989d93c47bdcbb46cfa7b006e210baea.png)
9. Apply the access list to Router2’s Fast Ethernet 0/0 interface.
Router2#conf t
Router2(config)#interface FastEthernet 0/0
Router2(config-if)#ip access-group 101 in
![](https://i-blog.csdnimg.cn/blog_migrate/54e9798fc7e5eb628db58a6527c5e0f7.png)
10. Connect to PC 2, and verify that you cannot ping PC 5. Connect to PC 3, and verify that you can ping PC 5.
C:>ping 192.168.1.3
![](https://i-blog.csdnimg.cn/blog_migrate/a02ca66c16b9b3e4effc9bbec00c3f70.png)
11. Finally, connect to Router2, and verify that the log statements displayed on the console match the corresponding pings sent from the PCs.
Network-to-Host Access List
12. Before you create this access list, remove the preceding access lists from Router1 and Router2.
Router1(config)#interface serial 0
Router1(config-if)#no ip access-group 100 in
Router1(config)#interface serial 0
Router1(config-if)#no ip access-group 100 in
![](https://i-blog.csdnimg.cn/blog_migrate/e60b9905abb0b3f55d6acd0ac3002bd8.png)
Router2(config)#interface FastEthernet 0/0
Router2(config-if)#no ip access-group 101 in
![](https://i-blog.csdnimg.cn/blog_migrate/bf98d91a650e753dbd4c16b082b262e5.png)
13. Create an extended access list that blocks all traffic to PC 1 from the Network Users area in the topology. The access list should look something like the following:
Router2(config)#access-list 102 deny ip 192.168.1.128 0.0.0.127 host
192.168.3.2 log
Router2(config)#access-list 102 permit ip any any
14. Apply this access list to outbound traffic on the serial 0 interface of Router2.
Router2(config)#interface serial 0
Router2(config-if)#ip access-group 102 out
![](https://i-blog.csdnimg.cn/blog_migrate/b1cddb839d9ab1da72111e3a3dbf29ef.png)
15. To test this access list, try to ping PC 1 from PC 2 or PC 3. The pings should fail. You can also view the log file on Router2.
C:>ping 192.168.3.2
PC2&PC3:
![](https://i-blog.csdnimg.cn/blog_migrate/ec2c4fbe21db013d5071c075c384e040.png)
*******************************************************
Next:
本文转自redking51CTO博客,原文链接:http://blog.51cto.com/redking/74794
,如需转载请自行联系原作者