双点重发布实验
1.配置ip
如拓扑图上所示
2.配置OSPF和RIP,并重发布
r1
[r1]ospf 1
[r1-ospf-1]import-route direct-----将直连路由导入到ospf中
[r1-ospf-1]q
[r1]ip ip-prefix aa permit 1.1.1.0 24
[r1]route-policy aa permit node 10
Info: New Sequence of this List.
[r1-route-policy]if-match ip-prefix aa
[r1]ospf router-id 1.1.1.1
Info: The configuration succeeded. You need to restart the OSPF process to valid
ate the new router ID.
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.12.1 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.13.1 0.0.0.255
[r1-ospf-1-area-0.0.0.0]q
r2
[r2]ospf router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.12.2 0.0.0.255
[r2]rip 1
[r2-rip-1]v 2
[r2-rip-1]network 192.168.24.0
[r2-rip-1]import-route ospf 1
[r2-rip-1]q
[r2]ospf 1
[r2-ospf-1]import-route rip 1
[r2-ospf-1]q
r3
[r3]ospf router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.13.3 0.0.0.255
[r3]rip 1
[r3-rip-1]v 2
[r3-rip-1]network 192.168.34.0
[r3-rip-1]import-route ospf 1
[r3-rip-1]q
[r3]ospf 1
[r3-ospf-1]import-route rip 1
[r3-ospf-1]q
r4
[r4]rip 1
[r4-rip-1]v 2
[r4-rip-1]network 192.168.24.0
[r4-rip-1]network 192.168.34.0
3.创建列表,使ospf列表优先
r3:
[r3]ip ip-prefix aa permit 1.1.1.1 24
[r3]route-policy aa permit node 20
[r3-route-policy]if-match ip-prefix aa
[r3-route-policy]apply preference 90
[r3-route-policy]q
[r3]ospf 1
[r3-ospf-1]preference ase route-policy aa
r2:
[r2]ip ip-prefix aa permit 1.1.1.0 24
[r2]route-policy aa permit node 10
[r2-route-policy]if-match ip-prefix aa
[r2-route-policy]apply preference 92
[r2-route-policy]q
[r2]ospf 1
[r2-ospf-1]preference ase route-policy aa
4.偏移列表
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.12.0 0
[r4-acl-basic-2000]q
[r4]acl 2001
[r4-acl-basic-2001]rule permit source 192.168.13.0 0
[r4-acl-basic-2001]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]rip metricin 2001 5
[r4-GigabitEthernet0/0/0]q
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]rip metricin 2000 5
[r4-GigabitEthernet0/0/1]q
5.过滤策略
r2:
[r2]ip ip-prefix bb permit 0.0.0.0 0 less-equal 32
[r2]ospf 1
[r2-ospf-1]filter-policy ip-prefix bb export
r3:
[r3]ip ip-prefix bb permit 0.0.0.0 0 less-equal 32
[r3]ospf 1
[r3-ospf-1]filter-policy ip-prefix bb export