• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S7500系列以太网交换机典型配置案例 Release3135(V1.00)

05-路由典型配置案例

本章节下载  (804.14 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S7500E/S7500/Configure/Typical_Configuration_Example/H3C_S7500_Configuration_Release3135(V1.00)/200802/334530_30005_0.htm

05-路由典型配置案例


路由典型配置举例

关键词:静态路由、RIP、OSPF、ISIS、BGP

摘  要:本文主要介绍H3C S7500系列以太网交换机的IPv4路由功能在具体组网中的应用配置,对所涉及到的各种路由协议,分别给出了详细的配置步骤。

缩略语:RIP(Route Information Protocol,路由信息协议)、OSPF(Open Shortest Path First,开放式最短路径优先)、ISIS(Intermediate System-to-Intermediate System intra-domain routing information exchange protocol,中间系统到中间系统的域内路由信息交换协议)、BGP(Border Gateway Protocol,边界网关协议)

 


第1章  路由协议简介

1.1  路由协议简介

1.1.1  静态路由和动态路由协议

1. 静态路由

无开销,配置简单,需要人工维护,适合简单、稳定的拓扑结构的网络。对于网络结构的变化需要人工干涉。

2. RIP

配置相对比较简单,对路由器的CPU及内存性能不是很敏感,适合中小型网络。收敛速度较慢,无法彻底解决路由环路的问题。由于路由更新原则是周期性的广播或组播模式,消耗较多的网络资源。

3. OSPF

配置比较复杂,对路由器的CPU及内存性能要求较高,适合大中型网络。收敛速度快,彻底根除路由环路的问题。支持区域划分,提供路由分级管理。

4. ISIS

配置比较复杂,对路由器的CPU及内存性能要求较高,适合大中型网络。收敛速度快,彻底根除路由环路的问题。支持两级的分层结构,提供路由分级管理。

5. BGP

配置比较复杂,是运行在AS之间的路由协议。具有非常灵活和强大的路由策略控制,彻底根除路由环路问题。具有高可靠性、稳定性、可扩展性。

1.1.2  动态路由协议在交换机中的应用

S7500系列以太网交换机支持RIP、OSPF、ISIS、BGP等动态路由协议。

1.2  配置指南

&  说明:

l      该配置指南以S7500系列交换机为准。

l      各配置注意事项请参见具体产品操作手册和命令手册。

 

1.2.1  配置任务简介

表1-1 配置任务简介

配置任务

详细说明

静态路由配置

1.2.2 

RIP配置

1.2.3 

OSPF配置

1.2.4 

ISIS配置

1.2.5 

BGP配置

1.2.6 

路由策略配置

1.2.7 

 

1.2.2  静态路由配置

表1-2 配置静态路由

操作

命令

说明

进入系统视图

system-view

-

配置静态路由

ip route-static ip-address { mask | mask-length } { interface-type interface-number | next-hop } [ preference preference-value ] [ reject | blackhole ]

必选

缺省情况下,系统可以获取到去往与路由器直连的子网路由

 

1.2.3  RIP配置

表1-3 RIP配置指导

配置任务

说明

详细配置

配置RIP的基本功能

RIP基本配置

必选

1.2.3  1.

配置接口的工作状态

可选

1.2.3  2.

配置RIP的版本号

可选

1.2.3  3.

控制RIP的路由信息

配置接口的附加度量值

可选

1.2.3  4.

配置RIP的路由聚合

可选

1.2.3  5.

禁止RIP接收主机路由

可选

1.2.3  6.

配置RIP接收或者发布的路由进行过滤

可选

1.2.3  7.

配置RIP协议优先级

可选

1.2.3  8.

配置RIP在不同接口之间流量等价分担

可选

1.2.3  9.

配置RIP的引入外部路由信息

可选

1.2.3  10.

调整和优化RIP网络

配置RIP定时器

可选

1.2.3  11.

配置水平分割

可选

1.2.3  12.

配置RIP-1报文的零域检查

可选

1.2.3  13.

配置RIP-2报文的认证方式

可选

1.2.3  14.

配置RIP邻居

可选

1.2.3  15.

 

1. RIP基本配置

表1-4 启动RIP,并在指定的网段使能RIP

操作

命令

说明

进入系统视图

system-view

-

启动RIP并进入RIP视图

rip

必选

在指定网段接口上使能RIP

network network-address

必选

缺省情况下,接口禁用RIP

 

2. 配置接口的工作状态

表1-5 配置接口的工作状态

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

允许接口接收RIP更新报文

rip input

可选

缺省情况下,允许接口发送或接收RIP报文

允许接口发送RIP更新报文

rip output

允许接口收发RIP报文

rip work

 

3. 配置RIP的版本号

表1-6 配置RIP版本号

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

指定接口运行的RIP版本

rip version { 1 | 2 [ broadcast | multicast ] }

必选

缺省情况下,接口接收RIP-1和RIP-2的报文,只发送RIP-1报文。当配置接口版本为RIP-2时,同时可以指定报文的发送方式

 

4. 配置接口的附加度量值

表1-7 配置接口的附加度量值

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

设置接口在接收路由时增加的度量值

rip metricin value

可选

缺省情况下,RIP在接收报文时给路由增加的附加路由度量值为0

设置接口在发布路由时增加的度量值

rip metricout value

可选

缺省情况下,RIP在发送报文时给路由增加的附加路由度量值为1

 

5. 配置RIP的路由聚合

表1-8 配置RIP的路由聚合

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

使能RIP-2自动路由聚合

summary

必选

缺省情况下,RIP-2启用自动路由聚合功能

 

6. 禁止RIP接收主机路由

表1-9 禁止RIP接收主机路由

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

禁止接收主机路由

undo host-route

必选

缺省情况下,允许路由器接收主机路由

 

7. 对接收或发布的路由信息进行过滤

表1-10 配置对接收或者发布的路由信息进行过滤

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

对接收的路由信息进行过滤

filter-policy { acl-number | ip-prefix ip-prefix-name [ gateway ip-prefix-name ] | gateway ip-prefix-name } import [ interface interface-type interface-number ]

必选

缺省情况下,RIP不对接收的路由信息进行过滤

使用gateway参数的命令用来配置对接收的指定地址发布的路由信息进行过滤

filter-policy gateway ip-prefix-name import

对发布的路由信息进行过滤

filter-policy { acl-number | ip-prefix ip-prefix-name } export [ protocol [ process-id ] | interface interface-type interface-number ]

必选

缺省情况下,RIP不对发布的路由信息进行过滤

filter-policy route-policy route-policy-name export

 

8. 配置RIP协议优先级

表1-11 配置RIP协议优先级

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

设置RIP协议的优先级

preference value

必选

缺省值为100

 

9. 配置RIP在不同接口之间流量等价分担

表1-12 配置RIP在不同接口之间流量等价分担

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

配置RIP在不同接口之间流量等价分担

traffic-share-across-interface

必选

缺省情况下,traffic-share-across-interface处于关闭状态

 

10. RIP引入外部路由信息

表1-13 配置RIP引入外部路由信息

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

设定路由引入的缺省度量值

default cost value

可选

缺省值为1

引入外部路由信息

import-route protocol [ process-id | allow-ibgp ] [ cost value | route-policy route-policy-name ]*

必选

process-id  参数仅在引入ospf路由时使用

 

11. 配置RIP定时器

表1-14 配置RIP定时器

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

配置RIP定时器的值

timers { update update-timer | timeout timeout-timer } *

必选

缺省情况下,Update定时器值:30秒,Timeout定时器值:180秒

 

12. 配置水平分割

表1-15 配置水平分割

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

启动水平分割

rip split-horizon

必选

缺省情况下,接口发送RIP报文时使用水平分割

 

13. 配置RIP-1报文的零域检查

表1-16 配置RIP-1报文的零域检查

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

对RIP-1报文的零域进行检查

checkzero

必选

缺省情况下,RIP-1进行零域检查

 

14. 配置RIP-2报文的认证方式

表1-17 配置RIP-2报文的认证方式

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置RIP-2报文的认证方式

rip authentication-mode { simple password | md5 { rfc2453 key-string | rfc2082 key-string key-id } }

必选

如果配置MD5认证,则必须配置MD5的类型:

l      rfc2453类型支持符合RFC2453规定的报文格式

l      rfc2082类型支持符合RFC2082规定的报文格式

 

15. 配置RIP邻居

表1-18 配置RIP邻居

操作

命令

说明

进入系统视图

system-view

-

进入RIP视图

rip

-

配置RIP邻居

peer ip-address

必选

如果在不支持广播或组播报文的链路上运行RIP,则必须手工指定RIP的邻居

通常情况下,RIP使用广播或组播地址发送报文

 

1.2.4  OSPF配置

表1-19 OSPF配置指导

配置任务

说明

详细配置

配置OSPF基本功能

必选

1.2.4  1.

配置OSPF的区域特性

可选

1.2.4  2.

配置OSPF的网络类型

配置OSPF接口的网络类型

可选

1.2.4  3.

配置NBMA网络的邻居

可选

1.2.4  4.

配置OSPF接口的DR优先级

可选

1.2.4  5.

配置OSPF的路由信息控制

配置OSPF路由聚合

可选

1.2.4  6.

配置OSPF对接收的路由进行过滤

可选

1.2.4  7.

配置OSPF的链路开销

可选

1.2.4  8.

配置OSPF协议的优先级

可选

1.2.4  9.

配置OSPF引入外部路由

可选

1.2.4  10.

配置OSPF网络调整优化

配置OSPF报文定时器

可选

1.2.4  11.

配置接口传送LSA的延迟时间

可选

1.2.4  12.

配置SPF计算间隔

可选

1.2.4  13.

禁止接口发送OSPF报文

可选

1.2.4  14.

配置OSPF验证

可选

1.2.4  15.

配置DD报文中的MTU

可选

1.2.4  16.

配置OSPF网管功能

可选

1.2.4  17.

 

1. 配置OSPF基本功能

表1-20 OSPF基本配置

操作

命令

说明

进入系统视图

system-view

-

关闭协议组播MAC地址下发功能

undo protocol multicast-mac enable

可选

配置路由器的ID

router id router-id

可选

当在一台路由器上运行多个OSPF进程时,建议使用ospf命令中的router-id为不同进程指定不同的Router ID

启动OSPF,进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

必选

进入OSPF视图

进入OSPF区域视图

area area-id

必选

配置区域所包含的网段

network address wildcard-mask

必选

缺省情况下,接口不属于任何区域

 

2. 配置OSPF的区域特性

表1-21 配置OSPF的区域特性

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

-

进入OSPF区域视图

area area-id

-

配置当前区域为Stub区域

stub [ no-summary ]

可选

缺省情况下,没有区域被设置为Stub区域

配置当前区域为NSSA区域

nssa [ default-route-advertise | no-import-route | no-summary ]*

可选

缺省情况下,没有区域被设置为NSSA区域

配置发送到Stub区域或者NSSA区域缺省路由的开销

default-cost cost

可选

仅在ABR上进行配置。 缺省情况下,发送到Stub区域或者NSSA区域的缺省路由的开销为1

创建并配置虚连接

vlink-peer router-id [ hello seconds | retransmit seconds | trans-delay seconds | dead seconds | simple password | md5 keyid key ]*

可选

为使虚连接生效,在虚连接的两端都需配置此命令,并且两端配置的hello、dead等参数必须一致。

 

3. 配置OSPF接口的网络类型

表1-22 配置OSPF接口的网络类型

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置OSPF接口的网络类型

ospf network-type { broadcast | nbma | p2mp | p2p }

必选

缺省情况下,接口的网络类型根据物理接口而定

 

4. 配置NBMA网络的邻居

表1-23 配置NBMA网络的邻居

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

-

配置NBMA网络的邻居

peer ip-address [ dr-priority dr-priority ]

必选

缺省情况下,NBMA接口的邻接点优先级的取值为1

 

5. 配置OSPF接口的DR优先级

表1-24 配置OSPF接口的DR优先级

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

设置OSPF接口的DR优先级

ospf dr-priority priority

必选

缺省情况下,优先级为1

 

6. 配置OSPF路由聚合

表1-25 配置ABR路由聚合

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

必选

进入区域视图

area area-id

-

配置OSPF的ABR路由聚合

abr-summary ip-address mask [ advertise | not-advertise ]

必选

此命令只有在ABR上配置才会有效。缺省情况下,区域边界路由器不对路由聚合

 

表1-26 配置ASBR路由聚合

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

-

配置OSPF的ASBR路由聚合

asbr-summary ip-address mask [ not-advertise | tag value ]

必选

此命令只有在ASBR上配置才会有效。缺省情况下,不对引入的路由进行聚合

 

7. 配置OSPF对接收的路由进行过滤

表1-27 配置OSPF对接收的路由进行过滤

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

-

配置对接收的路由进行过滤

filter-policy { acl-number | ip-prefix ip-prefix-name | gateway ip-prefix-name } import

必选

缺省情况下,不对接收到的路由信息进行过滤

 

8. 配置OSPF的链路开销

表1-28 配置OSPF接口的开销值

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

设置OSPF接口的开销值

ospf cost value

必选

缺省情况下,接口按照当前的波特率自动计算开销。对于交换机的VLAN接口,该值固定为10

 

9. 配置OSPF协议的优先级

表1-29 配置OSPF协议的优先级

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

-

配置OSPF协议的优先级

preference [ ase ] value

必选

缺省情况下,OSPF路由的优先级为10,OSPF ASE的优先级为150

 

10. 配置OSPF引入外部路由

表1-30 配置OSPF引入外部路由

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

-

配置OSPF引入其它协议的路由

import-route protocol [ process-id | allow-ibgp ] [ cost value | type value | tag value | route-policy route-policy-name ]*

必选

缺省情况下,不引入其他协议的路由信息

配置对发布的路由进行过滤

filter-policy { acl-number | ip-prefix ip-prefix-name } export [ protocol ]

可选

缺省情况下,不对发布的路由信息进行过滤

配置OSPF引入缺省路由

default-route-advertise [ always | cost value | type type-value | route-policy route-policy-name ]*

可选

缺省情况下,不引入缺省路由

配置OSPF在接收外部路由时缺省的花费值

default cost value

可选

缺省情况下,OSPF引入外部路由的缺省度量值为1

配置OSPF在每单位时间内引入外部路由数量的缺省限制

default limit routes

可选

缺省情况下,引入路由数量的上限为1000

配置OSPF引入外部路由的缺省时间间隔

default interval seconds

缺省情况下,缺省时间间隔为1秒

配置OSPF在接收外部路由时缺省的标记值

default tag tag

可选

缺省情况下,设置缺省标记值为1

配置OSPF在接收外部路由时缺省的类型

default type { 1 | 2 }

可选

缺省情况下,引入的外部路由类型为Type2

 

11. 配置OSPF报文定时器

表1-31 配置OSPF报文定时器

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置接口发送Hello报文的时间间隔

ospf timer hello seconds

可选

缺省情况下,point-to-pointbroadcast类型接口发送Hello报文的时间间隔的值为10秒;point-to-multipointNBMA类型接口发送Hello报文的时间间隔的值为30秒

在NBMA接口上配置发送轮询报文的时间间隔

ospf timer poll seconds

可选

缺省情况下,发送轮询报文的时间间隔为40秒

设置相邻路由器间失效时间

ospf timer dead seconds

可选

缺省情况下,point-to-pointbroadcast类型接口的OSPF邻居失效时间为40秒,point-to-multipointNBMA类型接口的OSPF邻居失效时间为120秒

设置邻接路由器重传LSA的间隔

ospf timer retransmit interval

可选

缺省情况下,时间间隔为5秒

 

12. 配置接口传送LSA的延迟时间

表1-32 配置接口传送LSA的延迟时间

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置接口传送LSA的延迟时间

ospf trans-delay seconds

必选

缺省情况下,传输延迟时间为1秒

 

13. 配置SPF计算间隔

表1-33 配置SPF计算间隔

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

-

设置SPF计算间隔

spf-schedule-interval interval

必选

缺省情况下,SPF计算的时间间隔为5秒

 

14. 禁止接口发送OSPF报文

表1-34 禁止接口发送OSPF报文

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

-

禁止接口发送OSPF报文

silent-interface silent-nterface-type silent-interface-number

必选

缺省情况下,允许接口发送OSPF报文

 

15. 配置OSPF验证

表1-35 配置OSPF验证

操作

命令

说明

进入系统视图

system-view

-

进入OSPF视图

ospf [ process-id [ router-id router-id ] ]

进入OSPF区域视图

area area-id

配置OSPF区域的验证模式

authentication-mode { simple | md5 }

必选

缺省情况下,没有配置区域验证模式

退回到OSPF视图

quit

-

退回到系统视图

quit

-

进入接口视图

interface interface-type interface-number

配置OSPF接口的验证模式

ospf authentication-mode { simple password | md5 key-id key }

必选

缺省情况下,接口不对OSPF报文进行验证

 

16. 配置DD报文中的MTU

表1-36 配置DD报文中的MTU

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

使能接口发送DD报文时填MTU值

ospf mtu-enable

必选

缺省情况下,接口发送DD报文时MTU值为0,即不填接口的实际MTU值

 

17. 配置OSPF网管功能

表1-37 配置OSPF MIB绑定

操作

命令

说明

进入系统视图

system-view

-

配置OSPF MIB绑定

ospf mib-binding process-id

可选

如果不配此命令,MIB操作绑定会默认绑定第1个OSPF进程。当启动了多个OSPF进程时,可以配置OSPF MIB绑定在哪个进程上

使能OSPF的TRAP功能

snmp-agent trap enable ospf [ process-id ] [ ifauthfail | ifcfgerror | ifrxbadpkt | ifstatechange | iftxretransmit | lsdbapproachoverflow | lsdboverflow | maxagelsa | nbrstatechange | originatelsa | vifauthfail | vifcfgerror | virifrxbadpkt | virifstatechange | viriftxretransmit | virnbrstatechange ]*

可选

可以配置OSPF发送多种SNMP TRAP报文,并可以通过进程号指定某个OSPF进程发送SNMP TRAP报文

 

1.2.5  ISIS配置

表1-38 IS-IS配置任务简介

配置任务

说明

详细配置

集成化IS-IS配置

使能IS-IS

必选

1.2.5  1.  

配置网络实体名称

必选

1.2.5  2.

在指定接口上使能IS-IS

必选

1.2.5  3.

配置选举DIS的优先级

可选

1.2.5  4.

配置路由器的类型

可选

1.2.5  5.

配置接口线路类型

可选

1.2.5  6.

配置IS-IS引入外部路由

可选

1.2.5  7.

配置IS-IS路由过滤

可选

1.2.5  8.

配置IS-IS路由渗透

可选

1.2.5  9.

配置IS-IS路由聚合

可选

1.2.5  10.

配置生成缺省路由

可选

1.2.5  11.

配置IS-IS协议的优先级

可选

1.2.5  12.

配置IS-IS路由权值的类型

可选

1.2.5  13.

配置IS-IS连路状态路由权

可选

1.2.5  14.

配置IS-IS的定时器

可选

1.2.5  15.

配置IS-IS的认证

可选

1.2.5  16.

配置接口的mesh group

可选

1.2.5  17.

配置过载标志位

可选

1.2.5  18.

配置丢弃检验出校验和错误的LSP

可选

1.2.5  19.

配置邻接状态输出开关

可选

1.2.5  20.

配置LSP刷新周期

可选

1.2.5  21.

配置LSP有效时间

可选

1.2.5  22.

配置SPF相关参数

可选

1.2.5  23.

配置禁止接口发送报文

可选

1.2.5  24.

 

1. 使能IS-IS

表1-39 使能IS-IS

操作

命令

说明

进入系统视图

system-view

-

配置ISIS

isis [ tag ]

必选

缺省情况下,不使能IS-IS路由进程

 

2. 配置网络实体名称

表1-40 配置网络实体名称

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

使能网络实体

network-entity net

必选

 

3. 在指定接口上使能IS-IS

表1-41 在指定接口上使能IS-IS

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

使能ISIS

isis enable [ tag ]

必选

 

4. 配置选举DIS的优先级

表1-42 配置选举DIS的优先级

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置用来选举DIS的优先级

isis dis-priority value [ level-1 | level-2 ]

必选

缺省情况下,接口上的优先级为64

 

5. 配置路由器的类型

表1-43 配置路由器的类型

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置路由器的类型

is-level { level-1 | level-1-2 | level-2 }

必选

缺省情况下,路由器的类型为level-1-2

 

6. 配置接口线路类型

表1-44 配置接口线路类型

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置接口的线路类型

isis circuit-level [ level-1 | level-1-2 | level-2 ]

必选

缺省情况下,接口的线路类型为level-1-2

 

7. 配置IS-IS引入外部路由

表1-45 配置IS-IS引入外部路由

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

引入其它协议的路由

import-route protocol [ allow-ibgp ] [ cost value | type { external | internal } | [ level-1 | level-1-2 | level-2 ] | route-policy route-policy-name ]*

必选

缺省情况下,IS-IS不引入其它协议的路由信息

 

8. 配置IS-IS路由过滤

表1-46 配置IS-IS对接收的路由信息进行过滤

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置对接收的路由信息进行过滤

filter-policy acl-number import

必选

缺省情况下,IS-IS不对接收的路由信息进行过滤

 

表1-47 对其它路由协议发布的路由进行过滤

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

对其它路由协议发布的路由进行过滤

filter-policy acl-number export [ protocol ]

必选

缺省情况下,IS-IS不接收其它路由协议发布的路由信息

 

9. 配置IS-IS路由渗透

表1-48 配置IS-IS路由渗透

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

使能IS-IS路由渗透

import-route isis level-2 into level-1 [ acl acl-number ]

必选

缺省情况下,Level-2路由器的路由信息不发布到Level-1区域中

 

10. 配置IS-IS路由聚合

表1-49 配置IS-IS路由聚合

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置聚合路由

summary ip-address ip-mask [ level-1 | level-1-2 | level-2 ]

必选

缺省情况下,系统不进行路由聚合

 

11. 配置生成缺省路由

表1-50 配置生成缺省路由

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置生成缺省路由

default-route-advertise [ route-policy route-policy-name ]

必选

由该命令产生的缺省路由只被引入到同级别的路由器上

 

12. 配置IS-IS协议的优先级

表1-51 配置IS-IS协议的优先级

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置IS-IS协议的优先级

preference [ value | clns | ip ]

必选

缺省情况下,IS-IS路由的优先级为15

 

13. 配置IS-IS路由权值的类型

表1-52 配置IS-IS报文中路由权值的表示方式

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置路由权值的表示方式

cost-style { narrow | wide | wide-compatible | { compatible | narrow-compatible } [ relax-spf-limit ] }

必选

缺省情况下,IS-IS只收发采用Narrow方式表示路由权值的报文

 

14. 配置IS-IS链路状态路由权

表1-53 配置IS-IS链路状态路由权

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置接口的路由权

isis cost value [ level-1 | level-2 ]

必选

缺省情况下,IS-IS在接口上的路由权值为10

 

15. 配置IS-IS协议的定时器

表1-54 配置Hello报文广播间隔

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置接口上Hello报文发送间隔,时间单位为秒。

isis timer hello seconds [ level-1 | level-2 ]

必选

缺省情况下,接口上Hello报文的发送间隔时间为10秒

 

表1-55 配置CSNP报文广播间隔

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置接口上CSNP报文发送间隔,时间单位为秒。

isis timer csnp seconds [ level-1 | level-2 ]

必选

缺省情况下,接口上CSNP报文发送的间隔时间为10秒

 

表1-56 配置LSP报文发送间隔

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置接口上LSP报文的发送间隔,单位为毫秒

isis timer lsp time

必选

缺省情况下,接口上LSP报文的发送间隔为33毫秒

 

表1-57 配置接口的LSP重传间隔

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置LSP在点到点链路上的重传间隔

isis timer retransmit seconds

必选

缺省情况下,接口上LSP报文在点到点链路上的重传间隔时间为5秒

 

表1-58 配置接口的Hello报文失效数目

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置Hello报文失效数目

isis timer holding-multiplier value [ level-1 | level-2 ]

必选

缺省情况下,Hello报文失效数目为3

 

16. 配置IS-IS的认证

表1-59 配置接口的认证密码

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置认证密码

isis authentication-mode { simple | md5 } password [ { level-1 | level-2 } [ ip | osi ] ]

必选

缺省情况下,接口上不配置认证密码,不做认证

 

表1-60 配置IS-IS认证密码

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置区域认证密码

area-authentication-mode { simple | md5 } password [ ip | osi ]

可选

配置路由域认证密码

domain-authentication-mode { simple | md5 } password [ ip | osi ]

可选

缺省情况下,系统不配置密码,也不做认证

 

表1-61 配置IS-IS采用与其他厂商兼容的MD5算法

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置IS-IS采用与其他厂商兼容的MD5算法

md5-compatible

必选

配置IS-IS采用缺省的MD5算法

undo md5-compatible

可选

缺省情况下,采用与华为兼容的MD5算法

 

17. 配置接口的mesh group

表1-62 配置接口的mesh group

操作

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置接口加入mesh group

isis mesh-group { mesh-group-number | mesh-blocked }

必选

缺省情况下,接口正常进行LSP的扩散

 

18. 配置过载标志位

表1-63 配置过载标志位

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置过载标志位

set-overload

必选

缺省情况下,不配置过载标志位

 

19. 配置丢弃检验出校验和错误的LSP

表1-64 配置丢弃检验出校验和错误的LSP

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

当LSP校验和检验错误时丢弃该LSP

ignore-lsp-checksum-error

必选

缺省情况下,忽略LSP的校验和检验错误

 

20. 配置邻接状态输出开关

表1-65 配置邻接状态输出开关

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

打开邻接状态输出开关

log-peer-change

必选

缺省情况下,关闭邻接状态输出开关

 

21. 配置LSP刷新周期

表1-66 配置LSP刷新周期

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置LSP刷新周期

timer lsp-refresh seconds

必选

缺省情况下,LSP刷新周期为900秒,即15分钟

 

22. 配置LSP有效时间

表1-67 配置LSP有效时间

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置LSP有效时间

timer lsp-max-age seconds

必选

缺省情况下,LSP有效时间为1200秒,即20分钟

 

23. 配置SPF相关参数

表1-68 配置SPF计算间隔

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置SPF计算间隔

timer spf seconds [ level-1 | level-2 ]

必选

缺省情况下,SPF计算间隔为10秒钟

 

表1-69 配置SPF分段计算

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置SPF分段计算

spf-slice-size seconds

必选

缺省情况下,SPF的计算不分段

 

表1-70 配置SPF主动释放CPU

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

配置SPF主动释放CPU的间隔

spf-delay-interval number

必选

缺省情况下,IS-IS的SPF每处理5000条路由主动释放一次CPU

 

24. 禁止接口发送报文

表1-71 禁止接口发送报文

操作

命令

说明

进入系统视图

system-view

-

进入ISIS视图

isis [ tag ]

-

禁止接口发送IS-IS报文

silent-interface interface-type interface-number

必选

缺省情况下,允许接口收发IS-IS报文

 

1.2.6  BGP配置

表1-72 BGP配置指导

配置任务

说明

详细配置

配置BGP的基本功能

必选

1.2.6  1.

控制路由信息的发布与接收

配置BGP引入其他路由信息

可选

1.2.6  2.  

配置BGP路由聚合

可选

1.2.6  3.

配置发送缺省路由

可选

1.2.6  4.  

配置BGP路由信息的接收策略

可选

1.2.6  5.  

配置BGP路由信息的发布策略

可选

1.2.6  6.

配置BGP与IGP路由不同步

可选

1.2.6  7.

配置BGP负载分担

可选

1.2.6  8.  

配置BGP路由衰减

可选

1.2.6  9.

配置BGP的路由属性

可选

1.2.6  10.

调整和优化BGP网络

可选

1.2.6  11.

配置BGP大型网络

配置BGP对等体组

必选

1.2.6  12.

配置BGP团体

必选

1.2.6  13.

配置BGP路由反射器

可选

1.2.6  14.

配置BGP联盟

可选

1.2.6  15.

 

1. BGP基本配置

表1-73 配置BGP的基本功能

操作

命令

说明

进入系统视图

system-view

-

配置Router ID

router id router-id

可选

启动BGP,进入BGP视图

bgp as-number

必选

缺省情况下,系统不运行BGP

指定对等体组的AS号

peer group-name as-number as-number

必选

缺省情况下,对等体组无AS号

配置对等体/对等体组的描述信息

peer { group-name | ip-address } description description-text

可选

缺省情况下,对等体/对等体组无描述信息

激活指定对等体

peer { group-name | ip-address } enable

可选

缺省情况下,BGP对等体是激活的

指定路由更新报文的源接口

peer { group-name | ip-address } connect-interface interface-type interface-number

可选

缺省情况下,BGP使用最佳路由更新报文的源接口

配置允许同非直接相连网络上的邻居建立EBGP连接

peer group-name ebgp-max-hop [ hop-count ]

可选

缺省情况下,不允许同非直接相连网络上的邻居建立EBGP连接。配置参数hop-count可以同时配置EBGP连接的最大路由器跳数

 

2. 配置BGP引入其他路由信息

表1-74 配置BGP引入其他路由信息

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

允许将缺省路由引入到BGP路由表中

default-route imported

可选

缺省情况下,BGP不允许将缺省路由引入到BGP路由表中

引入其它协议路由信息并通告

import-route protocol [ process-id ] [ med med-value | route-policy route-policy-name ]*

必选

缺省情况下,BGP未引入且不通告其它协议的路由

将网段路由通告到BGP路由表中

network network-address [ mask ] [route-policy route-policy-name ]

可选

缺省情况下,BGP不通告任何网段路由

 

3. 配置BGP路由聚合

表1-75 配置BGP路由聚合

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

配置BGP路由聚合

配置路由自动聚合

summary

必选

缺省情况下,不进行路由聚合

配置手动路由聚合

aggregate ip-address mask [ as-set | attribute-policy route-policy-name | detail-suppressed | origin-policy route-policy-name | suppress-policy route-policy-name ]*

 

4. 配置发送缺省路由

表1-76 配置向对等体发送缺省路由

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

向对等体组发送缺省路由

peer group-name default-route-advertise

必选

缺省情况下,不向对等体组发送缺省路由

 

5. 配置对接收的路由信息的过滤策略

表1-77 配置对接收的路由信息的过滤策略

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

对接收的全局路由信息进行过滤

filter-policy { acl-number | gateway ip-prefix-name | ip-prefix ip-prefix-name [ gateway ip-prefix-name ] } import

必选

缺省情况下,不对接收的路由信息进行过滤

对来自对等体/对等体组的路由指定路由策略

peer { group-name | ip-address } route-policy policy-name import

必选

缺省情况下,不指定对等体/对等体组的路由策略

过滤从对等体/对等体组接收的路由信息

为对等体/对等体组设置基于ACL的过滤策略

peer { group-name | ip-address } filter-policy acl-number import

必选

缺省情况下,对等体/对等体组无基于ACL过滤策略,无基于AS路径过滤列表的路由过滤策略,无基于IP前缀列表的过滤策略

为对等体/对等体组设置基于AS路径过滤列表的BGP路由过滤策略

peer { group-name | ip-address } as-path-acl acl-number import

为对等体/对等体组设置基于IP前缀列表的路由过滤策略

peer { group-name | ip-address } ip-prefix ip-prefix-name import

 

6. 配置对发布的路由信息的过滤策略

表1-78 配置对发布的路由信息的过滤策略

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

对发布的路由进行过滤

filter-policy { acl-number | ip-prefix ip-prefix-name } export [ protocol [ process-id ] ]

必选

缺省情况下,不对发布的路由信息进行过滤

对向对等体组发布的路由指定路由策略

peer group-name route-policy route-policy-name export

必选

缺省情况下,不指定对等体组的路由策略

过滤发布给对等体的路由信息

为对等体组设置基于ACL的路由过滤策略

peer group-name filter-policy acl-number export

必选

缺省情况下,对等体组无基于ACL路由过滤策略,无基于AS路径过滤列表的路由过滤策略,无基于IP前缀列表的路由过滤策略

为对等体组设置基于AS路径过滤列表的路由过滤策略

peer group-name as-path-acl acl-number export

为对等体组配置基于IP前缀列表的路由过滤策略

peer group-name ip-prefix ip-prefix-name export

 

7. 配置BGP与IGP路由不同步

表1-79 配置BGP与IGP路由不同步

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

取消BGP与IGP路由同步

undo synchronization

必选

缺省情况下,BGP和IGP路由不同步

 

8. 配置BGP负载分担

表1-80 配置BGP负载分担

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

配置BGP负载分担

balance num

必选

缺省情况下,BGP不进行负载分担

 

9. 配置BGP路由衰减

表1-81 配置BGP路由衰减

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

配置BGP路由衰减参数

dampening [ half-life-reachable half-life-unreachable reuse suppress ceiling ] [ route-policy route-policy-name ]

必选

缺省情况下,没有配置路由衰减,half-life-reachable缺省值为15分钟,half-life-unreachable缺省值为15分钟,reuse缺省值为750,suppress缺省值为2000, ceiling缺省值为16000

 

10. 配置BGP的路由属性

表1-82 配置BGP的路由属性

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

配置外部、内部、本地路由的管理优先级

preference ebgp-value ibgp-value local-value

可选

缺省情况下,各优先级的值分别为256、256、130

配置本地优先级的缺省值

default local-preference value

可选

缺省情况下,本地优先级的缺省值为100

配置MED属性

配置本机的缺省MED值

default med med-value

可选

缺省情况下,med-value为0

配置允许比较来自不同自治系统中的邻居的路由的MED值

compare-different-as-med

可选

缺省情况下,不允许比较来自不同AS邻居的路由路径的MED属性值。

配置发布路由时将自身地址作为下一跳

peer group-name next-hop-local

必选

在某些组网环境中,为保证IBGP邻居能够找到正确的下一跳,可以配置在向IBGP对等体组发布路由时,改变下一跳地址为自身地址

配置AS_Path属性

配置允许本地AS编号重复出现的次数

peer { group-name | ip-address } allow-as-loop [ number ]

可选

缺省情况下,允许的重复次数为1

为对等体组指定一个自治系统号

peer group-name as-number as-number

可选

缺省情况下,没有为对等体组配置本地自治系统号

配置发送BGP更新报文时AS_Path属性中仅携带公有AS编号

peer group-name public-as-only

可选

缺省情况下,发送BGP更新报文时,携带私有自治系统号

 

11. 调整和优化BGP网络

表1-83 调整和优化BGP网络

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

配置BGP定时器

配置BGP的存活时间与保持时间间隔

timer keepalive keepalive-interval hold holdtime-interval

可选

缺省情况下,存活时间为60秒,保持时间为180秒。使用timer命令配置的定时器比使用peer timer命令配置的定时器优先级要低

配置指定对等体/对等体组的存活和保持时间

peer { group-name | ip-address } timer keepalive keepalive-interval hold holdtime-interval

配置对等体组的发送同一路由更新报文的时间间隔

peer group-name route-update-interval seconds

可选

缺省情况下,向IBGP对等体发送同一路由更新的时间间隔为15秒,向EBGP对等体发送同一路由更新的时间间隔为30秒

手工对BGP连接进行软复位

return

-

refresh bgp { all | ip-address | group group-name } [ multicast ] { import | export }

可选

system-view

重新进入BGP视图

bgp as-number

配置BGP建立TCP连接时进行MD5认证

peer { group-name | ip-address } password { cipher | simple } password

可选

缺省情况下,BGP在建立TCP连接时不进行MD5认证

 

12. 配置BGP对等体组

表1-84 配置BGP对等体组

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

创建IBGP对等体组

创建IBGP对等体组

group group-name [ internal ]

可选

如果不选择internalexternal参数,则创建的是IBGP对等体组。可向组中加入多个对等体。系统会自动在BGP视图下创建该对等体,并配置其AS编号为本地AS编号

向对等体组中加入对等体

peer ip-address group group-name [ as-number as-number ]

创建EBGP对等体组

创建EBGP对等体组

group group-name external

可选

可向组中加入多个对等体。系统会自动在BGP视图下创建该对等体,并配置其AS编号为对等体组的AS编号

配置对等体组的AS编号

peer group-name as-number as-number

向对等体组中加入对等体

peer ip-address group group-name [ as-number as-number ]

创建混合EBGP对等体组

创建EBGP对等体组

group group-name external

可选

可向组中加入多个对等体

向对等体组中加入对等体

peer ip-address group group-name [ as-number as-number ]

结束与指定对等体/对等体组的会话

peer { group-name | ip-address } shutdown

可选

 

13. 配置BGP团体

表1-85 配置BGP团体

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

配置向对等体发布团体属性

peer group-name advertise-community

必选

缺省情况下,不将团体属性和扩展团体属性发布给任何对等体组

对向对等体组发布的路由指定路由策略

peer group-name route-policy route-policy-name export

必选

缺省情况下,不指定对等体组的路由策略

 

14. 配置BGP路由反射器

表1-86 配置BGP路由反射器

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

配置将本机作为路由反射器,并将对等体组作为路由反射器的客户

peer group-name reflect-client

必选

缺省情况下,没有配置路由反射器及其客户

使能客户机之间的路由反射

reflect between-clients

可选

缺省情况下,允许客户到客户的路由反射

配置路由反射器的集群ID

reflector cluster-id cluster-id

可选

缺省情况下,每个路由反射器是使用自己的路由ID作为集群ID

 

15. 配置BGP联盟

表1-87 配置BGP联盟

操作

命令

说明

进入系统视图

system-view

-

进入BGP视图

bgp as-number

-

BGP联盟的基本配置

配置联盟ID

confederation id as-number

必选

缺省情况下,未配置联盟的ID,未配置属于联盟的子自治系统

指定一个联盟体中包含了哪些子自治系统

confederation peer-as as-number-list

配置联盟的兼容性

confederation { nonstandard | standard1965 | standard3065 }

可选

缺省情况下,配置的联盟与RFC1965一致

 

1.2.7  路由策略配置

表1-88 路由策略配置指导

配置任务

说明

详细配置

配置过滤列表

配置IPv4地址前缀列表

可选

1.2.7  1.  

配置AS路径列表

可选

1.2.7  2.

配置团体属性列表

可选

1.2.7  3.

配置路由策略

创建路由策略

必选

1.2.7  4.

配置if-match子句

可选

1.2.7  5.

配置apply子句

可选

1.2.7  6.

 

1. 配置IPv4地址前缀列表

表1-89 配置IPv4地址前缀列表

操作

命令

说明

进入系统视图

system-view

-

配置IPv4地址前缀列表

ip ip-prefix ip-prefix-name [ index index-number ] { permit | deny } network len [ greater-equal greater-equal | less-equal less-equal ]

必选

缺省情况下,不指定地址前缀列表。

 

2. 配置AS路径列表

表1-90 配置AS路径列表

操作

命令

说明

进入系统视图

system-view

-

配置AS路径列表

ip as-path-acl acl-number { permit | deny } as-regular-expression

必选

缺省情况下,没有定义AS路径列表

 

3. 配置团体属性列表

表1-91 配置团体属性列表

操作

命令

说明

进入系统视图

system-view

-

配置基本团体属性列表

ip community-list basic-comm-list-number { permit | deny } [ aa:nn &<1-12> | internet | no-export-subconfed | no-advertise | no-export ]*

可选

缺省情况下,未配置BGP团体属性列表

配置高级团体属性列表

ip community-list adv-comm-list-number { permit | deny } comm-regular-expression

可选

缺省情况下,未配置BGP团体属性列表

 

4. 创建路由策略

表1-92 创建路由策略

操作

命令

说明

进入系统视图

system-view

-

创建路由策略

route-policy route-policy-name { permit | deny } node node-number

必选

缺省情况下,不创建路由策略

 

5. 配置if-match子句

表1-93 配置If-match子句

操作

命令

说明

进入系统视图

system-view

-

进入路由策略视图

route-policy route-policy-name { permit | deny } node node-number

-

匹配BGP路由信息的AS路径域

if-match as-path as-path-number

可选

匹配BGP路由信息的团体属性

if-match community { basic-community-number [ whole-match ] | adv-community-number }

可选

匹配路由策略的IP地址范围

if-match { acl acl-number | ip-prefix ip-prefix-name }

可选

缺省情况下,不匹配路由策略的IP地址范围

匹配路由信息的路由开销

if-match cost value

可选

缺省情况下,不匹配路由信息的路由开销

匹配路由信息的出接口

if-match interface interface-type interface-number

可选

缺省情况下,不匹配路由信息的出接口

匹配路由信息下一跳

if-match ip next-hop { acl acl-number | ip-prefix ip-prefix-name }

可选

缺省情况下,不匹配路由信息下一跳地址

匹配OSPF路由信息的标记域

if-match tag value

可选

缺省情况下,不匹配OSPF路由信息的标记域

 

6. 配置apply子句

表1-94 配置apply子句

操作

命令

说明

进入系统视图

system-view

-

进入路由策略视图

route-policy route-policy-name { permit | deny } node node-number

-

在BGP路由信息的as-path系列前加入指定的AS号

apply as-path as-number-list

可选

在BGP路由信息中配置团体属性

apply community { none | [ aa:nn ] &<1-13> [ no-export-subconfed | no-export | no-advertise ]* [ additive ] }

可选

配置路由信息的下一跳地址

apply ip next-hop ip-address

可选

配置引入路由到IS-IS的级别

apply isis [ level-1 | level-2 | level-1-2 ]

可选

配置BGP路由信息的本地优先级

apply local-preference local-preference

可选

配置路由信息的开销值

apply cost value

可选

缺省情况下,不配置路由信息的路由开销

配置路由信息的路由权类型

apply cost-type [ internal | external ]

可选

配置BGP路由信息的路由源

apply origin { igp | egp as-number | incomplete }

可选

配置路由信息的标记域

apply tag value

可选

缺省情况下,不配置OSPF路由信息的标记域

 


第2章  典型配置举例

&  说明:

典型配置举例以S7500系列交换机为准。

 

2.1  典型配置举例

2.1.1  静态路由典型配置

1. 组网需求

(1)        需求分析

某小型公司办公网络需要任意两个节点之间能够互通,网络结构简单、稳定,用户希望最大限度利用现有设备。用户现在拥有的设备不支持动态路由协议。

根据用户需求及用户网络环境,选择静态路由实现用户网络之间互通。

(2)        网络规划

根据用户需求,设计如图2-1所示网络拓扑图。

图2-1 静态路由配置举例组网图

2. 配置步骤

交换机上的配置步骤:

# 设置以太网交换机Switch A的静态路由。

<SwitchA> system-view

[SwitchA] ip route-static 1.1.3.0 255.255.255.0 1.1.2.2

[SwitchA] ip route-static 1.1.4.0 255.255.255.0 1.1.2.2

[SwitchA] ip route-static 1.1.5.0 255.255.255.0 1.1.2.2

# 设置以太网交换机Switch B的静态路由。

<SwitchB> system-view

[SwitchB] ip route-static 1.1.2.0 255.255.255.0 1.1.3.1

[SwitchB] ip route-static 1.1.5.0 255.255.255.0 1.1.3.1

[SwitchB] ip route-static 1.1.1.0 255.255.255.0 1.1.3.1

# 设置以太网交换机Switch C的静态路由。

<SwitchC> system-view

[SwitchC] ip route-static 1.1.1.0 255.255.255.0 1.1.2.1

[SwitchC] ip route-static 1.1.4.0 255.255.255.0 1.1.3.2

主机上的配置步骤:

# 在主机A上配缺省网关为1.1.5.1,具体配置略。

# 在主机B上配缺省网关为1.1.4.1,具体配置略。

# 在主机C上配缺省网关为1.1.1.1,具体配置略。

至此图中所有主机或以太网交换机之间均能两两互通。

2.1.2  RIP典型配置

1. 组网需求

(1)        需求分析

某小型公司办公网络需要任意两个节点之间能够互通,网络规模比较小。需要设备自动适应网络拓扑变化,降低人工维护工作量。

根据用户需求及用户网络环境,选择RIP路由协议实现用户网络之间互通。

(2)        网络规划

根据用户需求,设计如图2-2所示网络拓扑图。

设备

接口

IP地址

设备

接口

IP地址

Switch A

Vlan-int1

110.11.2.1/24

Switch B

Vlan-int1

110.11.2.2/24

 

Vlan-int2

155.10.1.1/24

 

Vlan-int3

196.38.165.1/24

Switch C

Vlan-int1

110.11.2.3/24

 

 

 

 

Vlan-int4

117.102.0.1/16

 

 

 

图2-2 RIP典型配置组网图

2. 配置步骤

&  说明:

以下的配置,只列出了与RIP相关的操作。在进行下列配置之前,请先确保以太网链路层能够正常工作,且各VLAN接口IP地址已经配置完成。

 

(1)        配置Switch A

# 配置RIP。

<SwitchA> system-view

[SwitchA] rip

[SwitchA-rip] network 110.11.2.0

[SwitchA-rip] network 155.10.1.0

(2)        配置Switch B

# 配置RIP。

<SwitchB> system-view

[SwitchB] rip

[SwitchB-rip] network 196.38.165.0

[SwitchB-rip] network 110.11.2.0

(3)        配置Switch C

# 配置RIP。

<SwitchC> system-view

[SwitchC] rip

[SwitchC-rip] network 117.102.0.0

[SwitchC-rip] network 110.11.2.0

2.1.3  OSPF的DR典型配置

1. 组网需求

(1)        需求分析

某用户网络链路类型为广播型网络,通过OSPF实现网络之间互通。由于网络中设备性能有差异,希望DR/BDR由性能较高的设备承担,优化网络处理速度。对于网络中性能较低的设备,禁止其参加DR/BDR选举。

根据用户需求及其网络环境,通过修改接口优先级实现用户需求。

(2)        网络规划

根据用户需求,设计如图2-3所示网络拓扑图。

设备

接口

IP地址

Router ID

接口优先级

Switch A

Vlan-int1

196.1.1.1/24

1.1.1.1

100

Switch B

Vlan-int1

196.1.1.2/24

2.2.2.2

0

Switch C

Vlan-int1

196.1.1.3/24

3.3.3.3

2

Switch D

Vlan-int1

196.1.1.4/24

4.4.4.4

1

图2-3 配置OSPF的DR选择组网图

2. 配置步骤

# 配置Switch A

<SwitchA> system-view

[SwitchA] interface Vlan-interface 1

[SwitchA-Vlan-interface1] ip address 196.1.1.1 255.255.255.0

[SwitchA-Vlan-interface1] ospf dr-priority 100

[SwitchA-Vlan-interface1] quit

[SwitchA] router id 1.1.1.1

[SwitchA] ospf

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] network 196.1.1.0 0.0.0.255

