JNCIP实验视频: JUNOS OSPF路由汇总及LSA管理02

junos-ospf-address-summary-and-inter-area-lsa-filtering-2
youtube

JNCIP实验: OSPF地址汇总及域间LSA管理 Part02/03

点击上文↑链接至YouTube收看高清版本实验视频

手动汇总Juniper路由器OSPF域间LSA-3

为了显示地址汇总的效果,我们先保存一下没有进行汇总前区域0的OSPF数据库快照:

nigel@junos# run show ospf database logical-router r5
area 0 

    OSPF link state database, Area 0.0.0.0
 Type       ID       Adv Rtr   Seq     Age Opt Cksum Len
Router   10.0.3.3  10.0.3.3 0x80000043 16 0x22 0xf964 60
Router   10.0.3.4  10.0.3.4 0x8000005b 16 0x22 0xb27  60
Router  *10.0.3.5  10.0.3.5 0x80000043 15 0x22 0x1f34 60
Network  10.0.2.2  10.0.3.3 0x8000000a 48 0x22 0xa84b 32
Network  10.0.2.6  10.0.3.4 0x8000004c 03 0x22 0xe3c9 32
Network  10.0.2.10 10.0.3.4 0x8000000a 10 0x22 0x5c8d 32
Summary *6.0.0.0   10.0.3.5 0x80000008 15 0x22 0xb368 28
Summary *6.0.1.0   10.0.3.5 0x80000008 15 0x22 0xa872 28
Summary *6.0.2.0   10.0.3.5 0x80000008 15 0x22 0x9d7c 28
Summary *6.0.3.0   10.0.3.5 0x80000008 15 0x22 0x9286 28
Summary  10.0.4.4  10.0.3.3 0x8000003d 16 0x22 0xc41a 28
Summary  10.0.4.4  10.0.3.4 0x80000054 16 0x22 0x8641 28
Summary  10.0.4.8  10.0.3.3 0x8000003d 16 0x22 0xa633 28
Summary  10.0.4.8  10.0.3.4 0x80000054 16 0x22 0x5470 28
Summary  10.0.4.12 10.0.3.3 0x8000003e 16 0x22 0x686e 28
Summary  10.0.4.12 10.0.3.4 0x80000054 16 0x22 0x407e 28
Summary  10.0.6.1  10.0.3.3 0x8000003c 16 0x22 0xd608 28
Summary  10.0.6.1  10.0.3.4 0x80000053 16 0x22 0xa224 28
Summary  10.0.6.2  10.0.3.3 0x8000003b 16 0x22 0xd805 28
Summary  10.0.6.2  10.0.3.4 0x80000053 16 0x22 0x8e38 28
Summary *10.0.8.0  10.0.3.5 0x8000003d 15 0x22 0xaa33 28
Summary *10.0.8.4  10.0.3.5 0x80000001 15 0x22 0xf026 28
Summary *10.0.8.8  10.0.3.5 0x80000001 15 0x22 0xc84a 28
Summary *10.0.9.6  10.0.3.5 0x80000001 15 0x22 0xe32d 28
Summary *10.0.9.7  10.0.3.5 0x80000001 15 0x22 0xd936 28
ASBRSum  10.0.6.1  10.0.3.3 0x8000003b 16 0x22 0xca14 28
ASBRSum  10.0.6.1  10.0.3.4 0x80000053 16 0x22 0x9431 28
ASBRSum *10.0.9.7  10.0.3.5 0x8000003c 15 0x22 0x557e 28

    OSPF AS SCOPE link state database
 Type       ID       Adv Rtr   Seq     Age Opt Cksum Len
Extern 3.0.0.0     10.0.3.4 0x80000055 16 0x22 0x555a 36
Extern 200.200.0.0 10.0.9.7 0x8000006a 28 0x22 0xcece 36

无论是普通区域还是NSSA,域间LSA-3汇总都在[edit protocols ospf area]层次下配置,汇总普通区域0.0.0.1到骨干区域的LSA-3:

[edit logical-routers r5]
nigel@junos# set protocols ospf area 1 area-range
10.0.8/23 

[edit logical-routers r5]
nigel@junos# show protocols ospf area 1
area-range 10.0.8.0/23;
interface fxp1.56;
interface fxp1.57;

重新查看R3的路由表,原有的5段路由全部被汇总到10.0.8/23里面,默认情况下:汇总后路由的Metric取值是明细路由当中Metric值最大的路由之Metric,可以通过override-Metric参数进行手动修改。

nigel@junos# run show route protocol ospf logical-router
r3 10.0.8/23 

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

10.0.8.0/23        *[OSPF/10] 00:00:21, metric 3
                    > to 10.0.2.1 via fxp1.35

继续汇总NSSA 0.0.0.10到骨干区域的LSA-3,需要注意的是区域10与骨干区域之间同时存在R3/R4两个ABR,因此我们需要同时在R3/R4两台路由器上进行汇总:

[edit logical-routers]
nigel@junos# set r3 protocols ospf area 10 area-range
10.0.4.0/22 

[edit logical-routers]
nigel@junos# set r4 protocols ospf area 10 area-range
10.0.4.0/22 

nigel@junos# show r3 protocols ospf
area 0.0.0.10 {
    nssa {
        default-lsa {
            default-metric 10;
            type-7;
        }
        no-summaries;
    }
    area-range 10.0.4.0/22;
    interface fxp2.13 {
        metric 2;
    }
}

我们在这里只列出了R3上的层次配置,相类似的配置同样应该在R4上应用,最后查看R5路由表,确认另外5段路由全部被汇总被汇总进来:

nigel@junos# run show route logical-router
r5 10.0.4.0/22 

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

10.0.4.0/22        *[OSPF/10] 00:00:05, metric 4
                    > to 10.0.2.10 via fxp2.45

手动过滤Juniper路由器OSPF域间LSA-3

除了汇总以外,过滤不必要的LSA也能有效的压缩OSPF LSDB的体积,与地址汇总相同,无论是普通区域还是NSSA,域间LSA-3汇总都在[edit protocols ospf area]层次下配置,在area-range命令后加上restrict参数。根据题目需求,我们需要将6.0.0/24-6.0.3/24这4段路由进行过滤,我们实际上采用的是“先汇总,后过滤”的形式:

nigel@junos# run show route logical-router r3 6/22    

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

6.0.0.0/24         *[OSPF/10] 03:45:58, metric 2
                    > to 10.0.8.5 via fxp1.56
6.0.1.0/24         *[OSPF/10] 03:45:58, metric 2
                    > to 10.0.8.5 via fxp1.56
6.0.2.0/24         *[OSPF/10] 03:45:58, metric 2
                    > to 10.0.8.5 via fxp1.56
6.0.3.0/24         *[OSPF/10] 03:45:58, metric 2
                    > to 10.0.8.5 via fxp1.56

[edit logical-routers]
nigel@junos# set r5 protocols ospf area 1 area-range
6/22 restrict 

[edit logical-routers]
nigel@junos# show r5 protocols ospf area 1
area-range 10.0.8.0/23;
area-range 6.0.0.0/22 restrict;
interface fxp1.56;
interface fxp1.57;

重新查看R3路由表,6/22网段从路由表内消失:

nigel@junos# run show route logical-router r3 6/22             

[edit logical-routers]
nigel@junos#

发表评论

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