1.实验拓扑
2.实验要求
R1的环回1代表生产区的主服务器,环回2代表办公区的备份服务器
R2的环回1代表生产区的备份服务器,环回2代表办公区的主服务器
R5的环回1代表生产区的电脑,环回2代表办公区的电脑
R3为生产区的路由器,R4为办公区的路由器
要求:
1、办公区的电脑直接到办公服务器,不通过生产区服务器;生产区的电脑相同
2、办公挂了,不切生产,直接走R6
3、生产挂了,走办公,如果办公也挂了,再走R6
3.设计思想—利用修改cost值来干涉选路
4.测试
1.初始状态
办公断掉,直接走R6
r4(config)#inter s3/1
r4(config-subif)#shutdown
生产断掉,走办公
r3(config)#inter s3/1
r3(config-subif)#shutdown
生产断掉,办公也断掉,走R6
r4(config)#inter s3/1
r4(config-subif)#shutdown
断掉R1与R3之间
5.注意
1.串线要使用子接口时:先进接口改封装,然后no keepalive ,接口打开接口;
然后进子接口配置。实例如下:
interface Serial3/1
encapsulation frame-relay
no keepalive
interface Serial3/1.1 point-to-point
ip address 10.35.1.1 255.255.255.0
no keepalive
frame-relay interface-dlci 100
no shutdown
2.区域5要和R5的两个环回做重发布,因为生产和办公断掉,R6就学习不到他们的环回
6.配置
R1
interface Loopback0
ip address 10.88.1.1 255.255.255.0
interface Loopback1
ip address 10.99.1.1 255.255.255.0
interface Ethernet0/0
ip address 10.13.1.1 255.255.255.0
interface Ethernet0/0.1
ip ospf cost 25
interface Ethernet0/0.2
ip ospf cost 25
interface Ethernet0/1
no ip address
ip ospf cost 25
interface Ethernet0/1.1
encapsulation dot1Q 1 native
ip address 10.12.1.1 255.255.255.0
ip ospf cost 25
interface Ethernet0/1.2
encapsulation dot1Q 2
ip address 10.12.2.1 255.255.255.0
ip ospf cost 25
interface Ethernet0/2.1
encapsulation dot1Q 1 native
ip address 10.14.1.1 255.255.255.0
ip ospf cost 25
interface Ethernet0/2.2
encapsulation dot1Q 2
ip address 10.14.2.1 255.255.255.0
ip ospf cost 25
router ospf 1
router-id 10.1.1.1
network 10.12.1.0 0.0.0.255 area 1
network 10.12.2.0 0.0.0.255 area 2
network 10.13.1.0 0.0.0.255 area 1
network 10.13.2.0 0.0.0.255 area 2
network 10.14.1.0 0.0.0.255 area 1
network 10.14.2.0 0.0.0.255 area 2
network 10.88.1.0 0.0.0.255 area 1
network 10.99.1.0 0.0.0.255 area 2
R2
interface Loopback0
ip address 10.88.2.2 255.255.255.0
interface Loopback1
ip address 10.99.2.2 255.255.255.0
interface Ethernet0/0
ip address 10.12.1.2 255.255.255.0
ip ospf cost 25
interface Ethernet0/0.1
ip ospf cost 25
interface Ethernet0/0.2
ip ospf cost 25
interface Ethernet0/1
no ip address
interface Ethernet0/1.1
encapsulation dot1Q 1 native
ip address 10.23.1.1 255.255.255.0
ip ospf cost 25
interface Ethernet0/1.2
encapsulation dot1Q 2
ip address 10.23.2.1 255.255.255.0
ip ospf cost 25
interface Ethernet0/2
ip address 10.24.1.1 255.255.255.0
router ospf 1
router-id 10.2.2.2
network 10.12.1.0 0.0.0.255 area 1
network 10.12.2.0 0.0.0.255 area 2
network 10.23.1.0 0.0.0.255 area 1
network 10.23.2.0 0.0.0.255 area 2
network 10.24.1.0 0.0.0.255 area 2
network 10.88.2.0 0.0.0.255 area 1
network 10.99.2.0 0.0.0.255 area 2
R3
interface Ethernet0/0.1
encapsulation dot1Q 1 native
ip address 10.23.1.2 255.255.255.0
ip ospf cost 25
interface Ethernet0/0.2
encapsulation dot1Q 2
ip address 10.23.2.2 255.255.255.0
ip ospf cost 25
interface Ethernet0/1.1
encapsulation dot1Q 1 native
ip address 10.34.1.1 255.255.255.0
ip ospf cost 25
interface Ethernet0/1.2
encapsulation dot1Q 2
ip address 10.34.2.1 255.255.255.0
ip ospf cost 25
interface Ethernet0/2
ip address 10.13.1.2 255.255.255.0
interface Ethernet1/1
ip address 10.36.1.1 255.255.255.0
ip ospf cost 30
interface Serial3/1
no ip address
encapsulation frame-relay
no keepalive
serial restart-delay 0
interface Serial3/1.1 point-to-point
ip address 10.35.1.1 255.255.255.0
no keepalive
frame-relay interface-dlci 100
interface Serial3/1.2 point-to-point
ip address 10.35.2.1 255.255.255.0
ip ospf cost 120
no keepalive
frame-relay interface-dlci 200
router ospf 1
router-id 10.3.3.3
network 10.13.1.0 0.0.0.255 area 1
network 10.23.1.0 0.0.0.255 area 1
network 10.23.2.0 0.0.0.255 area 2
network 10.34.1.0 0.0.0.255 area 0
network 10.34.2.0 0.0.0.255 area 0
network 10.35.1.0 0.0.0.255 area 3
network 10.35.2.0 0.0.0.255 area 4
network 10.36.1.0 0.0.0.255 area 5
R4
interface Ethernet0/0.1
encapsulation dot1Q 1 native
ip address 10.34.1.2 255.255.255.0
ip ospf cost 25
interface Ethernet0/0.2
encapsulation dot1Q 2
ip address 10.34.2.2 255.255.255.0
ip ospf cost 25
interface Ethernet0/1
ip address 10.46.1.1 255.255.255.0
interface Ethernet0/2
no ip address
interface Ethernet0/2.1
encapsulation dot1Q 1 native
ip address 10.14.1.2 255.255.255.0
ip ospf cost 25
interface Ethernet0/2.2
encapsulation dot1Q 2
ip address 10.14.2.2 255.255.255.0
ip ospf cost 25
interface Ethernet1/1
ip address 10.24.1.2 255.255.255.0
interface Serial3/1.1 point-to-point
ip address 10.45.1.1 255.255.255.0
ip ospf cost 80
no keepalive
frame-relay interface-dlci 100
interface Serial3/1.2 point-to-point
ip address 10.45.2.1 255.255.255.0
ip ospf cost 64
no keepalive
frame-relay interface-dlci 200
router ospf 1
router-id 4.4.4.4
network 10.14.1.0 0.0.0.255 area 1
network 10.14.2.0 0.0.0.255 area 2
network 10.24.1.0 0.0.0.255 area 2
network 10.34.1.0 0.0.0.255 area 0
network 10.34.2.0 0.0.0.255 area 0
network 10.45.1.0 0.0.0.255 area 3
network 10.45.2.0 0.0.0.255 area 4
network 10.46.1.0 0.0.0.255 area 5
R5
interface Loopback0
ip address 10.88.5.5 255.255.255.0
interface Loopback1
ip address 10.99.5.5 255.255.255.0
interface Ethernet0/0
ip address 10.56.1.1 255.255.255.0
ip ospf cost 60
interface Serial3/0.1 point-to-point
ip address 10.35.1.2 255.255.255.0
no keepalive
frame-relay interface-dlci 100
interface Serial3/0.2 point-to-point
ip address 10.35.2.2 255.255.255.0
ip ospf cost 120
no keepalive
frame-relay interface-dlci 200
interface Serial3/1
no ip address
encapsulation frame-relay
no keepalive
serial restart-delay 0
interface Serial3/1.1 point-to-point
ip address 10.45.1.2 255.255.255.0
ip ospf cost 80
no keepalive
frame-relay interface-dlci 100
interface Serial3/1.2 point-to-point
ip address 10.45.2.2 255.255.255.0
ip ospf cost 64
no keepalive
frame-relay interface-dlci 200
router ospf 1
router-id 10.5.5.5
network 10.35.1.0 0.0.0.255 area 3
network 10.35.2.0 0.0.0.255 area 4
network 10.45.1.0 0.0.0.255 area 3
network 10.45.2.0 0.0.0.255 area 4
network 10.88.5.5 0.0.0.0 area 3
network 10.88.5.0 0.0.0.255 area 3
network 10.99.5.5 0.0.0.0 area 4
network 10.99.5.0 0.0.0.255 area 4
redistribute ospf 2 subnets
router ospf 2
redistribute ospf 1 subnets
network 10.56.1.0 0.0.0.255 area 5
R6
interface Ethernet0/0
ip address 10.46.1.2 255.255.255.0
interface Ethernet0/1
ip address 10.56.1.2 255.255.255.0
ip ospf cost 60
interface Ethernet0/2
ip address 10.36.1.2 255.255.255.0
ip ospf cost 30
router ospf 2
network 10.36.1.0 0.0.0.255 area 5
network 10.46.1.0 0.0.0.255 area 5
network 10.56.1.0 0.0.0.255 area 5