1. 浮动静态路由
浮动静态路由是一种特殊的静态路由,通过配置一个比主路由的管理距离更大的静态路由,保证网络中主路由失效的情况下,提供备份路由。但在主路由存在的情况下它不会出现在路由表中。浮动静态路由主要用 于拔号备份。静态路由的用处是当以太链路优先选择,当以太链路出现故障的时候,选用串行链路,而在以太链路恢复后,再优先选以太链路。
案例:
配置信息:
[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
loopback
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
shutdown
!
interface Serial1
link-protocol ppp
ip address 192.168.4.1 255.255.255.0
!
ospf enable
!
quit
!
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
undo pos-server addr-switch
firewall enable
aaa-enable
aaa accounting-scheme optional
!
interface Aux0
async mode flow
link-protocol ppp
!
interface Ethernet0
loopback
ip address 192.168.2.1 255.255.255.0
ospf enable area 0.0.0.0
!
interface Ethernet1
!
interface Serial0
clock DTECLK1
link-protocol ppp
ip address 192.168.3.2 255.255.255.0
ospf enable area 0.0.0.0
!
interface Serial1
clock DTECLK1
link-protocol ppp
ip address 192.168.4.2 255.255.255.0
!
ospf enable
!
quit
!
quit
ip route-static 192.168.1.0 255.255.255.0 192.168.4.1 preference 60
!
Return
验证信息:
主链路正常工作时的路由表
[r1]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Direct 0 0 192.168.1.1 Ethernet0
192.168.1.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.2.0/24 OSPF 10 1572 192.168.3.2 Serial0
192.168.3.0/24 Direct 0 0 192.168.3.2 Serial0
192.168.3.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.2/32 Direct 0 0 192.168.3.2 Serial0
192.168.4.0/24 Direct 0 0 192.168.4.2 Serial1
192.168.4.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.2/32 Direct 0 0 192.168.4.2 Serial1
[r2]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 OSPF 10 1572 192.168.3.1 Serial0
192.168.2.0/24 Direct 0 0 192.168.2.1 Ethernet0
192.168.2.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.0/24 Direct 0 0 192.168.3.1 Serial0
192.168.3.1/32 Direct 0 0 192.168.3.1 Serial0
192.168.3.2/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.0/24 Direct 0 0 192.168.4.1 Serial1
192.168.4.1/32 Direct 0 0 192.168.4.1 Serial1
192.168.4.2/32 Direct 0 0 127.0.0.1 LoopBack0
主链路有故障时的路由表
[r1]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Direct 0 0 192.168.1.1 Ethernet0
192.168.1.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.2.0/24 Static 60 0 192.168.4.2 Serial1
192.168.4.0/24 Direct 0 0 192.168.4.2 Serial1
192.168.4.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.2/32 Direct 0 0 192.168.4.2 Serial1
[r2]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Static 60 0 192.168.4.1 Serial1
192.168.2.0/24 Direct 0 0 192.168.2.1 Ethernet0
192.168.2.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.0/24 Direct 0 0 192.168.4.1 Serial1
192.168.4.1/32 Direct 0 0 192.168.4.1 Serial1
192.168.4.2/32 Direct 0 0 127.0.0.1 LoopBack0
2. Back interface接口备份
备份接口是指有两条同样好的链路可以提供给我们走,为了防止单点故障给我们带来不便,我们把其中一条作为主链路一条作为备份链路,当然,这种链路的前提是计费按照流量来计算。
案例:
配置信息:
[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
loopback
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(设置主链路接口的备份接口)
standby timer enable-delay 5 (设置主接口故障后几秒后备份接口up)
standby timer disable-delay 5 (设置主接口up后几秒后备份接口down)
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
!
ospf enable
!
quit
!
Return
[r2]dis cu
Now create configuration...
Current configuration
!
version 1.74
sysname r2
undo pos-server addr-switch
firewall enable
aaa-enable
aaa accounting-scheme optional
!
interface Aux0
async mode flow
link-protocol ppp
!
interface Ethernet0
loopback
ip address 192.168.2.1 255.255.255.0
ospf enable area 0.0.0.0
!
interface Ethernet1
!
interface Serial0
clock DTECLK1
link-protocol ppp
standby interface Serial 1(设置主链路接口的备份接口)
standby timer enable-delay 5 (设置主接口故障后几秒后备份接口up)
standby timer disable-delay 5 (设置主接口up后几秒后备份接口down)
ip address 192.168.3.2 255.255.255.0
ospf enable area 0.0.0.0
!
interface Serial1
clock DTECLK1
link-protocol ppp
ip address 192.168.4.2 255.255.255.0
ospf enable area 0.0.0.0
!
ospf enable
!
quit
!
Return
验证信息:
主链路正常工作时的路由表
[r1]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Direct 0 0 192.168.1.1 Ethernet0
192.168.1.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.2.0/24 OSPF 10 1572 192.168.3.2 Serial0
192.168.3.0/24 Direct 0 0 192.168.3.2 Serial0
192.168.3.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.2/32 Direct 0 0 192.168.3.2 Serial0
[r2]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 OSPF 10 1572 192.168.3.1 Serial0
192.168.2.0/24 Direct 0 0 192.168.2.1 Ethernet0
192.168.2.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.0/24 Direct 0 0 192.168.3.1 Serial0
192.168.3.1/32 Direct 0 0 192.168.3.1 Serial0
192.168.3.2/32 Direct 0 0 127.0.0.1 LoopBack0
主链路出现故障时的路由表
[r1]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Direct 0 0 192.168.1.1 Ethernet0
192.168.1.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.2.0/24 OSPF 10 1572 192.168.4.2 Serial1
192.168.4.0/24 Direct 0 0 192.168.4.2 Serial1
192.168.4.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.2/32 Direct 0 0 192.168.4.2 Serial1
[r2]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 OSPF 10 1572 192.168.4.1 Serial1
192.168.2.0/24 Direct 0 0 192.168.2.1 Ethernet0
192.168.2.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.0/24 Direct 0 0 192.168.4.1 Serial1
192.168.4.1/32 Direct 0 0 192.168.4.1 Serial1
192.168.4.2/32 Direct 0 0 127.0.0.1 LoopBack0
3. Mp ppp捆绑
MP是Multi-Link PPP的缩写,是将多个物理链路的PPP捆绑在同一个逻辑端口,旨在增加链路的带宽,只要是支持PPP的物理链路都可以启用MP,互相捆绑在同一个逻辑端口Virtual-Template口。MP允许将IP等网络层的报文进行碎片处理,将碎片的报文通过多个链路传输,同时抵达同一个目的地,以求汇总所有链路的带宽。
案例拓扑:
配置信息:
[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
loopback
ip address 192.168.1.1 255.255.255.0
!
interface Ethernet1
!
interface Serial0
link-protocol ppp
ppp mp(进端口启动mp)
ppp mp interface Virtual-Template1(把se0加入Virtual-Template1)
!
interface Serial1
link-protocol ppp
ppp mp(进端口启动mp)
ppp mp interface Virtual-Template1(把se1加入Virtual-Template1)
!
interface Virtual-Template1
link-protocol ppp
ip address 192.168.3.1 255.255.255.0
!
voice-setup
!
subscriber-line 0
!
subscriber-line 1
!
quit
!
quit
ip route-static 192.168.2.0 255.255.255.0 192.168.3.2 preference 60
!
return
[r2]dis cu
Now create configuration...
Current configuration
!
version 1.74
sysname r2
undo pos-server addr-switch
firewall enable
aaa-enable
aaa accounting-scheme optional
!
interface Aux0
async mode flow
link-protocol ppp
!
interface Ethernet0
loopback
ip address 192.168.2.1 255.255.255.0
!
interface Ethernet1
!
interface Serial0
clock DTECLK1
link-protocol ppp
ppp mp (进端口启动mp)
ppp mp interface Virtual-Template2(把se0加入Virtual-Template2)
shutdown
!
interface Serial1
clock DTECLK1
link-protocol ppp
ppp mp(进端口启动mp)
ppp mp interface Virtual-Template2(把se1加入Virtual-Template2)
interface Virtual-Template2
link-protocol ppp
ip address 192.168.3.2 255.255.255.0
!
quit
ip route-static 192.168.1.0 255.255.255.0 192.168.3.1 preference 60
!
Return
验证信息:
路由表信息
[r1]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Direct 0 0 192.168.1.1 Ethernet0
192.168.1.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.2.0/24 Static 60 0 192.168.3.2 Virtual-Template1
192.168.3.0/24 Direct 0 0 192.168.3.1 Virtual-Template1
192.168.3.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.2/32 Direct 0 0 192.168.3.1 Virtual-Template1
[r2]dis ip rou
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Static 60 0 192.168.3.1 Virtual-Template2
192.168.2.0/24 Direct 0 0 192.168.2.1 Ethernet0
192.168.2.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.0/24 Direct 0 0 192.168.3.2 Virtual-Template2
192.168.3.1/32 Direct 0 0 192.168.3.2 Virtual-Template2
192.168.3.2/32 Direct 0 0 127.0.0.1 LoopBack0
[r1]ping ip -a 192.168.1.1 192.168.2.1
PING 192.168.2.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.2.1: bytes=56 Sequence=0 ttl=255 time = 27 ms
Reply from 192.168.2.1: bytes=56 Sequence=1 ttl=255 time = 27 ms
Reply from 192.168.2.1: bytes=56 Sequence=2 ttl=255 time = 27 ms
Reply from 192.168.2.1: bytes=56 Sequence=3 ttl=255 time = 27 ms
Reply from 192.168.2.1: bytes=56 Sequence=4 ttl=255 time = 27 ms
--- 192.168.2.1 ping statistics ---
5 packets transmitted
5 packets received
0.00% packet loss
round-trip min/avg/max = 27/27/27 ms