要求:
1、按照图示配置IP地址,R1, R3,R4上使用loopback 口模拟业务网段;
2、R1和R2运行RIPv2,R2,R3和R4运行OSPF,各自协议内部互通;
3、在RIP和OSPF间配置双向路由引入,要求除R4上的业务网段以外,其他业务网段路由都引入到对方协议内部;
4、使用路由过滤,使R4无法学习到R1的业务网段路由,要求使用prefix-list进行匹配;
5、OSPF 区域中不能出现RIP协议报文;
实验步骤:
1、配置接口IP
R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 100.1.1.1 24
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip add 192.168.0.1 32
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 192.168.1.1 32
R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 100.1.1.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 100.2.2.2 24
R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 100.2.2.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 100.3.3.3 24
[R3-GigabitEthernet0/0/1]int l0
[R3-LoopBack0]ip add 192.168.2.1 32
[R3-LoopBack0]int l1
[R3-LoopBack1]ip add 192.168.3.1 32
R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 100.3.3.4 24
[R4-GigabitEthernet0/0/0]int l0
[R4-LoopBack0]ip add 192.168.4.1 32
[R4-LoopBack0]int l1
[R4-LoopBack1]ip add 192.168.5.1 32
2、分别启动rip协议和ospf协议,实现内布互通;
R1
[R1]rip 1
[R1-rip-1]v 2
[R1-rip-1]undo summary
[R1-rip-1]network 100.0.0.0
[R1-rip-1]net 192.168.0.0
[R1-rip-1]net 192.168.1.0
R2
[R2]rip 1
[R2-rip-1]v 2
[R2-rip-1]undo summary
[R2-rip-1]net 100.0.0.0
[R2-rip-1]q
[R2]ospf 1 router-id 1.1.1.1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 100.2.2.0 0.0.0.255
R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 100.3.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]area 0
[R3-ospf-1-area-0.0.0.0]network 100.2.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.3.1 0.0.0.0
R4
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]network 100.3.3.0 0.0.0.255
[R4-ospf-1-area-0.0.0.1]network 192.168.4.1 0.0.0.0
[R4-ospf-1-area-0.0.0.1]network 192.168.5.1 0.0.0.0
3、路由引入
[R2]rip 1
[R2-rip-1]import-route ospf
[R2-rip-1]q
[R2]ospf 1
[R2-ospf-1]import-route rip
R1:
R4:
4、在R2创建acl,过滤R4,允许其他通过
[R2]acl 2000
[R2-acl-basic-2000]rule deny source 192.168.4.0 0.0.1.255
[R2-acl-basic-2000]rule permit source 0.0.0.0 255.255.255.255
[R2-acl-basic-2000]q
[R2]route-policy xg permit node 10
[R2-route-policy]if-match acl 2000
[R2-route-policy]q
[R2]rip 1
[R2-rip-1]import-route ospf 1 rou
[R2-rip-1]import-route ospf 1 route-policy xg
R1:
5、使用地址前缀列表,让R1的环回不被R4学习到
[R4]ip ip-prefix bb index 10 deny 192.168.0.0 23 less-equal 32 //两条网段合成了一条!
//由于地址前缀列表是默认拒绝的,所以我们要写一条允许其他通过的命令;
[R4]ip ip-prefix bb index 20 permit 0.0.0.0 0 less-equal 32
[R4]ospf 1
[R4-ospf-1]filter-policy ip-prefix bb import //调用上一步创建的地址前缀列表
6、配置静默接口
[R2-rip-1]silent-interface GigabitEthernet 0/0/1