JNCIP案例分析 – Juniper/Cisco OSPF互操作 Part7

JUNOS与IOS OSPF接口开销调节

kangaroo

  1. 基于带宽优化路由选择:保证所有快速以太网接口被自动分配Metric值为10,另外你需要手动调节Metric使R5到区域1的内部网段实现负载均衡;

我们先把第13个实验目标提前分析,JUNOS与IOS的OSPF参考带宽同为100Mbps,在之前的实验过程中IOS对于快速以太网接口开销值定义为10仅仅因为fa0/0接口与实验台交换机自动协商带宽为10Mbps,可以在接口下修复该配置,以下以R4为例,包含环回接口在内的4个OSPF接口当前开销值均被修改为1。

!
interface FastEthernet0/0.34
 bandwidth 100000
 encapsulation dot1Q 134
 ip address 10.0.2.6 255.255.255.252
 ip mtu 1496
 ip ospf message-digest-key 10 md5 jnx
!

r4#show ip ospf interface | include Cost
  Process ID 64, Router ID 10.0.3.4, Network Type
  LOOPBACK, Cost: 1
  Process ID 64, Router ID 10.0.3.4, Network Type
  BROADCAST, Cost: 1
  Process ID 64, Router ID 10.0.3.4, Network Type
  BROADCAST, Cost: 1
  Process ID 64, Router ID 10.0.3.4, Network Type
  BROADCAST, Cost: 1

通过在所有OSPF路由器上修改参考带宽能够在全局修改链路开销值,除环回接口保持默认开销值,JUNOS环回接口默认开销为0;而IOS环回接口默认开销为1。所有快速以太网接口的开销值均设置为10,假如你使用输出导出符精确定位信息,注意JUNOS与IOS对大小写的区分行为。

[edit logical-routers]
nigel@itaa7.2# set r1 protocols ospf reference-bandwidth
1g 

nigel@itaa7.2#run show ospf interface logical-router r5
detail | match cost
Type: LAN, Address: 10.0.2.1, Mask: 255.255.255.252, MTU:
1496, Cost: 10
Type: LAN, Address: 10.0.2.9, Mask: 255.255.255.252, MTU:
1496, Cost: 10
Type: LAN, Address: 10.0.3.5, Mask: 255.255.255.255, MTU:
65535, Cost: 0
Type: LAN, Address: 10.0.8.6, Mask: 255.255.255.252, MTU:
1496, Cost: 10
Type: LAN, Address: 10.0.8.9, Mask: 255.255.255.252, MTU:
1496, Cost: 10

r4(config)#router ospf 64
r4(config-router)#auto-cost reference-bandwidth 1000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent
        across all routers.

r4#show ip ospf interface | include Cost
  Process ID 64, Router ID 10.0.3.4, Network Type
  LOOPBACK, Cost: 1
  Process ID 64, Router ID 10.0.3.4, Network Type
  BROADCAST, Cost: 10
  Process ID 64, Router ID 10.0.3.4, Network Type
  BROADCAST, Cost: 10
  Process ID 64, Router ID 10.0.3.4, Network Type
  BROADCAST, Cost: 10

为了使R5能通过R3/R4实现进入区域1流量的负载均衡,我们需要手动调整R3/R4通告的10.0.4/22汇总LSA-3的Metric值。在R5的OSPF数据库内对比两者的LSA,由于JUNOS与IOS默认对汇总路由的Metric计算方式的差异,使得R5当前优选R4作为流量进入区域1的ABR。

nigel@itaa7.2# run show ospf database logical-router r5
lsa-id 10.0.4.0 detail                  

    OSPF link state database, area 0.0.0.0
 Type      ID      Adv Rtr  Seq      Age Opt Cksum Len
Summary 10.0.4.0 10.0.3.3 0x80000019 493 0x2 0xc451 28
  mask 255.255.252.0
  TOS 0x0, metric 20
Summary 10.0.4.0 10.0.3.4 0x8000001d 444 0x22 0x708a 28
  mask 255.255.252.0
  TOS 0x0, metric 10

有多种方式能够实现调整汇总路由Metric以达到负载均衡的目的,给出JUNOS与IOS各自最直接覆盖默认汇总路由开销值的解决方案。

[edit logical-routers]
nigel@itaa7.2# show r3 protocols ospf
area 0.0.0.1 {
        area-range 10.0.4.0/22 override-metric 30;
}

r4(config-router)#area 1 range 10.0.4.0 255.255.252.0
cost 30

nigel@itaa7.2# run show route logical-router r5
10.0.4/22 exact 

inet.0: 22 destinations, 22 routes (22 active,
0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.4.0/22        *[OSPF/10] 00:00:27, metric 40
                    > to 10.0.2.2 via fxp2.35
                      to 10.0.2.10 via fxp2.45
Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s