# 配置Switch B

<SwitchB> system-view

[SwitchB] interface Vlan-interface 1

[SwitchB-Vlan-interface1] ip address 196.1.1.2 255.255.255.0

[SwitchB-Vlan-interface1] ospf dr-priority 0

[SwitchB-Vlan-interface1] quit

[SwitchB] router id 2.2.2.2

[SwitchB] ospf

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] network 196.1.1.0 0.0.0.255

# 配置Switch C

<SwitchC> system-view

[SwitchC] interface Vlan-interface 1

[SwitchC-Vlan-interface1] ip address 196.1.1.3 255.255.255.0

[SwitchC-Vlan-interface1] ospf dr-priority 2

[SwitchC-Vlan-interface1] quit

[SwitchC] router id 3.3.3.3

[SwitchC] ospf

[SwitchC-ospf-1] area 0

[SwitchC-ospf-1-area-0.0.0.0] network 196.1.1.0 0.0.0.255

# 配置Switch D

<SwitchD> system-view

[SwitchD] interface Vlan-interface 1

[SwitchD-Vlan-interface1] ip address 196.1.1.4 255.255.255.0

[SwitchD-Vlan-interface1] quit

[SwitchD] router id 4.4.4.4

[SwitchD] ospf

[SwitchD-ospf-1] area 0

