tip

华为WLAN指导设计 来源:华为星火计划培训

华为WLAN设计
网优网归 场景规划
方案设计

【资料简介】华为Wlan网络网规网优技术、场景规划与方案设计,从0开始设计到交付,一本完完整整的学习教材,建议从事无线学习的同学学习..

马上观看
zon

华为WLAN专题集锦 专题:华为WLAN

WLAN配置
组网模式解析
组网配置案例

【华为无线】本指南详细介绍每个模版的命令解释及用途,在加上十多种精彩案例分享及解释,再加上网优网归,让你彻底脱盲,不在为无线..

马上观看
zon

家园VBook中心 分类:书籍中心

教材 案例 题库
知识 专业认证
资源价值

【中心简介】家园Vbook书籍中心是以收集和整理互联网上优秀书籍,以最好的知识推荐给你学习,让你在学习的路程上事半功倍,告别枯燥,早..

马上观看
tip

华为HCIE认证之路 分类:华为认证

HCIE学习之路
华为 路由 交换
含金量最大的资料

【学习介绍】在中国拥有一张证书不是梦,冰冻三尺,非一日之寒,要拥有一张认证所具备含金量技术水准那是需要多年的经年积累,本书专为你分享..

马上观看
tip

华三无线专题报告 发布:建哥哥

华三
H3C WLAN AC
无线专题

【资料简介】大好河山、无线风光,主要介绍H3C无线,从基础到高级配置及组网模式配置案例,多达200篇案例配置,从此告别对无线的迷茫..

马上观看
★浏览次数:180 次★  发布日期:2015-06-29
 当前位置:技术资料 > 网络工程 > Huawei > 正文
 
最近更新
    正在更新...
 

华为网络设备配置OSPF负载分担(NE路由器)

 

配置OSPF负载分担

组网需求

如下图所示。

路由器RouterA、RouterB、RouterC和RouterD之间通过OSPF协议达到IP网络互连的目的。

路由器RouterA、RouterB、RouterC和RouterD同属于区域0。

要求配置负载分担,使得路由器RouterA的流量,可以分别通过路由器RouterB和RouterC发送到路由器RouterD。

配置OSPF负载分担组网图

配置OSPF负载分担组网图

router
interfaceip address
routerinterfaceip address
RouterAGE3/0/0172.16.1.1./24RouterDPOS1/0/0192.168.0.2/24
POS2/0/010.1.2.1/24GE3/0/0172.17.1.1/24
POS1/0/010.1.1.1/24POS2/0/0192.168.1.2/24
RouterCPOS2/0/0192.168.0.1/24RouterBPOS2/0/0192.168.1.1/24
POS1/0/010.1.2.2/24POS1/0/010.1.1.2/24

配置思路

采用如下的思路配置OSPF的负载分担:

在各路由器上使能OSPF基本功能,实现互连。

取消负载分担,查看路由表信息。

在RouterA上配置负载分担方式。

在RouterA上配置等价路由优先级(可选配置)。

数据准备

为完成此配置例,需准备如下的数据:

四台路由器

RouterA的router id 1.1.1.1,运行的OSPF进程号1,区域0的网段10.1.0.0

RouterB的router id 2.2.2.2,运行的OSPF进程号1,区域0的网段10.1.0.0和192.168.0.0

RouterC的router id 3.3.3.3,运行的OSPF进程号1,区域0的网段10.1.0.0和192.168.1.0

RouterD的router id 4.4.4.4,运行的OSPF进程号1,区域0的网段192.168.0.0和192.168.1.0

RouterA上负载分担数目为1。

RouterA的路由负载分担方式。

RouterC的等价路由优先级权值为1。

配置步骤

步骤 1     配置各接口的IP地址(略)

步骤 2     配置OSPF的基本功能

步骤 3     在RouterA上取消负载分担配置

[RouterA] ospf
[RouterA-ospf-1] maximum load-balancing 1

# 查看RouterA的路由表。

[RouterA] display ip routing-table

Routing Tables: Public

Destinations : 7       Routes : 7


Destination/Mask    Proto  Pre  Cost       NextHop         Interface


10.1.1.0/24  Direct 0    0          10.1.1.1          Pos1/0/0

10.1.1.2/32  Direct 0    0           10.1.1.2          Pos1/0/0

10.1.2.0/24  Direct 0    0          10.1.2.1          Pos2/0/0

10.1.2.2/32  Direct 0    0           10.1.2.2          Pos2/0/0

    172.17.1.0/24  OSPF   10   3125       10.1.1.2          Pos1/0/0

192.168.0.0/24  OSPF   10   3124       10.1.1.2          Pos1/0/0

192.168.1.0/24  OSPF   10   3124       10.1.2.2          Pos2/0/0

从路由表中可以看出,当配置负载分担最大等价路由条数为1后,到达目标网段172.17.1.0的下一跳为10.1.1.2。

说明

由于OSPF对等价路由下一跳的选择是随机的,所以上面例子中10.1.1.2被选为最优下一跳。

步骤 4     在RouterA上恢复负载分担路由的缺省数量

[RouterA] ospf
[RouterA-ospf-1] undo maximum load-balancing

# 查看RouterA的路由表。

[RouterA] display ip routing-table

Routing Tables: Public

Destinations : 7       Routes : 8

Destination/Mask    Proto  Pre  Cost       NextHop         Interface

10.1.1.0/24  Direct 0    0           10.1.1.1         Pos1/0/0

10.1.1.2/32  Direct 0    0           10.1.1.2         Pos1/0/0

10.1.2.0/24  Direct 0    0          10.1.2.1         Pos2/0/0

10.1.2.2/32  Direct 0    0          10.1.2.2         Pos2/0/0

172.17.1.0/24  OSPF   10   3125      10.1.1.2        Pos1/0/0

                      OSPF   10   3125      10.1.2.2         Pos2/0/0

192.168.0.0/24  OSPF   10   3124      10.1.1.2         Pos1/0/0

192.168.1.0/24  OSPF   10   3124      10.1.2.2        Pos2/0/0

从路由表可以看出,当取消负载分担条数设置即恢复缺省配置后,由于最大等价路由条数的缺省值为6,因此路由器RouterA的两个下一跳10.1.1.2(RouterB)和10.1.2.2(RouterC)均成为有效路由。

说明

不同的产品,不同协议,最大等价路由条数可能会不同,这个最大值可以通过购买许可证文件来调整。

步骤 5     配置RouterA的负载分担方式

负载分担支持两种方式,逐包负载分担和逐流负载分担。

# 逐包负载分担
[RouterA] load-balance packet

检查配置结果

[RouterA] acl 3000

[RouterA -acl-adv-3000] rule permit icmp destination 172.17.1.1 0

[RouterA -acl-adv-3000] quit

[RouterA] quit

<RouterA> debugging ip packet acl 3000

<RouterA> terminal debugging

<RouterA> terminal monitor

<RouterA> ping 172.17.1.1

PING 172.17.1.1: 56  data bytes, press CTRL_C to break

*0.10792570 RouterA IP/8/debug_case:

Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1194, offset = 0, ttl = 255, protocol = 1,

checksum = 65258, s = 10.1.1.1, d = 172.17.1.1

prompt: Sending the packet from local at pos1/0/0


Reply from 172.17.1.1: bytes=56 Sequence=1 ttl=254 time=30 ms

*0.10793100 RouterA IP/8/debug_case:

Sending, interface = pos2/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1195, offset = 0, ttl = 255, protocol = 1,

checksum = 65001, s = 10.1.2.1, d = 172.17.1.1

prompt: Sending the packet from local at pos2/0/0


Reply from 172.17.1.1: bytes=56 Sequence=2 ttl=254 time=50 ms

*0.10793600 RouterA IP/8/debug_case:

Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1196, offset = 0, ttl = 255, protocol = 1,

checksum = 65256, s = 10.1.1.1, d = 172.17.1.1

prompt: Sending the packet from local at pos1/0/0


Reply from 172.17.1.1: bytes=56 Sequence=3 ttl=254 time=40 ms

*0.10794140 RouterA IP/8/debug_case:

Sending, interface = pos2/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1197, offset = 0, ttl = 255, protocol = 1,

checksum = 64999, s = 10.1.2.1, d = 172.17.1.1

prompt: Sending the packet from local at pos2/0/0


Reply from 172.17.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms

*0.10794670 RouterA IP/8/debug_case:

Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1198, offset = 0, ttl = 255, protocol = 1,

checksum = 65254, s = 10.1.1.1, d = 172.17.1.1

prompt: Sending the packet from local at pos1/0/0


Reply from 172.17.1.1: bytes=56 Sequence=5 ttl=254 time=40 ms


--- 172.17.1.1 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 30/38/50 ms

从上面的debugging信息中,我们可以看出,到达目标地址172.17.1.1的报文分别从RouterA的POS 1/0/0接口和POS 2/0/0接口轮流发送出去,即基于报文的负载分担。

# 逐流负载分担
[RouterA] load-balance flow

检查配置结果

[RouterA] acl 3000
[RouterA -acl-adv-3000] rule permit icmp destination 172.17.1.1 0
[RouterA -acl-adv-3000] quit
[RouterA] quit
<RouterA> debugging ip packet acl 3000
<RouterA> terminal debugging
<RouterA> terminal monitor

<RouterA> ping 172.17.1.1

PING 172.17.1.1: 56  data bytes, press CTRL_C to break

*0.11319030 RouterA IP/8/debug_case:

Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1320, offset = 0, ttl = 255, protocol = 1,

checksum = 65132, s = 10.1.1.1, d = 172.17.1.1

prompt: Sending the packet from local at pos1/0/0


Reply from 172.17.1.1: bytes=56 Sequence=1 ttl=254 time=90 ms

*0.11319500 RouterA IP/8/debug_case:

Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1321, offset = 0, ttl = 255, protocol = 1,

checksum = 65131, s = 10.1.1.1, d = 172.17.1.1

prompt: Sending the packet from local at pos1/0/0


Reply from 172.17.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms

*0.11320000 RouterA IP/8/debug_case:

Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1322, offset = 0, ttl = 255, protocol = 1,

checksum = 65130, s = 10.1.1.1, d = 172.17.1.1

prompt: Sending the packet from local at pos1/0/0


Reply from 172.17.1.1: bytes=56 Sequence=3 ttl=254 time=40 ms

*0.11320530 RouterA IP/8/debug_case:

Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1324, offset = 0, ttl = 255, protocol = 1,

checksum = 65128, s = 10.1.1.1, d = 172.17.1.1

prompt: Sending the packet from local at pos1/0/0


Reply from 172.17.1.1: bytes=56 Sequence=4 ttl=254 time=40 ms

*0.11321070 RouterA IP/8/debug_case:

Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,

pktlen = 84, pktid = 1325, offset = 0, ttl = 255, protocol = 1,

checksum = 65127, s = 10.1.1.1, d = 172.17.1.1

prompt: Sending the packet from local at pos1/0/0


Reply from 172.17.1.1: bytes=56 Sequence=5 ttl=254 time=80 ms


--- 172.17.1.1 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 30/56/90 ms

从上面的debugging信息中,我们可以看出,到达目标地址172.17.1.1的报文全部从RouterA的POS 1/0/0接口发送出去,即基于流的负载分担。

说明

因为基于流的负载分担的选路原则为:到达同一个目的地址,它总是选择以前走过的路径。由于上一次到达目的地址是从POS 1/0/0接口发出,所以基于流的负载分担时也选择从POS 1/0/0发送报文。

步骤 6     在RouterA上配置等价路由优先级(可选配置)

如果我们不希望RoterB和RouterC形成负载分担,可以配置等价路由优先级,指定下一跳。

[RouterA] ospf
[RouterA-ospf-1] nexthop 10.1.2.2 weight 1

# 查看RouterA的路由表

[RouterA] display ip routing-table

Routing Tables: Public

Destinations : 7       Routes : 7


Destination/Mask    Proto  Pre  Cost       NextHop         Interface


10.1.1.0/24  Direct 0    0          10.1.1.1         Pos1/0/0

10.1.1.2/32  Direct 0    0           10.1.1.2          Pos1/0/0

10.1.2.0/24  Direct 0    0          10.1.2.1         Pos2/0/0

10.1.2.2/32  Direct 0    0          10.1.2.2         Pos2/0/0

    172.17.1.0/24  OSPF   10   3125     10.1.2.2          Pos2/0/0

192.168.0.0/24  OSPF   10   3124      10.1.1.2          Pos1/0/0

192.168.1.0/24  OSPF   10   3124      10.1.2.2         Pos2/0/0

从路由表中可以看出,当配置等价路由的优先级后,由于下一跳为10.1.2.2(RouterC)的优先级(权值为1)高于下一跳为10.1.1.2(RouterB)的优先级,所以OSPF优先选择下一跳为10.1.2.2为唯一最优路由。

 
建议使用IE8.0以上版本解析 网络QQ群:30573676 家园群:36740144 Elv home systems. 蜀ICP备20009373号 © All Rights Reserved 2012 - By badulip
×

扫二维码,关注微信公众号