您的位置:首页 > 其它

基于RIP(OSPF)协议的ACL应用

2018-03-27 08:45 260 查看
实验拓扑图:



 
 
 
注意事项
1。实验时,应该先看到所有路由条目都能学习到,之后再运行ACL做过滤
2。实验最终结果在R2上不能看到192.168.3.0的路由信息。
3。从全局模式退回到特权模式,不显示提示信息
   R4(config)#no logging console
配置过程
R1
router#conf t
router (config)#host R1
R1(config)#no ip domain-lo
R1(config)#line con 0
R1(config-line)#loggin sync
R1(config-line)#exit
R1(config)#int f0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo 1
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#ver 2
R1(config-router)#no auto
R1(config-router)#network 192.168.1.0
R1(config-router)#network 1.1.1.1
R1(config-router)#exit
R1(config)#
 
R2
router#conf t
router (config)#host R2
R2(config)#no ip domain-lo
R2(config)#line con 0
R2(config-line)#loggin sync
R2(config-line)#exit
R2(config)#int f0/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int f1/0
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#ver 2
R2(config-router)#no auto
R2(config-router)#network 192.168.1.0
R2(config-router)#network 192.168.2.0
R2(config-router)#exit
R2(config)#
 
R3
router#conf t
router (config)#host R3
R3(config)#no ip domain-lo
R3(config)#line con 0
R3(config-line)#loggin sync
R3(config-line)#exit
R3(config)#int f0/0
R3(config-if)#ip add 192.168.3.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int f1/0
R3(config-if)#ip add 192.168.2.2 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#access-list 1 deny 192.168.3.0 0.0.0.255
R3(config)#access-list 1 permit any
R3(config)#router rip
R3(config-router)#ver 2
R3(config-router)#no auto
R3(config-router)#network 192.168.3.0
R3(config-router)#network 192.168.2.0
R3(config-router)#distribute-list 1 out
R3(config-router)#exit
R3(config)#
 
R4
router#conf t
router(config)#host R4
R4(config)#no ip domain-lo
R4(config)#line con 0
R4(config-line)#loggin sync
R4(config-line)#exit
R4(config)#int f0/0
R4(config-if)#ip add 192.168.3.2 255.255.255.0
R4(config-if)#no sh
R4(config-if)#int lo 1
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#exit
R4(config)#router rip
R4(config-router)#ver 2
R4(config-router)#no auto
R4(config-router)#network 192.168.3.0
R4(config-router)#network 4.4.4.4
R4(config-router)#exit
R4(config)#
 
实验测试
R2# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 192.168.1.1, 00:00:07, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/2] via 192.168.2.2, 00:00:11, FastEthernet1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet1/0
备注:路由表中没有192.168.3.0的网段,但是在R1上测试
ping 4.4.4.4 source 1.1.1.1是能够ping通的!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: