OSPF分流互备实验

OSPF分流互备实验

实验拓扑及要求:

实验环境:EVE模拟器
实验拓扑:
OSPF分流互备实验
要求:

  • R1、R2、R3、R4为总部路由器,R5为分部路由器;
  • 红色区域(R1-R3-R5链路)为生产链路只走生产流量;蓝色区域(R2-R4-R5链路)为办公链路只走办公流量;
  • 生产IP地址为10.x.88.1;办公IP地址为10.x.99.;
  • 当R3和R4与R5之间链路出现问题时R3和R4可以通过交叉链路和R1-R3、R2-R4之间链路将流量转回正确的区域

实验方法:

  • 首先在R1-R2、R3-R4、R3-R5、R4-R5之间链路做子接口配置以便可以走两区域流量
  • 之后通过修改上述链路子接口和交叉链路的cost值来达到实验要求

实验配置

R1:


interface Loopback0
 ip address 10.1.88.1 255.255.255.0
!         
interface Loopback1
 ip address 10.1.99.1 255.255.255.0
!           
interface GigabitEthernet0/0
 no ip address
 media-type gbic
 speed 1000
 duplex full
 negotiation auto
!         
interface GigabitEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address 10.1.12.1 255.255.255.0
 ip ospf cost 25
!         
interface GigabitEthernet0/0.2
 encapsulation dot1Q 2
 ip address 10.1.21.1 255.255.255.0
 ip ospf cost 25
!         
interface GigabitEthernet1/0
 ip address 10.1.13.1 255.255.255.0
 negotiation auto
!         
interface GigabitEthernet2/0
 ip address 10.1.14.1 255.255.255.0
 ip ospf cost 25
 negotiation auto
!                 
router ospf 1
 router-id 1.1.1.1
 network 10.1.12.0 0.0.0.255 area 1
 network 10.1.13.0 0.0.0.255 area 1
 network 10.1.14.0 0.0.0.255 area 1
 network 10.1.21.0 0.0.0.255 area 2
 network 10.1.88.1 0.0.0.0 area 1
 network 10.1.99.1 0.0.0.0 area 2

R2:

interface Loopback0
 ip address 10.2.88.1 255.255.255.0
!         
interface Loopback1
 ip address 10.2.99.1 255.255.255.0
!                 
interface GigabitEthernet0/0
 no ip address
 media-type gbic
 speed 1000
 duplex full
 negotiation auto
!         
interface GigabitEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address 10.1.12.2 255.255.255.0
 ip ospf cost 25
!         
interface GigabitEthernet0/0.2
 encapsulation dot1Q 2
 ip address 10.1.21.2 255.255.255.0
 ip ospf cost 25
!         
interface GigabitEthernet1/0
 ip address 10.1.24.2 255.255.255.0
 negotiation auto
!         
interface GigabitEthernet2/0
 ip address 10.1.23.2 255.255.255.0
 ip ospf cost 25
 negotiation auto
!                                 
router ospf 1
 router-id 2.2.2.2
 network 10.1.12.0 0.0.0.255 area 1
 network 10.1.21.0 0.0.0.255 area 2
 network 10.1.23.0 0.0.0.255 area 2
 network 10.1.24.0 0.0.0.255 area 2
 network 10.2.88.1 0.0.0.0 area 1
 network 10.2.99.1 0.0.0.0 area 2

R3:

interface GigabitEthernet0/0
 ip address 10.1.13.3 255.255.255.0
 media-type gbic
 speed 1000
 duplex full
 negotiation auto
!         
interface GigabitEthernet1/0
 no ip address
 negotiation auto
!         
interface GigabitEthernet1/0.1
 encapsulation dot1Q 1 native
 ip address 10.1.34.3 255.255.255.0
!         
interface GigabitEthernet1/0.2
 encapsulation dot1Q 2
 ip address 10.1.43.3 255.255.255.0
!         
interface GigabitEthernet2/0
 ip address 10.1.23.3 255.255.255.0
 ip ospf cost 25
 negotiation auto
