拓扑和IP规划
ip配置
AR1
sys
int g0/0/0
ip a 12.0.0.1 24
int g0/0/1
ip a 14.0.0.1 24
int l0
ip a 1.1.1.1 24
AR2
sys
int g0/0/0
ip a 12.0.0.2 24
int g0/0/1
ip a 23.0.0.2 24
int l0
ip a 2.2.2.2 24
AR3
sys
int g0/0/1
ip a 34.0.0.1 24
int g 0/0/0
ip a 23.0.0.1 24
int l0
ip a 3.3.3.3 24
AR4
sys
int g0/0/1
ip a 14.0.0.2 24
int g 0/0/0
ip a 34.0.0.2 24
int l0
ip a 4.4.4.4 24
ARP
AR1
rip 1
version 2
network 12.0.0.0
network 14.0.0.0
network 1.0.0.0
AR2
rip 1
version 2
network 12.0.0.0
network 2.0.0.0
AR4
rip 1
version 2
network 14.0.0.0
OSPF
AR2
ospf 2 router-id 2.2.2.2
area 0
network 23.0.0.1 0.0.0.255
AR3
ospf 2 router-id 3.3.3.3
area 0
network 23.0.0.0 0.0.0.255
network 34.0.0.0 0.0.0.255
network 3.3.3.0 0.0.0.255
AR4
ospf 2 router-id 4.4.4.4
area 0
network 34.0.0.0 0.0.0.255
network 4.4.4.0 0.0.0.255
双向重发布
AR2、AR4
ospf 2
import-route rip 1
rip 1
import-route ospf 2
处理重发带来的选路问题
4.4.4.4的路由回馈和选路问题
#修改接口类型,统一为24(OSPF计算为32)。
ospf network-type broadcast
RIP
ip ip-prefix 1 permit 4.4.4.0 24
route-policy a permit node 10
if-match ip-prefix 1
apply cost 2
route-policy a permit node 20
重发布调用:
rip 1
import-route ospf 2 route-policy a
AR4上:
ip ip-prefix 1 permit 2.2.2.0 24
route-policy a permit node 10
if-match ip-prefix 1
apply cost 2
route-policy a permit node 20
重发布调用:
rip 1
import-route ospf 2 route-policy a
OSPF
AR4:
ip ip-prefix 2 permit 14.0.0.0 24
route-policy a permit node 10
if-match ip-prefix 2
apply cost 2
apply cost-type type-1
route-policy a permit node 20
ospf 2
import-route rip 1 route-policy a
AR2:
ip ip-prefix 2 permit 2.2.2.0 24
ip ip-prefix 2 permit 12.0.0.0 24
route-policy a permit node 10
if-match ip-prefix 2
apply cost 2
apply cost-type type-1
route-policy a permit node 20
ospf 2
import-route rip 1 route-policy a