[SwitchD-ospf-1-area-0.0.0.0] network 196.1.1.0 0.0.0.255

在Switch A上运行display ospf peer来显示OSPF邻居,注意Switch A有三个邻居。

每个邻居的状态都是full,这意味着Switch A与它的每个邻居都形成了邻接(Switch A和Switch C必须与网络中的所有交换机形成邻接,才能分别充当网络的DR和BDR)。Switch A是网络中的DR,而Switch C是BDR。其它所有的邻居都是DRother(这意味着它们既不是DR,也不是BDR)。

# 将Switch B的优先级改为200

<SwitchB> system-view

[SwitchB] interface Vlan-interface 1

[SwitchB-Vlan-interface1] ospf dr-priority 200

在Switch A上运行display ospf peer来显示OSPF邻居,注意Switch B的优先级变为200;但它并不是DR。

只有当现在的DR不在网络上了后,DR才会改变。关掉Switch A,在Switch D上运行display ospf peer命令可显示邻居,注意本来是BDR的Switch C成为了DR,并且Switch B现在成为了BDR。

若网络中所有的交换机被移走后又重新加入,Switch B就被选为DR(优先级为200),Switch A成为了BDR(优先级为100)。关掉所有的交换机再重新启动,这个操作会带来一个新的DR/BDR选择。

2.1.4  OSPF虚连接配置

1. 组网需求

(1)        需求分析

用户网络运行OSPF实现网络互通。网络分为三个区域,一个骨干区域,两个普通区域(Area 1、Area 2)。其中某普通区域(Area 2)无法与骨干区域直接相连,只能通过另外一个普通区域(Area 1)接入。用户希望无法与骨干区域直接连接的普通区域(Area 2)能够与另外两个区域互通。

根据用户需求及用户网络环境,选择虚连接来实现普通区域(Area 2)与骨干区域之间的连接。

(2)        网络规划

根据用户需求,设计如图2-4所示网络拓扑图。

设备

接口

IP地址

Router ID

Switch A

Vlan-int1

196.1.1.2/24

1.1.1.1

 

Vlan-int2

197.1.1.2/24

-

Switch B

Vlan-int1

152.1.1.1/24

2.2.2.2

 

Vlan-int2

197.1.1.1/24

-

图2-4 配置OSPF虚链路组网图

2. 配置步骤

(1)        配置OSPF基本功能

# 配置Switch A。

<SwitchA> system-view

[SwitchA] interface vlan-interface 1

[SwitchA-Vlan-interface1] ip address 196.1.1.2 255.255.255.0

[SwitchA-Vlan-interface1] quit

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] ip address 197.1.1.2 255.255.255.0

[SwitchA-Vlan-interface2] quit

[SwitchA] router id 1.1.1.1

[SwitchA] ospf

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] network 196.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] quit

[SwitchA-ospf-1] area 1

[SwitchA-ospf-1-area-0.0.0.1] network 197.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.1] quit

[SwitchA-ospf-1] quit

# 配置Switch B。

<SwitchB> system-view

[SwitchB] interface Vlan-interface 1

[SwitchB-Vlan-interface1] ip address 152.1.1.1 255.255.255.0

[SwitchB-Vlan-interface1] quit

[SwitchB] interface Vlan-interface 2

[SwitchB-Vlan-interface2] ip address 197.1.1.1 255.255.255.0

[SwitchB-Vlan-interface2] quit

[SwitchB] router id 2.2.2.2

[SwitchB] ospf

[SwitchB-ospf-1] area 1

[SwitchB-ospf-1-area-0.0.0.1] network 197.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.1] quit

[SwitchB-ospf-1] area 2

[SwitchB-ospf-1-area-0.0.0.2] network 152.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.2] quit

# 显示Switch A的OSPF路由表。

[SwitchA] display ospf routing

 

                 OSPF Process 1 with Router ID 1.1.1.1

                              Routing Tables

 

Routing for Network

Destination             Cost Type NextHop         AdvRouter        Area

196.1.1.0/24              10 Stub 196.1.1.2       1.1.1.1          0.0.0.0

197.1.1.0/24              10 Net  197.1.1.1       2.2.2.2          0.0.0.1

 

Total Nets: 2

  Intra Area: 2  Inter Area: 0  ASE: 0  NSSA: 0

&  说明:

由于Area2没有与Area0直接相连,所以Switch A的路由表中没有Area2中的路由。

 

(2)        配置虚连接。

# 配置Switch A。

[SwitchA] ospf

[SwitchA-ospf-1] area 1

[SwitchA-ospf-1-area-0.0.0.1] vlink-peer 2.2.2.2

[SwitchA-ospf-1-area-0.0.0.1] quit

[SwitchA-ospf-1] quit

# 配置Switch B。

[SwitchB-ospf-1] area 1

[SwitchB-ospf-1-area-0.0.0.1] vlink-peer 1.1.1.1

[SwitchB-ospf-1-area-0.0.0.1] quit

# 显示Switch A的OSPF路由表。

[SwitchA]display ospf routing

 

                 OSPF Process 1 with Router ID 1.1.1.1

                              Routing Tables

 

Routing for Network

Destination             Cost Type NextHop         AdvRouter        Area

196.1.1.0/24              10 Stub 196.1.1.2       1.1.1.1          0.0.0.0

197.1.1.0/24              10 Net  197.1.1.1       2.2.2.2          0.0.0.1

152.1.1.0/24              20 SNet 197.1.1.1       2.2.2.2          0.0.0.0

 

Total Nets: 3

  Intra Area: 2  Inter Area: 1  ASE: 0  NSSA: 0

可以看到,Switch A已经学到了Area2的路由152.1.1.0/24。

2.1.5  配置ISIS基本功能

1. 组网需求

(1)        需求分析

某小型公司办公网络需要任意两个节点之间能够互通,网络规模适中。需要设备自动适应网络拓扑变化,路由信息能够快速收敛。

根据用户需求及用户网络环境,选择ISIS路由协议实现用户网络之间互通。

(2)        网络规划

根据用户需求,设计如图2-5所示网络拓扑图。

图2-5 配置ISIS基本功能组网图

2. 配置步骤

# SwitchA的配置。

<SwitchA> system-view

[SwitchA] isis

[SwitchA-isis] network-entity 86.0001.0000.0000.0005.00

[SwitchA] interface vlan-interface 100

[SwitchA-Vlan-interface100] ip address 100.10.0.1 255.255.255.0

[SwitchA-Vlan-interface100] isis enable

[SwitchA] interface vlan-interface 101

[SwitchA-Vlan-interface101] ip address 100.0.0.1 255.255.255.0

[SwitchA-Vlan-interface101] isis enable

[SwitchA] interface vlan-interface 102

[SwitchA-Vlan-interface102] ip address 100.20.0.1 255.255.255.0

[SwitchA-Vlan-interface102] isis enable

# SwitchB的配置。

[SwitchB] isis

[SwitchB-isis] network-entity 86.0001.0000.0000.0006.00

[SwitchB] interface vlan-interface 101

[SwitchB-Vlan-interface101] ip address 200.10.0.1 255.255.255.0

[SwitchB-Vlan-interface101] isis enable

[SwitchB] interface vlan-interface 102

[SwitchB-Vlan-interface102] ip address 200.0.0.1 255.255.255.0

[SwitchB-Vlan-interface102] isis enable

[SwitchB] interface vlan-interface 100

[SwitchB-Vlan-interface100] ip address 100.10.0.2 255.255.255.0

[SwitchB-Vlan-interface100] isis enable

# SwitchC的配置。

[SwitchC] isis

[SwitchC-isis] network-entity 86.0001.0000.0000.0007.00

[SwitchC] interface vlan-interface 101

[SwitchC-Vlan-interface101] ip address 200.10.0.2 255.255.255.0

[SwitchC-Vlan-interface101] isis enable

[SwitchC] interface vlan-interface 100

[SwitchC-Vlan-interface100] ip address 200.20.0.1 255.255.255.0

[SwitchC-Vlan-interface100] isis enable

# SwitchD的配置。

[SwitchD] isis

[SwitchD-isis] network-entity 86.0001.0000.0000.0008.00

[SwitchD] interface vlan-interface 102

[SwitchD-Vlan-interface102] ip address 100.20.0.2 255.255.255.0

[SwitchD-Vlan-interface102] isis enable

[SwitchD] interface vlan-interface 100

[SwitchD-Vlan-interface100] ip address 100.30.0.1 255.255.255.0

[SwitchD-Vlan-interface100] isis enable

2.1.6  配置BGP联盟属性

1. 组网需求

(1)        需求分析

某用户拥有一个大型AS,AS中运行BGP协议。随着AS规模的增长,IBGP对等体数量激增,用于BGP通信的网络资源亦随之增加。用户希望不影响设备工作性能条件下,削减IBGP对等体数量,降低BGP对设备CPU和网络资源的消耗。

根据用户需求,选择应用BGP自治系统联盟属性实现用户需求。

(2)        网络规划

根据用户需求,设计如图2-6所示网络拓扑图。

设备

接口

IP地址

AS

Switch A

Vlan-int 10

172.68.10.1/24

100

 

Vlan-int 50

10.1.1.1/24

Switch B

Vlan-int 10

172.68.10.2/24

Switch C

Vlan-int 10

172.68.10.3/24

 

Vlan-int 20

172.68.1.1/24

 

Vlan-int 30

156.10.1.1/24

Switch D

Vlan-int 20

172.68.1.2/24

Switch E

Vlan-int 30

156.10.1.2/24

200

 

Vlan-int 40

8.1.1.1/24

图2-6 配置自治系统联盟的组网图

(3)        配置策略

l              将AS 100划分为三个子自治系统,分别为AS 1001,AS 1002,AS 1003;

l              AS 1001,AS 1002,AS 1003之间运行EBGP;

l              AS 1001,AS 1002,AS 1003内部建立全连接,运行IBGP;

l              AS 100,AS 200之间运行EBGP。

2. 配置步骤

# 配置Switch A。

<SwitchA> system-view

[SwitchA] bgp 1001

[SwitchA-bgp] network 10.1.1.0 255.255.255.0

[SwitchA-bgp] confederation id 100

[SwitchA-bgp] confederation peer-as 1002 1003

[SwitchA-bgp] group confed1002 external

[SwitchA-bgp] peer 172.68.10.2 group confed1002 as-number 1002

[SwitchA-bgp] group confed1003 external

[SwitchA-bgp] peer 172.68.10.3 group confed1003 as-number 1003

[SwitchA-bgp] quit

# 配置Switch B。

<SwitchB> system-view

[SwitchB] bgp 1002

[SwitchB-bgp] confederation id 100

[SwitchB-bgp] confederation peer-as 1001 1003

[SwitchB-bgp] group confed1001 external

[SwitchB-bgp] peer 172.68.10.1 group confed1001 as-number 1001

[SwitchB-bgp] group confed1003 external

[SwitchB-bgp] peer 172.68.10.3 group confed1003 as-number 1003

# 配置Switch C。

<SwitchC> system-view

[SwitchC] bgp 1003

[SwitchC-bgp] confederation id 100

[SwitchC-bgp] confederation peer-as 1001 1002

[SwitchC-bgp] group confed1001 external

[SwitchC-bgp] peer 172.68.10.1 group confed1001 as-number 1001

[SwitchC-bgp] group confed1002 external

[SwitchC-bgp] peer 172.68.10.2 group confed1002 as-number 1002

[SwitchC-bgp] group ebgp200 external

[SwitchC-bgp] peer 156.10.1.2 group ebgp200 as-number 200

[SwitchC-bgp] group ibgp1003 internal

[SwitchC-bgp] peer 172.68.1.2 group ibgp1003

# 配置Switch D。

<SwitchD> system-view

[SwitchD] bgp 1003

[SwitchD-bgp] confederation id 100

[SwitchD-bgp] group ibgp1003 internal

[SwitchD-bgp] peer 172.68.1.1 group ibgp1003

# 配置Switch E。

<SwitchE> system-view

[SwitchE] bgp 200

[SwitchE-bgp] network 8.1.1.0 255.255.255.0

[SwitchE-bgp] group ebgp100 external

[SwitchE-bgp] peer 156.10.1.1 group ebgp100 as-number 100

[SwitchE-bgp] quit

# 显示Switch E的BGP路由表。

[SwitchE] display bgp routing

 

Flags:  # - valid       ^ - active      I - internal

        D - damped      H - history     S - aggregate suppressed

 

    Dest/Mask          Next-Hop        Med        Local-pref Origin Path

--------------------------------------------------------------------------

#^  8.1.1.0/24         0.0.0.0         0          100         IGP

#^  10.1.1.0/24        156.10.1.1      0          100         IGP   100

 

  Routes total: 2

# 显示Switch A的BGP路由表。

[SwitchA] display bgp routing

 

Flags:  # - valid       ^ - active      I - internal

        D - damped      H - history     S - aggregate suppressed

 

    Dest/Mask       Next-Hop      Med      Local-pref  Origin  Path

--------------------------------------------------------------------------

  I 8.1.1.0/24      156.10.1.2    0        100         IGP     (1003) 200

#^  10.1.1.0/24     0.0.0.0       0        100         IGP

 

  Routes total: 2

根据显示信息可以看出,子自治系统信息仅在联盟内部通告。处于联盟外部的自治系统的设备(例如Switch E)将联盟作为一个自治系统,不能学习联盟内部的子自治系统信息。

2.1.7  配置BGP路由反射器

1. 组网需求

(1)        需求分析

某用户拥有一个大型AS,AS中运行BGP协议。随着AS规模的增长,IBGP对等体数量激增,用于BGP通信的网络资源亦随之增加。用户希望不影响设备工作性能条件下,削减IBGP对等体数量,降低BGP对设备CPU和网络资源的消耗。另外,该AS中,IBGP对等体之间连接采用部分互联。

根据用户需求和用户网络环境,选择BGP路由反射器方案满足用户需求。

(2)        网络规划

根据用户需求,设计如图2-7所示网络拓扑图。

设备

接口

IP地址

AS

Switch A

Vlan-int 100

1.1.1.1/8

100

 

Vlan-int 2

192.1.1.1/24

Switch B

Vlan-int 2

192.1.1.2/24

200

 

Vlan-int 3

193.1.1.2/24

Switch C

Vlan-int 3

193.1.1.1/24

 

Vlan-int 4

194.1.1.1/24

Switch D

Vlan-int 4

194.1.1.2/24

图2-7 配置BGP路由反射器的组网图

(3)        配置策略

l              AS 100与AS 200对等体之间运行EBGP,通告1.0.0.0/8网段;

l              AS 200中对等体之间运行IBGP,AS网络拓扑采用星型拓扑结构;中央设备作为路由反射器,其他设备作为客户机。

2. 配置步骤

(1)        配置Switch A

<SwitchA> system-view

[SwitchA] interface Vlan-interface 2

[SwitchA-Vlan-interface2] ip address 192.1.1.1 255.255.255.0

[SwitchA-Vlan-interface2] interface Vlan-interface 100

[SwitchA-Vlan-interface100] ip address 1.1.1.1 255.0.0.0

[SwitchA-Vlan-interface100] quit

[SwitchA] bgp 100

[SwitchA-bgp] group ex external

[SwitchA-bgp] peer 192.1.1.2 group ex as-number 200

[SwitchA-bgp] network 1.0.0.0 255.0.0.0

(2)        配置Switch B

# 配置VLAN接口的IP地址。

<SwitchB> system-view

[SwitchB] interface Vlan-interface 2

[SwitchB-Vlan-interface2] ip address 192.1.1.2 255.255.255.0

[SwitchB-Vlan-interface2] quit

[SwitchB] interface Vlan-interface 3

[SwitchB-Vlan-interface3] ip address 193.1.1.2 255.255.255.0

[SwitchB-Vlan-interface3] quit

# 配置BGP对等体。

[SwitchB] bgp 200

[SwitchB-bgp] group ex external

[SwitchB-bgp] peer 192.1.1.1 group ex as-number 100

[SwitchB-bgp] group in internal

[SwitchB-bgp] peer 193.1.1.1 group in

(3)        配置Switch C

# 配置VLAN接口的IP地址。

<SwitchC> system-view

[SwitchC] interface Vlan-interface 3

[SwitchC-Vlan-interface3] ip address 193.1.1.1 255.255.255.0

[SwitchC-Vlan-interface3] quit

[SwitchC] interface vlan-Interface 4

[SwitchC-Vlan-interface4] ip address 194.1.1.1 255.255.255.0

[SwitchC-Vlan-interface4] quit

# 配置BGP对等体及路由反射器。

[SwitchC] bgp 200

[SwitchC-bgp] group rr internal

