配置IS-IS和BGP交互示例

学习精彩网络技术老师:华为HCIA和HCIP数通eNSP实战视频课
点击学习精彩网络技术老师:华为HCIA和HCIP数通eNSP实战课程、华三、锐捷、WLAN、IPv6等全套视频课程

举例说明实现运行IS-IS的两个AS之间互相引入路由的配置方法。

组网需求

图1所示:

RouterA和RouterB属于同一自治系统,两者之间建立IS-IS邻居。RouterA为AS内部的一台非BGP设备。

RouterB和RouterC之间建立EBGP连接。

为了实现两个AS可以互相通信,需要IS-IS与BGP相互引入路由。并且当IS-IS引入BGP路由时,通过应用路由策略改变引入路由的开销,便于引入路由后对路由选择的控制。

图1 配置IS-IS和BGP交互组网图

配置思路

采用如下的思路配置IS-IS和BGP交互:

在RouterA和RouterB上使能IS-IS,指定网络实体。

在RouterB和RouterC上配置EBGP连接。

在RouterB上配置BGP与IS-IS互相引入,查看路由信息。

数据准备

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

RouterA和RouterB的区域地址。

RouterB的Router ID和所在AS号。

RouterC的Router ID和所在AS号。

操作步骤
  1. 配置各接口的IP地址(略)
  2. 配置IS-IS基本功能

# 配置RouterA。

[RouterA] isis 1

[RouterA-isis-1] network-entity 10.0000.0000.0001.00

[RouterA-isis-1] quit

[RouterA]  interface pos 1/0/0

[RouterA-Pos1/0/0] isis enable 1

[RouterA-Pos1/0/0] quit

# 配置RouterB。

[RouterB] isis 1

[RouterB-isis-1] network-entity 10.0000.0000.0002.00

[RouterB-isis-1] quit

[RouterB] interface pos 1/0/0

[RouterB-Pos1/0/0] isis enable 1

[RouterB-Pos1/0/0] quit

  1. 配置EBGP连接

# 配置RouterB。

[RouterB] bgp 65008

[RouterB-bgp] router-id 1.1.1.1

[RouterB-bgp] peer 10.2.1.2 as-number 65009

[RouterB-bgp] ipv4-family unicast

[RouterB-bgp-af-ipv4] network 10.2.1.0 255.255.255.0

配置RouterC。

[RouterC] bgp 65009

[RouterC-bgp] router-id 2.2.2.2

[RouterC-bgp] peer 10.2.1.1 as-number 65008

[RouterC-bgp] ipv4-family unicast

[RouterC-bgp-af-ipv4] network 10.2.1.0 255.255.255.0

  1. 配置IS-IS引入BGP路由

# 在RouterC上配置一条静态路由。

[RouterC] ip route-static 3.3.3.3 32 NULL 0

# 在RouterC上配置BGP引入静态路由。

[RouterC] bgp 65009

[RouterC-bgp] import-route static

# 在RouterB上配置IS-IS引入BGP路由。

[RouterB] isis 1

[RouterB-isis-1] import-route bgp

[RouterB-isis-1] quit

# 查看RouterA的路由表,IS-IS引入BGP路由3.3.3.3/32成功。

[RouterA] display ip routing-tableRoute Flags: R - relay, D - download

to fib

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

Routing Tables: Public

         Destinations : 6        Routes : 6

Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface

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

       10.1.1.1/32  Direct 0    0           D  127.0.0.1       InLoopBack0

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

       127.0.0.0/8  Direct 0    0           D  127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct 0    0           D  127.0.0.1       InLoopBack0

      3.3.3.3/32 ISIS-L2 15   74          D 10.1.1.2        Pos1/0/0

# 在RouerB上配置AS_Path属性过滤器并在路由策略RTC中应用。

[RouterB] ip as-path-filter 1 permit 65009

[RouterB] route-policy RTC permit node 0

[RouterB-route-policy] if-match as-path-filter 1

[RouterB-route-policy] apply cost 20

[RouterB-route-policy] quit

# 在RouterB上配置IS-IS引入BGP路由。

[RouterB] isis 1

[RouterB-isis-1] import-route bgp route-policy RTC

[RouterB-isis-1] quit

# 查看RouterA的路由表,AS_Path属性过滤应用成功,引入路由3.3.3.3/32的cost值从74变为94。

[RouterA] display ip routing-tableRoute Flags: R - relay, D - download

to fib

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

Routing Tables: Public

         Destinations : 6        Routes : 6

Destination/Mask    Proto   Pre  Cost     Flags NextHop         Interface

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

       10.1.1.1/32  Direct  0    0           D  127.0.0.1       Pos1/0/0

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

       127.0.0.0/8  Direct  0    0           D  127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct  0    0           D  127.0.0.1       InLoopBack0

        3.3.3.3/32  ISIS-L2 15   94         D  10.1.1.2        Pos1/0/0

  1. 配置BGP引入IS-IS路由

[RouterB] bgp 65008

[RouterB-bgp] import-route isis 1

[RouterB-bgp] quit

# 查看RouterC的路由表,BGP引入IS-IS路由10.1.1.0/24成功。

[RouterC] display ip routing-tableRoute Flags: R - relay, D - download

to fib

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

Routing Tables: Public

         Destinations : 7        Routes : 7

Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface

       10.1.1.0/24 EBGP 255   0           D  10.2.1.1       Pos1/0/0

       10.2.1.0/24  Direct 0    0           D  10.2.1.2        Pos1/0/0

       10.2.1.1/32  Direct 0    0           D  10.2.1.1        Pos1/0/0

       10.2.1.2/32  Direct 0    0           D  127.0.0.1       InLoopBack0

       127.0.0.0/8  Direct 0    0           D  127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct 0    0           D  127.0.0.1       InLoopBack0

        3.3.3.3/32  Static 60   0           D  0.0.0.0         NULL0

配置文件

RouterA的配置文件

#

 sysname RouterA

#

isis 1

network-entity 10.0000.0000.0001.00

#

interface Pos1/0/0 link-protocol ppp

 ip address 10.1.1.1 255.255.255.0

 isis enable 1

#

return

RouterB的配置文件

#

 sysname RouterB

#

isis 1

network-entity 10.0000.0000.0002.00

 import-route bgp route-policy RTC

#

interface Pos1/0/0

  link-protocol ppp

 ip address 10.1.1.2 255.255.255.0

 isis enable 1

#

interface Pos2/0/0 link-protocol ppp

 ip address 10.2.1.1 255.255.255.0

#

interface LoopBack0

 ip address 1.1.1.1 255.255.255.255

#

bgp 65008

 router-id 1.1.1.1

 peer 10.2.1.2 as-number 65009

#

 ipv4-family unicast

  undo synchronization

  network 10.2.1.0 255.255.255.0

  import-route isis 1

  peer 10.2.1.2 enable

#

route-policy RTC permit node 0

 if-match as-path-filter 1

 apply cost 20

#

 ip as-path-filter 1 permit 65009

#

return

RouterC的配置文件

#

 sysname RouterC

#

interface Pos1/0/0

  link-protocol ppp

 ip address 10.2.1.2 255.255.255.0

#

interface LoopBack0

 ip address 2.2.2.2 255.255.255.255

#

bgp 65009

 router-id 2.2.2.2

 peer 10.2.1.1 as-number 65008

#

 ipv4-family unicast

  undo synchronization

  network 10.2.1.0 255.255.255.0

  import-route static

  peer 10.2.1.1 enable

#

 ip route-static 3.3.3.3 255.255.255.255 NULL0

#

return

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

精彩网络技术

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值