!         
interface Serial6/0
 no ip address
 encapsulation frame-relay
 no keepalive
 serial restart-delay 0
!         
interface Serial6/0.1 point-to-point
 ip address 10.1.35.3 255.255.255.0
 no keepalive
 frame-relay interface-dlci 100   
!         
interface Serial6/0.2 point-to-point
 ip address 10.1.53.3 255.255.255.0
 ip ospf cost 84
 no keepalive
 frame-relay interface-dlci 200   
!         
router ospf 1
 router-id 3.3.3.3
 network 10.1.13.0 0.0.0.255 area 1
 network 10.1.23.0 0.0.0.255 area 2
 network 10.1.34.0 0.0.0.255 area 0
 network 10.1.35.0 0.0.0.255 area 3
 network 10.1.43.0 0.0.0.255 area 0
 network 10.1.53.0 0.0.0.255 area 4

R4:

interface GigabitEthernet0/0
 ip address 10.1.24.4 255.255.255.0
 media-type gbic
 speed 1000
 duplex full
 negotiation auto
!         
interface GigabitEthernet1/0
 no ip address
 negotiation auto
!         
interface GigabitEthernet1/0.1
 encapsulation dot1Q 1 native
 ip address 10.1.34.4 255.255.255.0
!         
interface GigabitEthernet1/0.2
 encapsulation dot1Q 2
 ip address 10.1.43.4 255.255.255.0
!         
interface GigabitEthernet2/0
 ip address 10.1.14.4 255.255.255.0
 ip ospf cost 25
 negotiation auto
!         
interface Serial6/0
 no ip address
 encapsulation frame-relay
 no keepalive
 serial restart-delay 0
!         
interface Serial6/0.1 point-to-point
 ip address 10.1.45.4 255.255.255.0
 no keepalive
 frame-relay interface-dlci 100   
!         
interface Serial6/0.2 point-to-point
 ip address 10.1.54.4 255.255.255.0
 ip ospf cost 84
 no keepalive
 frame-relay interface-dlci 200   
!         
router ospf 1
 router-id 4.4.4.4
 network 10.1.14.0 0.0.0.255 area 1
 network 10.1.24.0 0.0.0.255 area 2
 network 10.1.34.0 0.0.0.255 area 0
 network 10.1.43.0 0.0.0.255 area 0
 network 10.1.45.0 0.0.0.255 area 3
 network 10.1.54.0 0.0.0.255 area 4

R5:

interface Loopback0
 ip address 10.5.88.1 255.255.255.0
!         
interface Loopback1
 ip address 10.5.99.1 255.255.255.0
 interface Serial6/1
 no ip address
 encapsulation frame-relay
 no keepalive
 serial restart-delay 0
!         
interface Serial6/1.1 point-to-point
 ip address 10.1.35.5 255.255.255.0
 no keepalive
 frame-relay interface-dlci 100   
!         
interface Serial6/1.2 point-to-point
 ip address 10.1.53.5 255.255.255.0
 ip ospf cost 84
 no keepalive
 frame-relay interface-dlci 200   
!         
interface Serial6/2
 no ip address
 encapsulation frame-relay
 no keepalive
 serial restart-delay 0
!         
interface Serial6/2.1 point-to-point
 ip address 10.1.45.5 255.255.255.0
 no keepalive
 frame-relay interface-dlci 100   
!         
interface Serial6/2.2 point-to-point
 ip address 10.1.54.5 255.255.255.0
 ip ospf cost 84
 no keepalive
 frame-relay interface-dlci 200 
 router ospf 1
 router-id 5.5.5.5
 network 10.1.35.0 0.0.0.255 area 3
 network 10.1.45.0 0.0.0.255 area 3
 network 10.1.53.0 0.0.0.255 area 4
 network 10.1.54.0 0.0.0.255 area 4
 network 10.5.88.1 0.0.0.0 area 3
 network 10.5.99.1 0.0.0.0 area 4

测试

正常情况下R5走生产和办公
OSPF分流互备实验
当R3-R5之间的链路断开
OSPF分流互备实验
当R3-R5之间链路和交叉链路都断开

OSPF分流互备实验