[SwitchC-bgp] peer rr reflect-client

[SwitchC-bgp] peer 193.1.1.2 group rr

[SwitchC-bgp] peer 194.1.1.2 group rr

(4)        配置Switch D

# 配置VLAN接口的IP地址。

<SwitchD> system-view

[SwitchD] interface Vlan-interface 4

[SwitchD-Vlan-interface4] ip address 194.1.1.2 255.255.255.0

[SwitchD-Vlan-interface4] quit

# 配置BGP对等体。

[SwitchD] bgp 200

[SwitchD-bgp] group in internal

[SwitchD-bgp] peer 194.1.1.1 group in

在Switch B上用display bgp routing命令查看BGP路由表。注意:Switch B已知道了网络1.0.0.0的存在。

在Switch D上用display bgp routing命令查看BGP路由表。注意:Switch D也知道网络1.0.0.0的存在。

2.1.8  配置BGP路径选择

1. 组网需求

(1)        需求分析

某用户网络由两个AS组成,两个AS通过BGP实现网络互通,其中一个AS运行OSPF。

用户需求:控制从AS 200到AS 100的数据转发路径。

根据用户需求,可在如下方案中任选其一:

l              选择BGP的MED属性控制数据从AS 200到AS 100时的转发路径;

l              选择BGP的LOCAL_PREF属性控制数据从AS 200到AS 100时的转发路径。

(2)        网络规划

根据用户需求,设计如图2-8所示网络拓扑图。

设备

接口

IP地址

AS

Switch A

Vlan-int 101

1.1.1.1/8

100

 

Vlan-int 2

192.1.1.1/24

 

Vlan-int 3

193.1.1.1/24

Switch B

Vlan-int 2

192.1.1.2/24

200

 

Vlan-int 4

194.1.1.2/24

Switch C

Vlan-int 3

193.1.1.2/24

 

Vlan-int 5

195.1.1.2/24

Switch D

Vlan-int 4

194.1.1.1/24

 

Vlan-int 5

195.1.1.1/24

图2-8 配置BGP路径选择的组网图

(3)        配置策略

l              AS 100与AS 200对等体之间运行EBGP,通告1.0.0.0/8网段;

l              AS 200运行OSPF实现网络互通;

l              Switch D与Switch B,Switch D与 Switch C对等体之间运行IBGP;

l              在Switch A上应用路由策略,修改发布的路由信息MED属性,控制Switch D发出的数据进入AS 100时转发路径为:Switch D-Switch C-Switch A。

l              在Switch C上应用路由策略,修改发布路由信息的LOCAL_PREF属性,控制Switch D发出的数据进入AS 100时转发路径为:Switch D-Switch C-Switch A。

2. 配置步骤

(1)        配置Switch A

# 配置VLAN接口的IP地址

<SwitchA> system-view

[SwitchA] interface Vlan-interface 2

[SwitchA-Vlan-interface2] ip address 192.1.1.1 255.255.255.0

[SwitchA-Vlan-interface2] quit

[SwitchA] interface Vlan-interface 3

[SwitchA-Vlan-interface3] ip address 193.1.1.1 255.255.255.0

[SwitchA-Vlan-interface3] quit

[SwitchA] interface Vlan-interface 101

[SwitchA-Vlan-interface101] ip address 1.1.1.1 255.0.0.0

[SwitchA-Vlan-interface101] quit

# 启动BGP。

[SwitchA] bgp 100

# 通告1.0.0.0/8网段路由信息。

[SwitchA-bgp] network 1.0.0.0

# 配置对等体。

[SwitchA-bgp] group ex192 external

[SwitchA-bgp] peer 192.1.1.2 group ex192 as-number 200

[SwitchA-bgp] group ex193 external

[SwitchA-bgp] peer 193.1.1.2 group ex193 as-number 200

[SwitchA-bgp] quit

# 创建ACL 2000,允许目的地址为1.0.0.0/8的路由信息通过。

[SwitchA] acl number 2000

[SwitchA-acl-basic-2000] rule permit source 1.0.0.0 0.255.255.255

[SwitchA-acl-basic-2000] rule deny source any

[SwitchA-acl-basic-2000] quit

# 创建路由策略apply_med_50,匹配模式为允许,如果路由信息通过ACL 2000的过滤,则设置其MED值为50。

[SwitchA] route-policy apply_med_50 permit node 10

[SwitchA-route-policy] if-match acl 2000

[SwitchA-route-policy] apply cost 50

[SwitchA-route-policy] quit

# 创建路由策略apply_med_100,匹配模式为允许,如果路由信息通过ACL 2000的过滤,则设置其MED值为100。

[SwitchA] route-policy apply_med_100 permit node 10

[SwitchA-route-policy] if-match acl 2000

[SwitchA-route-policy] apply cost 100

[SwitchA-route-policy] quit

# 对发布给对等体组ex193(对等体193.1.1.2)的路由信息应用路由策略apply_med_50;对发布给对等体组ex192(对等体192.1.1.2)的路由信息应用路由策略apply_med_100。

[SwitchA] bgp 100

[SwitchA-bgp] peer ex193 route-policy apply_med_50 export

[SwitchA-bgp] peer ex192 route-policy apply_med_100 export

(2)        配置Switch B

# 配置VLAN接口IP地址。

<SwitchB> system-view

[SwitchB] interface vlan 2

[SwitchB-Vlan-interface2] ip address 192.1.1.2 255.255.255.0

[SwitchB-Vlan-interface2] quit

[SwitchB] interface Vlan-interface 4

[SwitchB-Vlan-interface4] ip address 194.1.1.2 255.255.255.0

[SwitchB-Vlan-interface4] quit

# 配置OSPF。

[SwitchB] ospf

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] network 194.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] network 192.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] quit

[SwitchB-ospf-1] quit

# 启动BGP,创建对等体组,并向对等体组添加对等体。

[SwitchB] bgp 200

[SwitchB-bgp] undo synchronization

[SwitchB-bgp] group ex external

[SwitchB-bgp] peer 192.1.1.1 group ex as-number 100

[SwitchB-bgp] group in internal

[SwitchB-bgp] peer 194.1.1.1 group in

[SwitchB-bgp] peer 195.1.1.2 group in

(3)        配置Switch C

# 配置VLAN接口IP地址。

<SwitchC> system-view

[SwitchC] interface Vlan-interface 3

[SwitchC-Vlan-interface3] ip address 193.1.1.2 255.255.255.0

[SwitchC-Vlan-interface3] quit

[SwitchC] interface Vlan-interface 5

[SwitchC-Vlan-interface5] ip address 195.1.1.2 255.255.255.0

[SwitchC-Vlan-interface5] quit

# 启动OSPF。

[SwitchC] ospf

[SwitchC-ospf-1] area 0

[SwitchC-ospf-1-area-0.0.0.0] network 193.1.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] network 195.1.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] quit

[SwitchC-ospf-1] quit

# 启动BGP,创建对等体组,并向对等体组添加对等体。

[SwitchC] bgp 200

[SwitchC-bgp] undo synchronization

[SwitchC-bgp] group ex external

[SwitchC-bgp] peer 193.1.1.1 group ex as-number 100

[SwitchC-bgp] group in internal

[SwitchC-bgp] peer 195.1.1.1 group in

[SwitchC-bgp] peer 194.1.1.2 group in

(4)        配置Switch D

# 配置VLAN接口IP地址。

<SwitchD> system-view

[SwitchD] interface Vlan-interface 4

[SwitchD-Vlan-interface4] ip address 194.1.1.1 255.255.255.0

[SwitchD-Vlan-interface4] quit

[SwitchD] interface Vlan-interface 5

[SwitchD-Vlan-interface5] ip address 195.1.1.1 255.255.255.0

[SwitchD-Vlan-interface5] quit

# 启动OSPF。

[SwitchD] ospf

[SwitchD-ospf-1] area 0

[SwitchD-ospf-1-area-0.0.0.0] network 194.1.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.0] network 195.1.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.0] network 4.0.0.0 0.255.255.255

[SwitchD-ospf-1-area-0.0.0.0] quit

[SwitchD-ospf-1] quit

# 启动BGP,创建对等体组,并向对等体组添加对等体。

[SwitchD] bgp 200

[SwitchD-bgp] undo synchronization

[SwitchD-bgp] group in internal

[SwitchD-bgp] peer 195.1.1.2 group in

[SwitchD-bgp] peer 194.1.1.2 group in

l              为使配置生效,所有的BGP邻居需要运行reset bgp all命令。

l              通过上述配置后,由于Switch C学到的路由1.0.0.0的MED属性比Switch B学到的更小,Switch D优选来自Switch C的路由1.0.0.0。

l              如果在配置Switch A时,不配置Switch A的MED属性,而在Switch C上配置本地优先级如下:

# 创建ACL 2000,允许目的地址为1.0.0.0/8的路由信息通过。

[SwitchC] acl number 2000

[SwitchC-acl-basic-2000] rule permit source 1.0.0.0 0.255.255.255

[SwitchC-acl-basic-2000] rule deny source any

[SwitchC-acl-basic-2000] quit

# 创建路由策略localpref,节点序号为10,匹配模式为允许,如果路由信息通过ACL 2000的过滤,则设置其本地优先级为200。

[SwitchC] route-policy localpref  permit node 10

[SwitchC-route-policy] if-match acl 2000

[SwitchC-route-policy] apply local-preference 200

[SwitchC-route-policy] quit

# 创建路由策略localpref,节点序号为20,匹配模式为允许,设置路由信息本地优先级值为100。

[SwitchC] route-policy localpref permit node 20

[SwitchC-route-policy] apply local-preference 100

[SwitchC-route-policy] quit

# 对从对等体193.1.1.1(Switch A)接收的路由信息应用路由策略localpref。

[SwitchC] bgp 200

[SwitchC-bgp] peer 193.1.1.1 route-policy localpref import

此时,由于Switch C学到的路由1.0.0.0的LOCAL_PREF属性值为200,比Switch B学到的路由1.0.0.0的LOCAL_PREF属性值(Switch B没有配置LOCAL_PREF属性,默认为100)更大,Switch D依然优选来自Switch C的路由1.0.0.0。

 


第3章  综合配置举例

&  说明:

l      路由协议介绍请参见各产品操作手册;

l      配置中使用的命令请参见各产品命令手册;

l      本配置举例主要以S3600、S5600、S7500系列交换机为例,其他产品请参照使用。

 

3.1  组网需求

3.1.1  需求分析、网络规划及配置策略

1. 需求分析

某大型ISP运营商,拥有4个自治系统,分别是AS 100、AS 200、AS 300、AS 400。AS 100为核心层,连接AS 200、AS 300、AS 400,转发他们之间的数据。AS 200、AS 300、AS 400为分布层,对接入用户提供接入服务。具体需求如下:

l              AS 200、AS 400两个自治系统的网络拓扑比较复杂,网络规模较大,需要网络快速收敛。

l              AS 300自治系统网络拓扑简单,网络规模较小,网络中的设备仅支持RIP路由协议,而且设备的性能较低,路由表容量有限。

l              AS 200的接入用户需要高可靠性的网络。

l              AS 200AS 300AS 400中接入用户需要相互访问。

l              AS 200中S200_10下挂设备为二层设备。

l              AS 300中S300_B下挂设备为二层设备。

l              AS 400接入用户访问AS 200、AS 300时需要控制数据的转发路径。

l              AS 300接入用户只有单出口与ISP互连。

2. 网络规划

根据需求,设计如图3-1所示网络拓扑图。

图3-1 配置组网图

3. 配置策略

l              AS 100选择BGP,提供AS 200AS 300AS 400之间的互连。选择BGPMED属性控制数据的转发路径。

l              AS 200选择OSPFAS 200AS 100互连设备同时运行OSPFBGP。选择静态路由作为备份路由,实现链路冗余,提高网络可靠性。引入BGP路由时应用路由策略,控制引入的路由信息。

l              AS 400选择OSPFAS 400AS 100互连设备同时运行OSPFBGP。引入BGP路由时应用路由策略,控制引入的路由信息。

l              AS 300选择RIPv2AS 300AS 100互连设备同时运行RIPv2BGP。引入BGP路由时应用路由策略,控制引入的路由信息。

l              AS 300用户使用静态路由、RIP、路由策略相结合的方式接入ISP

l              配置过程中涉及到了IGPBGP的交互,由于BGP的缺省优先级为256,当路由表中存在备份路由时,便于按需选择主路由,需要修改BGP优先级为适合的值。

3.1.2  组网中使用的产品

表3-1 产品型号与设备名称对应表

产品型号

设备名称

7500

S100_1/S100_2

5600

S200/S300/S400

3600

S200_0/S200_10/S300_A/S300_B/ S400_0

 

说明:

l      在本配置中,S100_1/S100_2/S400/S200/S300既可以选择S7500系列以太网交换机,也可以选择S5600系列以太网交换机。

l      S300_B可以使用其它弱三层特性交换机替代。

 

3.1.3  设备运行的路由协议及相关参数

表3-2 设备与运行的路由协议对应表

设备名称

路由协议

Router ID

AS

S100_1

BGP(IBGP&EBGP)

1.1.1.1

100

S100_2

BGP(IBGP&EBGP)

1.2.1.1

S200

BGP(EBGP)/OSPF

2.1.1.1

200

S200_0

OSPF

-

S200_10

OSPF/STATIC

S300

BGP(EBGP)/RIPv2

3.1.1.1

300

S300_A

RIPv2/STATIC

-

S300_B

RIPv2

S400

BGP(EBGP)/OSPF

4.1.1.1

400

S400_0

OSPF

-

 

3.1.4  组网实现时使用的软件版本

S3600系列使用的软件版本Release 1510。

S5600系列使用的软件版本Release 1510。

S7500系列使用的软件版本Release 3135。

3.2  配置步骤

3.2.1  配置指南

表3-3 配置指南

配置任务

说明

详细配置

基本配置

创建VLAN,配置VLAN接口IP地址

3.2.2 

RIPv2/OSPF/BGP基本配置

RIPv2、OSPF、BGP基本配置

3.2.3 

RIP+静态路由+路由策略

RIP与路由策略结合,只发布不接收路由更新信息,通过静态路由实现对ISP的访问

3.2.4 

IGP与BGP交互

IGP与BGP共享路由信息,当IGP引入BGP路由信息时,应用路由策略,按需引入路由信息

3.2.5 

路由备份配置

为了提高接入用户的网络可靠性,接入的主链路运行OSPF,备份链路选择静态路由,实现网络互连

3.2.6 

BGP的MED属性配置

应用路由策略,修改BGP的MED属性值,控制数据报文转发路径

3.2.7 

 

3.2.2  基本配置

创建VLAN,配置VLAN接口IP地址,配置步骤略,请参见完整配置部分。

3.2.3  RIPv2/OSPF/BGP基本配置

1. RIPv2基本配置

AS 300局部组网图如图3-2所示

设备

接口

IP地址

S300

Vlan-int 14

206.1.4.2/24

S300_A

Vlan-int 14

206.1.4.1/24

 

Vlan-int 662

166.1.2.1/24

 

Vlan-int 665

166.1.5.2/24

S300_B

Vlan-int 662

166.1.2.2/24

 

Vlan-int 623

162.1.3.1/24

 

Vlan-int 624

162.1.4.1/24

图3-2 AS 300局部组网图

l              配置S300

# 配置网络地址为206.1.4.0的接口运行RIP。

<S300> system-view

[S300] rip

[S300-rip] network 206.1.4.0

# 关闭RIPv2的路由聚合功能。

[S300-rip] undo summary

[S300-rip] quit

# 配置接口Vlan-interface 14运行RIPv2。

[S300] interface vlan-interface 14

[S300-Vlan-interface14] rip version 2

[S300-Vlan-interface14] quit

l              配置S300_A

# 配置网络地址为206.1.4.0、166.1.0.0的接口运行RIP。

<S300_A> system-view

[S300_A] rip

[S300_A-rip] network 206.1.4.0

[S300_A-rip] network 166.1.0.0

# 关闭RIPv2的路由聚合功能。

[S300_A-rip] undo summary

[S300_A-rip] quit

# 配置接口Vlan-interface 14、Vlan-interface 662运行RIPv2。

[S300_A] interface vlan-interface 14

[S300_A-Vlan-interface14] rip version 2

