基于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通的!
注意事项
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通的!
相关文章推荐
- rip ospf bgp 协议简介
- RIP、OSPF、BGP三种协议
- 【视频】CCNA——路由协议(静态路由协议、RIP、EIGRP、OSPF)的基本配置
- 5012.协议分析软件捕捉RIP、OSPF和EIGRP的数据包
- RIP、OSPF、BGP三种协议
- TCP/IP协议族-----11、单播路由选择协议(RIP、OSPF和BGP)
- IP 路由 内部网关协议 常见的三种协议RIP、OSPF、EIGRP学习认识
- 深入理解动态选路协议——RIP、OSPF和BGP协议
- ospf、rip、bgp是基于什么协议
- IP 路由 内部网关协议 常见的三种协议RIP、OSPF、EIGRP学习认识
- 路由协议:RIP OSPF BGP
- RIP、OSPF、BGP三种协议的区别
- rip,ospf,eigrp内部网关协议的区别与用法
- TCP/IP协议族——单播路由选择协议RIP、OSPF、BGP
- OSPF多区域划分小小实验【与rip协议的结合】
- 基于HTTP 协议认证介绍与实现
- CCNA 第六章 OSPF 协议
- [C# 网络编程系列]专题十一:实现一个基于FTP协议的程序——文件上传下载器
- Centos6.5 搭建基于 SSH协议 Git Server 服务器
- 简单介绍基于WEB开发的HTTP协议