前面我们降到过交换机之间的链路备份,本章我们来讲路由器之间的链路备份

静态浮动路由应用场合

骨干链路是动态路由    备份链路为低速的拨号链路静态路由

140247512.png

[R1]dis cu

Now create configuration...

Current configuration

!

version 1.74

sysname R1

firewall enable

aaa-enable

aaa accounting-scheme optional

!

interface Aux0

async mode flow

link-protocol ppp

!

interface Ethernet0

ip address 192.168.1.1 255.255.255.0

ospf enable area 0.0.0.0

!

interface Ethernet1

!

interface Serial0

link-protocol ppp

ip address 192.168.3.1 255.255.255.0

ospf enable area 0.0.0.0            //S0接口 启用OSPF

!

interface Serial1

link-protocol ppp

ip address 192.168.4.1 255.255.255.0

!

voice-setup

!

subscriber-line 0

!

subscriber-line 1

!

quit

!

quit

ospf enable

!

Quit

ip route-static 192.168.2.0 255.255.255.0 192.168.4.2 preference 60    //备份链路为静态

!

Return

[R2]dis cu

Now create configuration...

Current configuration

!

version 1.74

sysname R2

firewall enable

aaa-enable

aaa accounting-scheme optional

!

interface Aux0

async mode flow

link-protocol ppp

!

interface Ethernet0

ip address 192.168.2.1 255.255.255.0

ospf enable area 0.0.0.0

!

interface Ethernet1

!

interface Serial0

link-protocol ppp

ip address 192.168.3.2 255.255.255.0

ospf enable area 0.0.0.0

!

interface Serial1

link-protocol ppp

ip address 192.168.4.2 255.255.255.0

!

voice-setup

!

subscriber-line 0

!

subscriber-line 1

!

quit

!

quit

ospf enable

!

Quit

ip route-static 192.168.1.0 255.255.255.0 192.168.4.1 preference 60

!

Return

此时我们在PC1上ping 192.168.2.1  是可以正常通信的

wps_clip_p_w_picpath-3401

现在我们看下R1的路由表    走的是OSFP 骨干链路

wps_clip_p_w_picpath-29849

现在我们模拟R1的S0接口失效,看看会不会走静态路由

wps_clip_p_w_picpath-19247

下面我们在PC1上ping  192.168.2.1  

wps_clip_p_w_picpath-20169

此时我们再看下R1的路由表

我们可以看到  此时的到达192.168.2.0网段的 走的是静态路由 从S1接口转发

wps_clip_p_w_picpath-26390



还有这样一种情况 路由器之间的链路都是比较好的骨干链路 动态路由,这样我们怎么实现备份呢

我们实现路由器路由协议是OSFP,主链路是S0接口的链路,备份链路是S1接口的链路

当主链路断掉的时候走自动切换到备份链路,当链路恢复后继续使用主链路

[R1]dis cu

Now create configuration...

Current configuration

!

version 1.74

sysname R1

firewall enable

aaa-enable

aaa accounting-scheme optional

!

interface Aux0

async mode flow

link-protocol ppp

!

interface Ethernet0

ip address 192.168.1.1 255.255.255.0

ospf enable area 0.0.0.0

!

interface Ethernet1

!

interface Serial0

link-protocol ppp

standby interface Serial 1       //在主接口设置备份的接口S1

ip address 192.168.3.1 255.255.255.0

ospf enable area 0.0.0.0

!

interface Serial1

link-protocol ppp

ip address 192.168.4.1 255.255.255.0

ospf enable area 0.0.0.0

!

voice-setup

!

subscriber-line 0

!

subscriber-line 1

!

quit

!

quit

ospf enable

!

Quit

!

Return


[R2]dis cu

Now create configuration...

Current configuration

!

version 1.74

sysname R2

firewall enable

aaa-enable

aaa accounting-scheme optional

!

interface Aux0

async mode flow

link-protocol ppp

!

interface Ethernet0

ip address 192.168.2.1 255.255.255.0

ospf enable area 0.0.0.0

!

interface Ethernet1

!

interface Serial0

link-protocol ppp

standby interface Serial 1       //在主接口设置备份的接口S1

ip address 192.168.3.2 255.255.255.0

ospf enable area 0.0.0.0

!

interface Serial1

link-protocol ppp

ip address 192.168.4.2 255.255.255.0

!

voice-setup

!

subscriber-line 0

!

subscriber-line 1

!

quit

!

quit

ospf enable

!

Quit

!

Return

正常走S0接口

wps_clip_p_w_picpath-18769

现在我们模拟S0接口断开,观察下R1理由表

wps_clip_p_w_picpath-9197

此时走的是的备份链路