[S300_A-Vlan-interface14] quit

[S300_A] interface vlan-interface 662

[S300_A-Vlan-interface662] rip version 2

[S300_A-Vlan-interface662] quit

l              配置S300_B

# 配置网络地址为162.1.0.0、166.1.0.0的接口运行RIP。

<S300_B> system-view

[S300_B] rip

[S300_B-rip] network 162.1.0.0

[S300_B-rip] network 166.1.0.0

# 关闭RIPv2的路由聚合功能。

[S300_B-rip] undo summary

[S300_B-rip] quit

# 配置接口Vlan-interface 623、Vlan-interface 624、Vlan-interface 662运行RIPv2。

[S300_B] interface vlan-interface 623

[S300_B-Vlan-interface623] rip version 2

[S300_B-Vlan-interface623] quit

[S300_B] interface vlan-interface 624

[S300_B-Vlan-interface624] rip version 2

[S300_B-Vlan-interface624] quit

[S300_B] interface vlan-interface 662

[S300_B-Vlan-interface662] rip version 2

[S300_B-Vlan-interface662] quit

2. OSPF基本配置

AS 200局部组网图如图3-3所示:

设备

接口

IP地址

Area

S200

Vlan-int 12

206.1.2.3/24

0

S200_0

Vlan-int 12

206.1.2.1/24

0

 

Vlan-int 661

166.1.1.1/24

10

S200_10

Vlan-int 661

166.1.1.2/24

10

 

Vlan-int 621

162.1.1.1/24

10

 

Vlan-int 622

162.1.2.1/24

10

图3-3 AS 200局部组网图

l              配置S200

# 指定运行OSPF协议的接口IP地址位于网段206.1.2.0/24,接口所在的OSPF区域ID为0。

<S200> system-view

[S200] ospf

[S200-ospf-1] area 0

[S200-ospf-1-area-0.0.0.0] network 206.1.2.0 0.0.0.255

l              配置S200_0

# 指定运行OSPF协议的接口IP地址位于网段206.1.2.0/24,接口所在的OSPF区域ID为0。

<S200_0> system-view

[S200_0] ospf

[S200_0-ospf-1] area 0

[S200_0-ospf-1-area-0.0.0.0] network 206.1.2.0 0.0.0.255

[S200_0-ospf-1-area-0.0.0.0] quit

# 指定运行OSPF协议的接口IP地址位于网段166.1.1.0/24,接口所在的OSPF区域ID为10。

[S200_0-ospf-1] area 10

[S200_0-ospf-1-area-0.0.0.10] network 166.1.1.0 0.0.0.255

l              配置S200_10

# 指定运行OSPF协议的接口IP地址位于网段162.1.1.0/24、162.1.2.0/24、166.1.1.0/24,接口所在的OSPF区域ID为10。

<S200_10> system-view

[S200_10] ospf

[S200_10-ospf-1] area 10

[S200_10-ospf-1-area-0.0.0.10] network 162.1.1.0 0.0.0.255

[S200_10-ospf-1-area-0.0.0.10] network 162.1.2.0 0.0.0.255

[S200_10-ospf-1-area-0.0.0.10] network 166.1.1.0 0.0.0.255

AS 400局部组网图如图3-4所示:

设备

接口

IP地址

Area

S400

Vlan-int 16

206.1.6.3/24

0

S400_0

Vlan-int 16

206.1.6.1/24

0

 

Vlan-int 663

166.1.3.1/24

0.0.1.44

 

Vlan-int 664

166.1.4.1/24

0.0.1.44

图3-4 AS 400局部组网图

l              配置S400

# 指定运行OSPF协议的接口IP地址位于网段206.1.6.0/24,接口所在的OSPF区域ID为0。

<S400> system-view

[S400] ospf

[S400-ospf-1] area 0

[S400-ospf-1-area-0.0.0.0] network 206.1.6.0 0.0.0.255

l              配置S400_0

# 指定运行OSPF协议的接口IP地址位于网段206.1.6.0/24,接口所在的OSPF区域ID为0。

<S400_0> system-view

[S400_0] ospf

[S400_0-ospf-1] area 0

[S400_0-ospf-1-area-0.0.0.0] network 206.1.6.0 0.0.0.255

[S400_0-ospf-1-area-0.0.0.0] quit

# 指定运行OSPF协议的接口IP地址位于网段166.1.3.0/24、166.1.4.0/24,接口所在的OSPF区域ID为0.0.1.44。

[S400_0-ospf-1] area 0.0.1.44

[S400_0-ospf-1-area-0.0.1.44] network 166.1.3.0 0.0.0.255

[S400_0-ospf-1-area-0.0.1.44] network 166.1.4.0 0.0.0.255

3. BGP基本配置

局部组网图如图3-5所示:

设备

接口

IP地址

Router ID

AS

S100_1

Vlan-int 11

196.1.1.1/24

1.1.1.1

100

 

Vlan-int 15

196.1.3.1/24

 

 

Vlan-int 31

196.3.1.1/24

 

S100_2

Vlan-int 22

196.2.2.1/24

1.2.1.1

 

Vlan-int 23

196.2.3.2/24

 

 

Vlan-int 31

196.3.1.2/24

 

S200

Vlan-int 11

196.1.1.3/24

2.1.1.1

200

 

Vlan-int 13

206.1.3.3/24

 

S300

Vlan-int 22

196.2.2.2/24

3.1.1.1

300

 

Vlan-int 13

206.1.3.2/24

 

S400

Vlan-int 15

196.1.3.3/24

4.1.1.1

400

 

Vlan-int 23

196.2.3.3/24

 

图3-5 局部组网图

l              配置S100_1

# 配置S100_1Router ID 1.1.1.1

<S100_1> system-view

[S100_1] router id 1.1.1.1

# 启动BGP,本地AS号为100。

[S100_1] bgp 100

# 创建IBGP对等体组100;创建EBGP对等体组200、400。

[S100_1-bgp] group 100 internal

[S100_1-bgp] group 200 external

[S100_1-bgp] group 400 external

# 将IP地址为196.3.1.2对等体加入到对等体组100中,AS号为100;IP地址为196.1.1.3对等体加入到对等体组200中,AS号为200;;IP地址为196.1.3.3对等体加入到对等体组400中,AS号为400。

[S100_1-bgp] peer 196.3.1.2 group 100

[S100_1-bgp] peer 196.1.1.3 group 200 as-number 200

[S100_1-bgp] peer 196.1.3.3 group 400 as-number 400

# 通告到达196.1.3.0、196.3.1.0、196.1.1.0网段的路由。

[S100_1-bgp] network 196.1.3.0

[S100_1-bgp] network 196.3.1.0

[S100_1-bgp] network 196.1.1.0

# 配置EBGP、IBGP和本地生成路由的优先级都为200。

[S100_1-bgp] preference 200 200 200

l              配置S100_2

# 配置S100_2Router ID 1.2.1.1

<S100_2> system-view

[S100_2] router id 1.2.1.1

# 启动BGP,本地AS号为100。

[S100_2] bgp 100

# 创建IBGP对等体组100;创建EBGP对等体组300、400。

[S100_2-bgp] group 100 internal

[S100_2-bgp] group 300 external

[S100_2-bgp] group 400 external

# 将IP地址为196.3.1.1对等体加入到对等体组100中,AS号为100;IP地址为196.2.2.2对等体加入到对等体组300中,AS号为300;;IP地址为196.2.3.3对等体加入到对等体组400中,AS号为400。

[S100_2-bgp] peer 196.3.1.1 group 100

[S100_2-bgp] peer 196.2.2.2 group 300 as-number 300

[S100_2-bgp] peer 196.2.3.3 group 400 as-number 400

# 通告到达196.2.2.0、196.2.3.0、196.3.1.0网段的路由。

[S100_2-bgp] network 196.2.2.0

[S100_2-bgp] network 196.2.3.0

[S100_2-bgp] network 196.3.1.0

# 配置EBGP、IBGP和本地生成路由的优先级都为200。

[S100_2-bgp] preference 200 200 200

l              配置S200

# 配置S200Router ID 2.1.1.1

<S200> system-view

[S200] router id 2.1.1.1

# 启动BGP,本地AS号为200。

[S200] bgp 200

# 创建EBGP对等体组100、300。

[S200-bgp] group 100 external

[S200-bgp] group 300 external

# 将IP地址为196.1.1.1对等体加入到对等体组100中,AS号为100;IP地址为206.1.3.2对等体加入到对等体组300中,AS号为300。

[S200-bgp] peer 196.1.1.1 group 100 as-number 100

[S200-bgp] peer 206.1.3.2 group 300 as-number 300

# 通告到达192.1.1.0、206.1.3.0网段的路由。

[S200-bgp] network 192.1.1.0

[S200-bgp] network 206.1.3.0

# 配置EBGP、IBGP和本地生成路由的优先级都为200。

[S200-bgp] preference 200 200 200

l              配置S300

# 配置S300Router ID 3.1.1.1

<S300> system-view

[S300] router id 3.1.1.1

# 启动BGP,本地AS号为300。

[S300] bgp 300

# 创建EBGP对等体组100、200。

[S300-bgp] group 100 external

[S300-bgp] group 200 external

# 将IP地址为196.2.2.1对等体加入到对等体组100中,AS号为100;IP地址为206.1.3.3对等体加入到对等体组200中,AS号为200。

[S300-bgp] peer 196.2.2.1 group 100 as-number 100

[S300-bgp] peer 206.1.3.3 group 200 as-number 200

# 通告到达206.1.3.0、196.2.2.0网段的路由。

[S300-bgp] network 206.1.3.0

[S300-bgp] network 196.2.2.0

# 配置EBGP、IBGP和本地生成路由的优先级都为200。

[S300-bgp] preference 200 200 200

l              配置S400

# 配置S400Router ID为4.1.1.1。

<S400> system-view

[S400] router id 4.1.1.1

# 启动BGP,本地AS号为400。

[S400] bgp 400

# 创建EBGP对等体组100_1、100_2。

[S400-bgp] group 100_1 external

[S400-bgp] group 100_2 external

# 将IP地址为196.1.3.1对等体加入到对等体组100_1中,IP地址为196.2.3.2对等体加入到对等体组100_2中,AS号都为100。

[S400-bgp] peer 196.1.3.1 group 100_1 as-number 100

[S400-bgp] peer 196.2.3.2 group 100_2 as-number 100

# 通告到达196.1.3.0、196.2.3.0网段的路由。

[S400-bgp] network 196.1.3.0

[S400-bgp] network 196.2.3.0

# 配置EBGP、IBGP和本地生成路由的优先级都为200。

[S400-bgp] preference 200 200 200

3.2.4  RIP+静态路由+路由策略配置

1. 组网需求

图3-6所示,S300_A/S300_B运行RIPv2。为了控制S300_B通过RIP学习到的路由数量,允许S300_B向S300_A发布路由信息,禁止S300_B接收S300_A发布的路由信息。S300_B到S300_A的报文转发通过缺省路由实现。

2. 组网图

设备

接口

IP地址

S300_A

Vlan-int 662

166.1.2.1/24

S300_B

Vlan-int 662

166.1.2.2/24

 

Vlan-int 623

162.1.3.1/24

 

Vlan-int 624

162.1.4.1/24

图3-6 RIP+静态路由+路由策略配置组网图

3. 配置步骤

# 创建编号为2000的ACL,拒绝所有的报文。

<S300_B> system-view

[S300_B]acl number 2000

[S300_B-acl-basic-2000] rule deny source any

[S300_B-acl-basic-2000] quit

# 在RIP进程中,对接收的路由信息应用ACL 2000。

[S300_B] rip

[S300_B-rip] filter-policy 2000 import

# 配置缺省路由,下一跳IP地址为166.1.2.1。

[S300_B] ip route-static 0.0.0.0 0.0.0.0 166.1.2.1 preference 60

3.2.5  IGP与BGP交互配置

1. 组网需求

图3-7所示,S400/S200上运行OSPF和BGP,S300上运行RIPv2和BGP。为了保证各个AS的设备学习到其它AS的网络拓扑,配置IGP与BGP交互,共享路由信息。在IGP引入BGP的过程中,应用路由策略,仅引入前缀IP地址为如下的路由:162.1.1.0/24、162.1.2.0/24、162.1.3.0/24、162.1.4.0/24、166.1.3.0/24、166.1.4.0/24。

2. 组网图

图3-7 IGP与BGP交互配置组网图

3. 配置步骤

l              在S200上配置IGP与BGP交互

# BGP引入OSPF

<S200> system-view

[S200] bgp 200

[S200-bgp] import-route ospf 1

[S200-bgp] quit

# 定义前缀列表ospf_import,允许前缀IP地址为162.1.3.0/24、162.1.4.0/24、166.1.3.0/24、166.1.4.0/24的路由信息通过。

[S200] ip ip-prefix ospf_import index 10 permit 162.1.3.0 24

[S200] ip ip-prefix ospf_import index 20 permit 162.1.4.0 24

[S200] ip ip-prefix ospf_import index 30 permit 166.1.4.0 24

[S200] ip ip-prefix ospf_import index 40 permit 166.1.3.0 24

# 创建路由策略ospf_import,匹配模式为允许,定义if-match子句,允许路由目的地址与前缀列表ospf_import匹配的路由信息通过。

[S200] route-policy ospf_import permit node 10

[S200-route-policy] if-match ip-prefix ospf_import

[S200-route-policy] quit

# OSPF引入BGP,应用路由策略ospf_import。

[S200] ospf

[S200-ospf-1] import-route bgp route-policy ospf_import

l              在S300上配置IGP与BGP交互

# BGP引入RIP。

<S300> system-view

[S300] bgp 300

[S300-bgp] import-route rip

[S300-bgp] quit

# 定义前缀列表rip_import,允许前缀IP地址为162.1.1.0/24、162.1.2.0/24、166.1.3.0/24、166.1.4.0/24的路由信息通过。

[S300] ip ip-prefix rip_import index 10 permit 162.1.1.0 24

[S300] ip ip-prefix rip_import index 20 permit 162.1.2.0 24

[S300] ip ip-prefix rip_import index 30 permit 166.1.3.0 24

[S300] ip ip-prefix rip_import index 40 permit 166.1.4.0 24

# 创建路由策略rip_import,匹配模式为允许,定义if-match子句,允许路由目的地址与前缀列表rip_import匹配的路由信息通过。

[S300] route-policy rip_import permit node 10

[S300-route-policy] if-match ip-prefix rip_import

[S300-route-policy] quit

# RIP引入BGP,应用路由策略rip_import。

[S300] rip

[S300-rip] import-route bgp route-policy rip_import

l              在S400上配置IGP与BGP交互

# BGP引入OSPF。

<S400> system-view

[S400] bgp 400

[S400-bgp] import-route ospf 1

[S400-bgp] quit

# 定义前缀列表ospf_import,允许前缀IP地址为162.1.1.0/24、162.1.2.0/24、162.1.3.0/24、162.1.4.0/24的路由信息通过。

[S400] ip ip-prefix ospf_import index 10 permit 162.1.1.0 24

[S400] ip ip-prefix ospf_import index 20 permit 162.1.2.0 24

[S400] ip ip-prefix ospf_import index 30 permit 162.1.3.0 24

[S400] ip ip-prefix ospf_import index 40 permit 162.1.4.0 24

# 创建路由策略ospf_import,匹配模式为允许,定义if-match子句,允许路由目的地址与前缀列表ospf_import匹配的路由信息通过。

[S400] route-policy ospf_import permit node 10

[S400-route-policy] if-match ip-prefix ospf_import

[S400-route-policy] quit

# OSPF引入BGP,应用路由策略ospf_import。

[S400] ospf

[S400-ospf-1] import-route bgp route-policy ospf_import

3.2.6  路由备份配置

1. 组网需求

图3-8所示,S200_10上实现路由备份。S200_10与S200_0之间运行OSPF,该路由为主路由,S200_10与S300_A之间配置缺省路由,该路由为备份路由。当S200_10的主路由无法工作时,自动切换为备份路由。当主路由恢复正常时,自动从备份路由切换到主路由。配合S200_10实现备份路由,在S300_A上配置静态路由,将该静态路由引入到RIPv2。

2. 组网图

设备

接口

IP地址

AS

S300_A

Vlan-int 665

