Objective: Create a named access list that will deny all ping traffic from PC 1 to Router 1, but will enable all access from Router 4 to Router 1. For this lab, the access list must be added on Router 1.
Lab Equipment: Router 1 and Router 4 from the eRouters menu and PC 1 from the eStations menu
Background Reading: Lab Primer Lesson 10: Access Lists
Lab Equipment: Router 1 and Router 4 from the eRouters menu and PC 1 from the eStations menu
Background Reading: Lab Primer Lesson 10: Access Lists
![](https://i-blog.csdnimg.cn/blog_migrate/8ff09b4725af7822701e15e0b7a3d037.png)
1. Establish the configurations outlined in the table below. Use the winipcfg command on PC 1 to configure the IP address and default gateway.
Router1:
![](https://i-blog.csdnimg.cn/blog_migrate/162302a206425aa82487fdd6319720f8.png)
Router4:
![](https://i-blog.csdnimg.cn/blog_migrate/ea36c6c31738bacd784fbc53e96c8a1f.png)
PC1:
![](https://i-blog.csdnimg.cn/blog_migrate/26bd55a3a98a6f6ae63a5892e9549926.png)
2. configure RIP on the two routers. Be sure to use the proper network statements.
Router1(config)#router rip
Router1(config-router)#network 192.168.1.0
![](https://i-blog.csdnimg.cn/blog_migrate/796934696abe424d4349df92bd6e47c2.png)
Router4(config)#router rip
Router4(config-router)#network 192.168.1.0
![](https://i-blog.csdnimg.cn/blog_migrate/7f01c291dd6eead35dc4b4226cc24d93.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/d4bc352a56258ef550a668fa0d46ad9e.png)
Router4#show ip route
![](https://i-blog.csdnimg.cn/blog_migrate/0431aa31392eaaa82d2f6b9413aead0a.png)
4. Verify that you can ping Router1 from PC 1.
C:>ping 192.168.1.1
![](https://i-blog.csdnimg.cn/blog_migrate/624f557abb969cec5c12c719ad7ed70a.png)
5. Create an access list that prevents ping traffic originating from PC 1 and destined for Router1 from reaching Router1. Typically, this access list could be placed on either Router4 or Router1. It often makes more sense to place the access list on the router closest to the source as possible; this helps keep unnecessary traffic off the backbone.
For this example, however, the access list will be placed on Router1 for inbound traffic.
Router1(config)#ip access-list extended deny_ping
Router1(config-ext-acl)#deny icmp host 192.168.1.18 192.168.1.1
0.0.0.0 log
Router1(config-ext-acl)#permit ip any any log
![](https://i-blog.csdnimg.cn/blog_migrate/8cceeb45a4313505ce706eb8e976de85.png)
The first statement above defines the access list as extended. The second statment denies any ICMP traffic with a source IP address of 192.168.1.18 that is destined for 192.168.1.1; the wildcard mask of 0.0.0.0 in this line means that the IP address must be matched exactly. Notice how the host command is used for the first part of the access list and the wildcard mask of 0.0.0.0 is used for the second part of the access list. The host command and the wildcard mask of 0.0.0.0 both do the same thing. The log keyword allows you to double-check your work.
6. Next, apply the access list to inbound traffic on the serial 0 interface of Router1.
Router1(config-ext-acl)#exit
Router1(config)#interface serial 0
Router1(config-if)#ip access-group deny_ping in
![](https://i-blog.csdnimg.cn/blog_migrate/7b88f340c9dd3638b8d6f71e97f1c821.png)
7. Connect to PC 1 and send a test ping to Router1. Then connect to Router4 and send a test ping to Router1. Are the pings successful?
C:>ping 192.168.1.1
![](https://i-blog.csdnimg.cn/blog_migrate/39a1735cc369385d0daaa7213853d9b4.png)
Router4#ping 192.168.1.1
![](https://i-blog.csdnimg.cn/blog_migrate/fdc6fe8bc7afe8eb0c42ffe8de9d62f8.png)
8. Connect to Router1 again; you should see two separate log messages. The first one is denying the ping from PC 1, and the second is allowing the ping from Router4.
![](https://i-blog.csdnimg.cn/blog_migrate/7f211824268ab0a8bd0309481287f9ac.png)
*********************************************************
本文转自redking51CTO博客,原文链接:http://blog.51cto.com/redking/74792
,如需转载请自行联系原作者