166.1.5.2/24

300

S200_10

Vlan-int 665

166.1.5.1/24

200

 

Vlan-int 621

162.1.1.1/24

 

Vlan-int 622

162.1.2.1/24

图3-8 路由备份配置组网图

3. 配置步骤

# 在S200_10上配置静态缺省路由,下一跳IP地址为166.1.5.2,缺省优先级为200。

<S200_10> system-view

[S200_10] ip route-static 0.0.0.0 0.0.0.0 166.1.5.2 preference 200

# 在S300_A上配置静态路由,目的地址为162.1.1.0/24、162.1.2.0/24,下一跳IP地址为166.1.5.1,缺省优先级为200。

<S300_A> system-view

[S300_A] ip route-static 162.1.1.0 255.255.255.0 166.1.5.1 preference 200

[S300_A] ip route-static 162.1.2.0 255.255.255.0 166.1.5.1 preference 200

# 在RIP进程中引入静态路由。

[S300_A] rip

[S300_A-rip] import-route static

3.2.7  BGP的MED属性配置

1. 组网需求

图3-9所示,从S400到S200_10的报文由S100_1转发,从S400到S300_B的报文由S100_2转发,通过修改BGP属性中的MED值实现该目标。

2. 组网图

设备

接口

IP地址

AS

S200_10

Vlan-int 621

162.1.1.1/24

200

 

Vlan-int 622

162.1.2.1/24

S300_B

Vlan-int 623

162.1.3.1/24

300

 

Vlan-int 624

162.1.4.1/24

S400_0

Vlan-int 663

166.1.3.1/24

400

 

Vlan-int 664

166.1.4.1/24

图3-9 BGP的MED属性配置组网图

3. 配置步骤

l              S100_1的配置

# 定义前缀列表as200_1,允许前缀IP地址为162.1.1.0/24的路由信息通过。

<S100_1> system-view

[S100_1] ip ip-prefix as200_1 index 10 permit 162.1.1.0 24

# 定义前缀列表as200_2,允许前缀IP地址为162.1.2.0/24的路由信息通过。

[S100_1] ip ip-prefix as200_2 index 10 permit 162.1.2.0 24

# 定义前缀列表as300_1,允许前缀IP地址为162.1.3.0/24的路由信息通过。

[S100_1] ip ip-prefix as300_1 index 10 permit 162.1.3.0 24

# 定义前缀列表as300_2,允许前缀IP地址为162.1.4.0/24的路由信息通过。

[S100_1] ip ip-prefix as300_2 index 10 permit 162.1.4.0 24

# 定义前缀列表other,允许所有的路由信息通过。

[S100_1] ip ip-prefix other index 10 permit 0.0.0.0 0 less-equal 32

# 创建路由策略as200,节点序号为10,匹配模式为允许。如果路由信息通过前缀列表as200_1过滤,则设置其MED值为100。

[S100_1] route-policy as200 permit node 10

[S100_1-route-policy] if-match ip-prefix as200_1

[S100_1-route-policy] apply cost 100

[S100_1-route-policy] quit

# 创建路由策略as200,节点序号为20,匹配模式为允许。如果路由信息通过前缀列表as200_2过滤,则设置其MED值为100。

[S100_1] route-policy as200 permit node 20

[S100_1-route-policy] if-match ip-prefix as200_2

[S100_1-route-policy] apply cost 100

[S100_1-route-policy] quit

# 创建路由策略as200,节点序号为30,匹配模式为允许。如果路由信息通过前缀列表as300_1过滤,则设置其MED值为200。

[S100_1] route-policy as200 permit node 30

[S100_1-route-policy] if-match ip-prefix as300_1

[S100_1-route-policy] apply cost 200

[S100_1-route-policy] quit

# 创建路由策略as200,节点序号为40,匹配模式为允许。如果路由信息通过前缀列表as300_2过滤,则设置其MED值为200。

[S100_1] route-policy as200 permit node 40

[S100_1-route-policy] if-match ip-prefix as300_2

[S100_1-route-policy] apply cost 200

[S100_1-route-policy] quit

# 创建路由策略as200,节点序号为50,匹配模式为允许,允许所有的路由信息通过。

[S100_1] route-policy as200 permit node 50

[S100_1-route-policy] if-match ip-prefix other

[S100_1-route-policy] quit

# 对发布给对等体组400(实质上是发布给对等体196.1.3.3)的路由信息应用路由策略as200。

[S100_1] bgp 100

[S100_1-bgp] peer 400 route-policy as200 export

l              S100_2的配置

# 定义前缀列表as200_1,允许前缀IP地址为162.1.1.0/24的路由信息通过。

<S100_2> system-view

[S100_2] ip ip-prefix as200_1 index 10 permit 162.1.1.0 24

# 定义前缀列表as200_2,允许前缀IP地址为162.1.2.0/24的路由信息通过。

[S100_2] ip ip-prefix as200_2 index 10 permit 162.1.2.0 24

# 定义前缀列表as300_1,允许前缀IP地址为162.1.3.0/24的路由信息通过。

[S100_2] ip ip-prefix as300_1 index 10 permit 162.1.3.0 24

# 定义前缀列表as300_2,允许前缀IP地址为162.1.4.0/24的路由信息通过。

[S100_2] ip ip-prefix as300_2 index 10 permit 162.1.4.0 24

# 定义前缀列表other,允许所有的路由信息通过。

[S100_2] ip ip-prefix other index 10 permit 0.0.0.0 0 less-equal 32

# 创建路由策略as300,节点序号为10,匹配模式为允许。如果路由信息通过前缀列表as200_1过滤,则设置其MED值为200。

[S100_2] route-policy as300 permit node 10

[S100_2-route-policy] if-match ip-prefix as200_1

[S100_2-route-policy] apply cost 200

[S100_2-route-policy] quit

# 创建路由策略as300,节点序号为20,匹配模式为允许。如果路由信息通过前缀列表as200_2过滤,则设置其MED值为200。

[S100_2] route-policy as300 permit node 20

[S100_2-route-policy] if-match ip-prefix as200_2

[S100_2-route-policy] apply cost 200

[S100_2-route-policy] quit

# 创建路由策略as300,节点序号为30,匹配模式为允许。如果路由信息通过前缀列表as300_1过滤,则设置其MED值为100。

[S100_2] route-policy as300 permit node 30

[S100_2-route-policy] if-match ip-prefix as300_1

[S100_2-route-policy] apply cost 100

[S100_2-route-policy] quit

# 创建路由策略as300,节点序号为40,匹配模式为允许。如果路由信息通过前缀列表as300_2过滤,则设置其MED值为100。

[S100_2] route-policy as300 permit node 40

[S100_2-route-policy] if-match ip-prefix as300_2

[S100_2-route-policy] apply cost 100

[S100_2-route-policy] quit

# 创建路由策略as300,节点序号为50,匹配模式为允许,允许所有的路由信息通过。

[S100_2] route-policy as300 permit node 50

[S100_2-route-policy] if-match ip-prefix other

[S100_2-route-policy] quit

# 对发布给对等体组400(实质上是发布给对等体196.2.3.3)的路由信息应用路由策略as300。

[S100_2] bgp 100

[S100_2-bgp] peer 400 route-policy as300 export

3.3  完整配置

3.3.1  设备完整配置

1. S100_1

<S100_1> display current-configuration

#

 sysname S100_1

#

 router id 1.1.1.1

#

……

#

vlan 11

#

vlan 15

#

vlan 31

#

interface Vlan-interface11

 ip address 196.1.1.1 255.255.255.0

#

interface Vlan-interface15

 ip address 196.1.3.1 255.255.255.0

#

interface Vlan-interface31

 ip address 196.3.1.1 255.255.255.0

#

……

#

bgp 100

 network 196.1.3.0

 network 196.3.1.0

 network 196.1.1.0

 undo synchronization

 group 100 internal

 peer 196.3.1.2 group 100

 group 200 external

 peer 196.1.1.3 group 200 as-number 200

 group 400 external

 peer 400 route-policy as200 export

 peer 196.1.3.3 group 400 as-number 400

 preference 200 200 200

#

route-policy as200 permit node 10

 if-match ip-prefix as200_1

 apply cost 100

route-policy as200 permit node 20

 if-match ip-prefix as200_2

 apply cost 100

route-policy as200 permit node 30

 if-match ip-prefix as300_1

 apply cost 200

route-policy as200 permit node 40

 if-match ip-prefix as300_2

 apply cost 200

route-policy as200 permit node 50

 if-match ip-prefix other

#

 ip ip-prefix as200_1 index 10 permit 162.1.1.0 24

 ip ip-prefix as200_2 index 10 permit 162.1.2.0 24

 ip ip-prefix as300_1 index 10 permit 162.1.3.0 24

 ip ip-prefix as300_2 index 10 permit 162.1.4.0 24

 ip ip-prefix other index 10 permit 0.0.0.0 0 less-equal 32

#

2. S100_2

<S100_2> display current-configuration

#

 sysname S100_2

#

 router id 1.2.1.1

#

……

#

vlan 22

#

vlan 23

#

vlan 31

#

interface Vlan-interface22

 ip address 196.2.2.1 255.255.255.0

#

interface Vlan-interface23

 ip address 196.2.3.2 255.255.255.0

#

interface Vlan-interface31

 ip address 196.3.1.2 255.255.255.0

#

……

#

bgp 100

 network 196.2.2.0

 network 196.2.3.0

 network 196.3.1.0

 undo synchronization

 group 100 internal

 peer 196.3.1.1 group 100

 group 300 external

 peer 196.2.2.2 group 300 as-number 300

 group 400 external

 peer 400 route-policy as300 export

 peer 196.2.3.3 group 400 as-number 400

 preference 200 200 200

#

route-policy as300 permit node 10

 if-match ip-prefix as200_1

 apply cost 200

route-policy as300 permit node 20

 if-match ip-prefix as200_2

 apply cost 200

route-policy as300 permit node 30

 if-match ip-prefix as300_1

 apply cost 100

route-policy as300 permit node 40

 if-match ip-prefix as300_2

 apply cost 100

route-policy as300 permit node 50

 if-match ip-prefix other

#

 ip ip-prefix as200_1 index 10 permit 162.1.1.0 24

 ip ip-prefix as200_2 index 10 permit 162.1.2.0 24

 ip ip-prefix as300_1 index 10 permit 162.1.3.0 24

 ip ip-prefix as300_2 index 10 permit 162.1.4.0 24

 ip ip-prefix other index 10 permit 0.0.0.0 0 less-equal 32

#

……

3. S200

<S200> display current-configuration

#

 sysname S200

#

……

#

 router id 2.1.1.1

#

……

#

vlan 11

#

vlan 12

#

vlan 13

#

interface Vlan-interface11

 ip address 196.1.1.3 255.255.255.0

#

interface Vlan-interface12

 ip address 206.1.2.3 255.255.255.0

#

interface Vlan-interface13

 ip address 206.1.3.3 255.255.255.0

#

……

#

 undo fabric-port Cascade1/2/1 enable

 undo fabric-port Cascade1/2/2 enable

#

interface NULL0

#

bgp 200

 network 192.1.1.0

 network 206.1.3.0

 import-route ospf 1

 undo synchronization

 group 100 external

 peer 196.1.1.1 group 100 as-number 100

 group 300 external

 peer 206.1.3.2 group 300 as-number 300

 preference 200 200 200

#

ospf 1

 import-route bgp route-policy ospf_import

 area 0.0.0.0

  network 206.1.2.0 0.0.0.255

#

route-policy ospf_import permit node 10

 if-match ip-prefix ospf_import

#

 ip ip-prefix ospf_import index 10 permit 162.1.3.0 24

 ip ip-prefix ospf_import index 20 permit 162.1.4.0 24

 ip ip-prefix ospf_import index 30 permit 166.1.4.0 24

 ip ip-prefix ospf_import index 40 permit 166.1.3.0 24

#

……

4. S200_0

<S200_0> display current-configuration

#

 sysname S200_0

#

……

#

vlan 12

#

vlan 661

#

interface Vlan-interface12

 ip address 206.1.2.1 255.255.255.0

#

interface Vlan-interface661

 ip address 166.1.1.1 255.255.255.0

#

……

#

ospf 1

 area 0.0.0.10

  network 166.1.1.0 0.0.0.255

 #

 area 0.0.0.0

  network 206.1.2.0 0.0.0.255

#

……

5. S200_10

<S200_10> display current-configuration

#

 sysname S200_10

#

……

#

vlan 621 to 622

#

vlan 661

#

vlan 665

#

interface Vlan-interface621

 ip address 162.1.1.1 255.255.255.0

#

interface Vlan-interface622

 ip address 162.1.2.1 255.255.255.0

#

interface Vlan-interface661

 ip address 166.1.1.2 255.255.255.0

#

interface Vlan-interface665

 ip address 166.1.5.1 255.255.255.0

#

……

#

ospf 1

 area 0.0.0.10

  network 162.1.1.0 0.0.0.255

  network 162.1.2.0 0.0.0.255

  network 166.1.1.0 0.0.0.255

#

 ip route-static 0.0.0.0 0.0.0.0 166.1.5.2 preference 200

#

……

6. S300

<S300> display current-configuration

#

 sysname S300

#

router id 3.1.1.1

#

……

#

vlan 13

#

vlan 14

#

vlan 22

#

interface Vlan-interface13

 ip address 206.1.3.2 255.255.255.0

#

interface Vlan-interface14

 ip address 206.1.4.2 255.255.255.0

 rip version 2 multicast

#

interface Vlan-interface22

 ip address 196.2.2.2 255.255.255.0

#

……

#

 undo fabric-port Cascade1/2/1 enable

 undo fabric-port Cascade1/2/2 enable

#

interface NULL0

#

bgp 300

 network 206.1.3.0

 network 196.2.2.0

 import-route rip

 undo synchronization

 group 100 external

 peer 196.2.2.1 group 100 as-number 100

 group 200 external

 peer 206.1.3.3 group 200 as-number 200

 preference 200 200 200

#

rip

 undo summary

 network 206.1.4.0

 import-route bgp route-policy rip_import

#

route-policy rip_import permit node 10

 if-match ip-prefix rip_import

#

 ip ip-prefix rip_import index 10 permit 162.1.1.0 24

 ip ip-prefix rip_import index 20 permit 162.1.2.0 24

 ip ip-prefix rip_import index 30 permit 166.1.3.0 24

 ip ip-prefix rip_import index 40 permit 166.1.4.0 24

#

……

7. S300_A

<S300_A> display current-configuration

#

 sysname S300_A

#

……

#

vlan 14

#

vlan 662

#

vlan 665

#

interface Vlan-interface14

 ip address 206.1.4.1 255.255.255.0

 rip version 2 multicast

#

interface Vlan-interface662

 ip address 166.1.2.1 255.255.255.0

 rip version 2 multicast

#

interface Vlan-interface665

 ip address 166.1.5.2 255.255.255.0

#

…….

#

rip

 undo summary

 network 206.1.4.0

 network 166.1.0.0

 import-route static

#

 ip route-static 162.1.1.0 255.255.255.0 166.1.5.1 preference 200

 ip route-static 162.1.2.0 255.255.255.0 166.1.5.1 preference 200

#

……

8. S300_B

<S300_B> display current-configuration

#

 sysname S300_B

#

……

#

acl number 2000

 rule 5 deny

#

……

#

vlan 623

#

vlan 624

#

vlan 662

#

interface Vlan-interface623

 ip address 162.1.3.1 255.255.255.0

 rip version 2 multicast

#

interface Vlan-interface624

 ip address 162.1.4.1 255.255.255.0

 rip version 2 multicast

#

interface Vlan-interface662

 ip address 166.1.2.2 255.255.255.0

 rip version 2 multicast

#

……

#

rip

 undo summary

 network 166.1.0.0

 network 162.1.0.0

 filter-policy 2000 import

#

 ip route-static 0.0.0.0 0.0.0.0 166.1.2.1 preference 60

#

……

9. S400

<S400> display current-configuration

#

 sysname S400

#

 router id 4.1.1.1

#

……

#

vlan 15 to 16

#

vlan 23

#

interface Vlan-interface15

 ip address 196.1.3.3 255.255.255.0

#

interface Vlan-interface16

 ip address 206.1.6.3 255.255.255.0

#

interface Vlan-interface23

 ip address 196.2.3.3 255.255.255.0

#

……

#

 undo fabric-port Cascade1/2/1 enable

 undo fabric-port Cascade1/2/2 enable

#

interface NULL0

#

bgp 400

 network 196.1.3.0

 network 196.2.3.0

 import-route ospf 1

 undo synchronization

 group 100_1 external

 peer 196.1.3.1 group 100_1 as-number 100

 group 100_2 external

 peer 196.2.3.2 group 100_2 as-number 100

 preference 200 200 200

#

ospf 1

 import-route bgp route-policy ospf_import

 area 0.0.0.0

  network 206.1.6.0 0.0.0.255

#

route-policy ospf_import permit node 10

 if-match ip-prefix ospf_import

#

 ip as-path-acl 1 permit ^100 200$

 ip as-path-acl 2 permit ^100 300$

#

 ip ip-prefix ospf_import index 10 permit 162.1.1.0 24

 ip ip-prefix ospf_import index 20 permit 162.1.2.0 24

 ip ip-prefix ospf_import index 30 permit 162.1.3.0 24

 ip ip-prefix ospf_import index 40 permit 162.1.4.0 24

#

……

10. S400_0

<S400_0> display current-configuration

#

 sysname S400_0

#

……

#

vlan 16

#

vlan 663 to 664

#

……

#

interface Vlan-interface16

 ip address 206.1.6.1 255.255.255.0

#

interface Vlan-interface663

 ip address 166.1.3.1 255.255.255.0

#

interface Vlan-interface664

 ip address 166.1.4.1 255.255.255.0

#

……

#

ospf 1

 area 0.0.1.44

  network 166.1.3.0 0.0.0.255

  network 166.1.4.0 0.0.0.255

 #

 area 0.0.0.0

  network 206.1.6.0 0.0.0.255

#

……

3.4  配置结果验证

3.4.1  路由策略+静态路由配置验证

<S300_B> display ip routing-table

 Routing Table: public net

Destination/Mask   Protocol Pre  Cost  Nexthop     Interface

0.0.0.0/0            STATIC   60    0     166.1.2.1   Vlan-interface662

127.0.0.0/8          DIRECT   0     0     127.0.0.1   InLoopBack0

127.0.0.1/32         DIRECT   0     0         127.0.0.1   InLoopBack0

162.1.3.0/24         DIRECT   0     0     162.1.3.1   Vlan-interface623

162.1.3.1/32         DIRECT   0     0     127.0.0.1   InLoopBack0

162.1.4.0/24         DIRECT   0     0     162.1.4.1   Vlan-interface624

162.1.4.1/32         DIRECT   0     0     127.0.0.1   InLoopBack0

166.1.2.0/24         DIRECT   0     0     166.1.2.2   Vlan-interface662

166.1.2.2/32         DIRECT   0     0     127.0.0.1   InLoopBack0    

<S300_B> tracert -a 162.1.3.1 166.1.4.1

 traceroute to 166.1.4.1(166.1.4.1) 30 hops max,40 bytes packet

 1 166.1.2.1 18 ms  3 ms  3 ms

 2 206.1.4.2 9 ms  4 ms  4 ms

 3 196.2.2.1 9 ms  9 ms  18 ms

 4 196.2.3.3 6 ms  3 ms  4 ms

 5 206.1.6.1 14 ms  4 ms  3 ms

3.4.2  IGP与BGP交互配置验证

<S400_0> display ip routing-table

 Routing Table: public net

Destination/Mask  Protocol  Pre  Cost    Nexthop      Interface

127.0.0.0/8        DIRECT    0     0       127.0.0.1    InLoopBack0

127.0.0.1/32       DIRECT    0     0       127.0.0.1    InLoopBack0

162.1.1.0/24       O_ASE     150   1       206.1.6.3    Vlan-interface16

162.1.2.0/24       O_ASE     150   1       206.1.6.3    Vlan-interface16

162.1.3.0/24       O_ASE     150   1       206.1.6.3    Vlan-interface16

162.1.4.0/24       O_ASE     150   1       206.1.6.3    Vlan-interface16

166.1.3.0/24       DIRECT    0     0       166.1.3.1    Vlan-interface663

166.1.3.1/32       DIRECT    0     0       127.0.0.1    InLoopBack0

166.1.4.0/24       DIRECT    0     0       166.1.4.1    Vlan-interface664

166.1.4.1/32       DIRECT    0     0       127.0.0.1    InLoopBack0

192.168.0.0/24     DIRECT    0     0      192.168.0.30 Vlan-interface1

192.168.0.30/32    DIRECT    0     0      127.0.0.1    InLoopBack0

206.1.6.0/24       DIRECT     0     0      206.1.6.1    Vlan-interface16

206.1.6.1/32       DIRECT     0     0      127.0.0.1    InLoopBack0

<S300_A>display ip routing-table

 Routing Table: public net

Destination/Mask  Protocol Pre  Cost    Nexthop         Interface

127.0.0.0/8        DIRECT    0    0      127.0.0.1       InLoopBack0

127.0.0.1/32       DIRECT    0    0      127.0.0.1       InLoopBack0

162.1.1.0/24       RIP       100  1       206.1.4.2       Vlan-interface14

162.1.2.0/24       RIP       100  1       206.1.4.2       Vlan-interface14

162.1.3.0/24       RIP       100  1       166.1.2.2       Vlan-interface662

162.1.4.0/24       RIP       100  1       166.1.2.2       Vlan-interface662

166.1.2.0/24       DIRECT     0    0      166.1.2.1       Vlan-interface662

166.1.2.1/32       DIRECT    0    0      127.0.0.1       InLoopBack0

166.1.3.0/24       RIP        100  1       206.1.4.2       Vlan-interface14

166.1.4.0/24       RIP         100  1         206.1.4.2       Vlan-interface14

166.1.5.0/24       DIRECT    0   0      166.1.5.2       Vlan-interface665

166.1.5.2/32       DIRECT    0    0      127.0.0.1       InLoopBack0

206.1.4.0/24       DIRECT    0    0      206.1.4.1       Vlan-interface14

206.1.4.1/32       DIRECT   0    0        127.0.0.1       InLoopBack0

<S200_10> display ip routing-table

 Routing Table: public net

Destination/Mask  Protocol Pre  Cost   Nexthop     Interface

0.0.0.0/0         STATIC    200  0      166.1.5.2   Vlan-interface665

127.0.0.0/8        DIRECT      0    0      127.0.0.1   InLoopBack0

127.0.0.1/32      DIRECT  0    0      127.0.0.1   InLoopBack0

162.1.1.0/24       DIRECT     0    0      162.1.1.1   Vlan-interface621

162.1.1.1/32       DIRECT     0    0      127.0.0.1   InLoopBack0

162.1.2.0/24       DIRECT      0    0     162.1.2.1    Vlan-interface622

162.1.2.1/32       DIRECT    0    0      127.0.0.1   InLoopBack0

162.1.3.0/24       O_ASE     150  1      166.1.1.1   Vlan-interface661

162.1.4.0/24       O_ASE     150  1      166.1.1.1   Vlan-interface661

166.1.1.0/24       DIRECT    0    0      166.1.1.2   Vlan-interface661

166.1.1.2/32       DIRECT    0    0      127.0.0.1   InLoopBack0

166.1.3.0/24       O_ASE     150  1      166.1.1.1   Vlan-interface661

166.1.4.0/24       O_ASE     150  1      166.1.1.1   Vlan-interface661

166.1.5.0/24       DIRECT    0    0      166.1.5.1   Vlan-interface665

166.1.5.1/32       DIRECT    0    0      127.0.0.1   InLoopBack0

206.1.2.0/24       OSPF      10   20     166.1.1.1   Vlan-interface661

3.4.3  路由备份配置验证

1. 交换机将主路由安装到路由表中

<S200_10> display ip routing-table

 Routing Table: public net

Destination/Mask  Protocol Pre  Cost   Nexthop     Interface

0.0.0.0/0         STATIC    200  0      166.1.5.2   Vlan-interface665

127.0.0.0/8        DIRECT      0    0      127.0.0.1   InLoopBack0

127.0.0.1/32      DIRECT  0    0      127.0.0.1   InLoopBack0

162.1.1.0/24       DIRECT     0    0      162.1.1.1   Vlan-interface621

162.1.1.1/32       DIRECT     0    0      127.0.0.1   InLoopBack0

162.1.2.0/24       DIRECT      0    0     162.1.2.1    Vlan-interface622

162.1.2.1/32       DIRECT    0    0      127.0.0.1   InLoopBack0

162.1.3.0/24       O_ASE     150  1      166.1.1.1   Vlan-interface661

162.1.4.0/24       O_ASE     150  1      166.1.1.1   Vlan-interface661

166.1.1.0/24       DIRECT    0    0      166.1.1.2   Vlan-interface661

166.1.1.2/32       DIRECT    0    0      127.0.0.1   InLoopBack0

166.1.3.0/24       O_ASE     150  1      166.1.1.1   Vlan-interface661

166.1.4.0/24       O_ASE     150  1      166.1.1.1   Vlan-interface661

166.1.5.0/24       DIRECT    0    0      166.1.5.1   Vlan-interface665

166.1.5.1/32       DIRECT    0    0      127.0.0.1   InLoopBack0

206.1.2.0/24       OSPF      10   20     166.1.1.1   Vlan-interface661

<S200_10> tracert -a 162.1.1.1 166.1.3.1

 traceroute to  166.1.3.1(166.1.3.1) 30 hops max,40 bytes packet

 1 166.1.1.1 10 ms  3 ms  3 ms

 2 206.1.2.3 13 ms  3 ms  5 ms

 3 196.1.1.1 9 ms  3 ms  4 ms

 4 196.1.3.3 12 ms  3 ms  3 ms

 5 206.1.6.1 14 ms  5 ms  3 ms

2. 当主路由链路出现故障时,交换机将备份路由安装到路由表中。

<S200_10> display ip routing-table

 Routing Table: public net

Destination/Mask  Protocol Pre  Cost   Nexthop     Interface

0.0.0.0/0           STATIC   200  0     166.1.5.2    Vlan-interface665

127.0.0.0/8         DIRECT   0    0          127.0.0.1    InLoopBack0

127.0.0.1/32        DIRECT   0    0      127.0.0.1    InLoopBack0

162.1.1.0/24        DIRECT   0    0      162.1.1.1       Vlan-interface621

162.1.1.1/32        DIRECT   0    0      127.0.0.1       InLoopBack0

162.1.2.0/24        DIRECT   0    0      162.1.2.1       Vlan-interface622

162.1.2.1/32        DIRECT   0    0      127.0.0.1       InLoopBack0

166.1.5.0/24        DIRECT   0    0      166.1.5.1       Vlan-interface665

166.1.5.1/32        DIRECT   0    0      127.0.0.1    InLoopBack0 

<S200_10> tracert -a 162.1.1.1 166.1.3.1

 traceroute to  166.1.3.1(166.1.3.1) 30 hops max,40 bytes packet

 1 166.1.5.2 11 ms  3 ms  4 ms

 2 206.1.4.2 13 ms  3 ms  4 ms

 3 196.2.2.1 13 ms  3 ms  6 ms

 4 196.2.3.3 11 ms  3 ms  4 ms

 5 206.1.6.1 12 ms  3 ms  4 ms

3.4.4  BGP的MED属性配置验证

1. 使用缺省MED值时报文的转发路径

<S400_0> tracert -a 166.1.3.1 162.1.1.1

 traceroute to  162.1.1.1(162.1.1.1) 30 hops max,40 bytes packet

 1 206.1.6.3 11 ms  3 ms  7 ms

 2 196.1.3.1 10 ms  3 ms  8 ms

 3 196.1.1.3 8 ms  3 ms  3 ms

 4 206.1.2.1 13 ms  4 ms  3 ms

 5 166.1.1.2 13 ms  4 ms  3 ms

<S400_0> tracert -a 166.1.3.1 162.1.3.1

 traceroute to  162.1.3.1(162.1.3.1) 30 hops max,40 bytes packet

 1 206.1.6.3 11 ms  3 ms  3 ms

 2 196.1.3.1 14 ms  4 ms  5 ms

 3 196.3.1.2 10 ms  8 ms  17 ms

 4 196.2.2.2 14 ms  3 ms  3 ms

 5 206.1.4.1 13 ms  3 ms  3 ms

 6 166.1.2.2 13 ms  3 ms  4 ms

2. 对MED值进行控制时报文的转发路径

# 配置AS路径过滤列表1,允许AS_PATH以100开始,200结束的路由信息通过

[S400] ip as-path-acl 1 permit ^100 200$

# 显示匹配AS路径过滤列表1的路由

<S400> display bgp routing as-path-acl 1

 

Flags:   # - valid       ^ - active      I - internal

         D - damped      H - history     S - aggregate suppressed

    Dest/Mask        Next-Hop      Med   Local-pref   Origin      Path ----------------------------------------------------------------------

#^  162.1.1.0/24      196.1.3.1        100    100           INC       100 200

#   162.1.1.0/24      196.2.3.2        200    100           INC       100 200

#^  162.1.2.0/24      196.1.3.1        100    100           INC       100 200

#   162.1.2.0/24      196.2.3.2        200    100           INC       100 200

#^  166.1.1.0/24      196.1.3.1       0   100           INC       100 200

#   166.1.1.0/24      196.2.3.2       0   100           INC       100 200

#^  206.1.3.0         196.1.3.1    0          100           IGP       100 200

# 配置AS路径过滤列表1,允许AS_PATH100开始,300结束的路由信息通过

[S400] ip as-path-acl 2 permit ^100 300$

# 显示匹配AS路径过滤列表2的路由

<S400> display bgp routing as-path-acl 2

 

Flags:   # - valid       ^ - active      I - internal

         D - damped      H - history     S - aggregate suppressed

    Dest/Mask         Next-Hop       Med       Local-pref   Origin     Path   ----------------------------------------------------------------------

#^  162.1.3.0/24     196.2.3.2      100       100            INC      100 300

#   162.1.3.0/24     196.1.3.1      200       100            INC      100 300

#^  162.1.4.0/24     196.2.3.2      100       100            INC      100 300

#   162.1.4.0/24     196.1.3.1      200       100            INC      100 300

#^  166.1.2.0/24     196.1.3.1      0         100            INC      100 300

#   166.1.2.0/24     196.2.3.2      0         100            INC      100 300

#^  166.1.5.0/24     196.1.3.1      0         100            INC      100 300

#   166.1.5.0/24     196.2.3.2      0         100            INC      100 300

#   206.1.3.0        196.2.3.2      0         100           IGP      100 300

<S400_0> tracert -a 166.1.3.1 162.1.1.1

 traceroute to  162.1.1.1(162.1.1.1) 30 hops max,40 bytes packet

 1 206.1.6.3 9 ms  4 ms  3 ms

 2 196.1.3.1 13 ms  4 ms  3 ms

 3 196.1.1.3 14 ms  4 ms  3 ms

 4 206.1.2.1 12 ms  3 ms  3 ms

 5 166.1.1.2 13 ms  4 ms  3 ms

<S400_0> tracert -a 166.1.3.1 162.1.3.1

 traceroute to  162.1.3.1(162.1.3.1) 30 hops max,40 bytes packet

 1 206.1.6.3 10 ms  4 ms  3 ms

 2 196.2.3.2 13 ms  3 ms  5 ms

 3 196.2.2.2 12 ms  5 ms  3 ms

 4 206.1.4.1 12 ms  4 ms  3 ms

 5 166.1.2.2 14 ms  3 ms  5 ms

3.5  注意事项

在配置及验证的过程中,请注意以下几点:

l              对于支持Fabric的设备,启动BGP之前必须关闭Fabric功能;

l              为了保证配置目标的实现,建议在配置的过程中将BGP优先级修改为适合的值(建议修改为200);配置静态路由的设备,根据情况对静态路由的优先级进行相应的修改;

l              在S300_A上无法实现备份路由(静态路由)到主路由(RIP)的自动切换,需要手工干涉,方法是将备份路由手动从配置中删除,然后在添加到配置中;

l              由于将BGP引入到IGP时应用了路由策略,可能存在部分路由条目没有被引入的情况,所以在验证时建议使用源地址的模式进行验证:tracert –a / ping –a

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们