华为综合实验——ISIS-BGP

前言:本次结合之前学习到的IS-IS与BGP协议,做一个综合实验,除了复习下IS-IS与BGP协议的配置以及BGP邻居关系的建立之外,还涉及到BGP下一跳的优化,路由反射器的配置等其他知识

文章目录

  • 一、实验环境
    • 1.环境
    • 2.需求
    • 3.拓扑图
  • 二、详细配置
    • 1.给接口配置IP
    • 2.配置ISIS协议
      • 1)开启ISIS
      • 2)进入接口开启ISIS协议
    • 3.配置BGP协议
      • 1)配置IBGP协议,建立邻居关系
        • R1与R2、R3、R6、R7建立邻居关系
        • R2与R1、R3、R5、R6建立邻居关系
        • R3与R1、R2、R5、R7建立邻居关系
        • R5与R2、R3、R6、R7建立邻居关系
        • R6与R1、R2、R5、R7建立邻居关系
        • R7与R1、R3、R5、R6建立邻居关系
      • 2)配置路由反射器
        • R2配置路由反射客户端
        • R6配置路由器反射客户端
        • R3配置路由器反射客户端
        • R7配置路由器反射客户端
      • 3)配置EBGP
    • 3.测试

一、实验环境

1.环境

  • 实验软件:eNSP模拟机
  • 八台路由器,分成基层,市干核心,省干核心,国干核心路由

2.需求

  • 1、通过ISIS将AS内部的直连和环回口路由宣告
  • 2、通过配置BGP协议将所有的用户业务路由宣告
  • 3、通过配置路由反射器实现市内、省内路由互通
  • 4、通过建立EBGP邻居实现全省和互联网路由互传

3.拓扑图

华为综合实验——ISIS-BGP_第1张图片

二、详细配置

1.给接口配置IP

  • 先将每个路由器的接口配上IP,可以用 dis ip int b 命令查看接口信息
//这里就只展示接口信息,部分内容省略
R1:
[R1]dis ip int b
。。省略部分内容
GigabitEthernet0/0/0              12.0.0.1/30          up         up        
GigabitEthernet0/0/1              16.0.0.1/30          up         up
LoopBack0                         1.1.1.1/32           up         up(s)       

R2:
[R2]dis ip int b   
GigabitEthernet0/0/0              12.0.0.2/30          up         up        
GigabitEthernet0/0/1              23.0.0.1/30          up         up        
GigabitEthernet0/0/2              26.0.0.1/30          up         up        
GigabitEthernet0/0/3              25.0.0.2/30          up         up
LoopBack0                         2.2.2.2/32           up         up(s)  

R3:
[R3]dis ip int b
GigabitEthernet0/0/0              23.0.0.2/30          up         up        
GigabitEthernet0/0/1              34.0.0.1/30          up         up        
GigabitEthernet0/0/2              37.0.0.1/30          up         up  
LoopBack0                         3.3.3.3/32           up         up(s)  

R4:
[R4]dis ip int b
GigabitEthernet0/0/0              34.0.0.2/30          up         up        
GigabitEthernet0/0/1              48.0.0.1/30          up         up  
LoopBack0                         4.4.4.4/32           up         up(s)  

R5:
[R5]dis ip int b   
GigabitEthernet0/0/0              56.0.0.1/30          up         up        
GigabitEthernet0/0/1              25.0.0.1/30          up         up  
LoopBack0                         5.5.5.5/32           up         up(s)  

R6:
[R6]dis ip int b 
GigabitEthernet0/0/0              56.0.0.2/30          up         up        
GigabitEthernet0/0/1              67.0.0.1/30          up         up        
GigabitEthernet0/0/2              26.0.0.2/30          up         up        
GigabitEthernet0/0/3              16.0.0.2/30          up         up 
LoopBack0                         6.6.6.6/32           up         up(s)  

R7:
[R7]dis ip int b   
GigabitEthernet0/0/0              67.0.0.2/30          up         up        
GigabitEthernet0/0/1              78.0.0.1/30          up         up        
GigabitEthernet0/0/2              37.0.0.2/30          up         up 
LoopBack0                         7.7.7.7/32           up         up(s)  

R8:
[R8]dis ip int b
GigabitEthernet0/0/0              78.0.0.2/30          up         up        
GigabitEthernet0/0/1              48.0.0.2/30          up         up  
LoopBack0                         8.8.8.8/32           up         up(s)  

2.配置ISIS协议

  • R1、R2、R3、R5、R6、R7跑ISIS
    • R1、R2、R5、R6边缘启ISIS
    • R3、R7骨干启ISIS
  • 配置ISIS协议,将AS内部的直连和环回口的路由宣告

1)开启ISIS

  • 以R1路由器为例,开启ISIS协议,并宣告NSAP以及级别
[R1]isis 1           //开启
[R1-isis-1]network-entity 49.0001.0010.0100.1001.00         //宣告NSAP
[R1-isis-1]is-level level-1	        //配置IS-IS路由级别

2)进入接口开启ISIS协议

  • 以R1路由器为例,在每个接口内开启ISIS协议
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]isis en	//开启isis
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]isis enable
[R1-GigabitEthernet0/0/1]int loo 0
[R1-LoopBack0]isis enable
  • 给同在ISIS协议内的R2,R3,R5,R6,R7路由器进行配置
  • 与R1路由器配置思路相同,除了R3的G0/0/1和R7的G0/0/1接口不需要开启isis,其他每个接口都需要开启ISIS,
  • 各路由器的NSAP与级别不同
各路由器的NSAP:
R2的NSAP:network-entity 49.0001.0010.0100.1001.00
R3的NSAP:network-entity 49.0000.0010.0100.1001.00
R5的NSAP:network-entity 49.0001.0010.0100.1001.00
R6的NSAP:network-entity 49.0001.0010.0100.1001.00
R7的NSAP:network-entity 49.0000.0010.0100.1001.00

各路由器的ISIS路由级别:
R2的路由级别:is-level level-1-2
R3的路由级别:is-level level-2
R5的路由级别:is-level level-1
R6的路由级别:is-level level-1-2
R7的路由级别:is-level level-2
注意:R3的G0/0/1和R7的G0/0/1接口不需要开启isis
  • 配置完成后,我们需要通过路由泄露的方法让R1和R5路由器能够学习到其他路由的信息
[R2]isis 1
[R2-isis-1]import-route isis level-2 into level-1 
[R6]isis 1
[R6-isis-1]import-route isis level-2 into level-1 
  • 此时,在ISIS协议内,所有路由都可互相学习到路由信息
  • 比如查看R1路由器的信息
[R1]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 19       Routes : 22       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   ISIS-L1 15   10          D   12.0.0.2        GigabitEthernet
0/0/0
                    ISIS-L1 15   10          D   16.0.0.2        GigabitEthernet
0/0/1
        1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
        2.2.2.2/32  ISIS-L1 15   10          D   12.0.0.2        GigabitEthernet
0/0/0
        3.3.3.3/32  ISIS-L1 15   20          D   12.0.0.2        GigabitEthernet
0/0/0
        5.5.5.5/32  ISIS-L1 15   20          D   12.0.0.2        GigabitEthernet
0/0/0
                    ISIS-L1 15   20          D   16.0.0.2        GigabitEthernet
0/0/1
        6.6.6.6/32  ISIS-L1 15   10          D   16.0.0.2        GigabitEthernet
0/0/1
       11.0.0.0/30  Direct  0    0           D   11.0.0.1        LoopBack1
       11.0.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack1
       12.0.0.0/30  Direct  0    0           D   12.0.0.1        GigabitEthernet
0/0/0
       12.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
       16.0.0.0/30  Direct  0    0           D   16.0.0.1        GigabitEthernet
0/0/1
       16.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
       23.0.0.0/30  ISIS-L1 15   20          D   12.0.0.2        GigabitEthernet
0/0/0
       25.0.0.0/30  ISIS-L1 15   20          D   12.0.0.2        GigabitEthernet
0/0/0
       26.0.0.0/30  ISIS-L1 15   20          D   12.0.0.2        GigabitEthernet
0/0/0
                    ISIS-L1 15   20          D   16.0.0.2        GigabitEthernet
0/0/1
       37.0.0.0/30  ISIS-L1 15   30          D   12.0.0.2        GigabitEthernet
0/0/0
       56.0.0.0/30  ISIS-L1 15   20          D   16.0.0.2        GigabitEthernet
0/0/1
      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.配置BGP协议

  • 通过配置BGP协议将所有的用户业务路由宣告

1)配置IBGP协议,建立邻居关系

  • R1、R2、R3、R5、R6、R7跑IBGP

R1与R2、R3、R6、R7建立邻居关系

router id 1.1.1.1    //宣告router id
bgp 56001            //开启bgp协议,56001为所在AS区域号
peer 2.2.2.2 as-number 56001      //与AS区域号为56001,ip为2.2.2.2的路由建立邻居关系
peer 2.2.2.2 connect-interface LoopBack 0    //与ip2.2.2.2的路由loopback 0接口建立邻居关系
peer 3.3.3.3 as-number 56001     //同上
peer 3.3.3.3 connect-interface LoopBack 0
peer 6.6.6.6 as-number 56001
peer 6.6.6.6 connect-interface LoopBack 0
peer 7.7.7.7 as-number 56001
peer 7.7.7.7 connect-interface LoopBack 0

R2与R1、R3、R5、R6建立邻居关系

router id 2.2.2.2
bgp 56001
peer 1.1.1.1 as-number 56001
peer 1.1.1.1 connect-interface LoopBack 0
peer 3.3.3.3 as-number 56001
peer 3.3.3.3 connect-interface LoopBack 0
peer 5.5.5.5 as-number 56001
peer 5.5.5.5 connect-interface LoopBack 0
peer 6.6.6.6 as-number 56001
peer 6.6.6.6 connect-interface LoopBack 0

R3与R1、R2、R5、R7建立邻居关系

router id 3.3.3.3
bgp 56001
peer 1.1.1.1 as-number 56001
peer 1.1.1.1 connect-interface LoopBack 0
peer 2.2.2.2 as-number 56001
peer 2.2.2.2 connect-interface LoopBack 0
peer 5.5.5.5 as-number 56001
peer 5.5.5.5 connect-interface LoopBack 0
peer 7.7.7.7 as-number 56001
peer 7.7.7.7 connect-interface LoopBack 0

R5与R2、R3、R6、R7建立邻居关系

router id 5.5.5.5
bgp 56001
peer 2.2.2.2 as-number 56001
peer 2.2.2.2 connect-interface LoopBack 0
peer 3.3.3.3 as-number 56001
peer 3.3.3.3 connect-interface LoopBack 0
peer 6.6.6.6 as-number 56001
peer 6.6.6.6 connect-interface LoopBack 0
peer 7.7.7.7 as-number 56001
peer 7.7.7.7 connect-interface LoopBack 0

R6与R1、R2、R5、R7建立邻居关系

router id 6.6.6.6
bgp 56001
peer 1.1.1.1 as-number 56001
peer 1.1.1.1 connect-interface LoopBack 0
peer 2.2.2.2 as-number 56001
peer 2.2.2.2 connect-interface LoopBack 0
peer 5.5.5.5 as-number 56001
peer 5.5.5.5 connect-interface LoopBack 0
peer 7.7.7.7 as-number 56001
peer 7.7.7.7 connect-interface LoopBack 0

R7与R1、R3、R5、R6建立邻居关系

router id 7.7.7.7
bgp 56001
peer 1.1.1.1 as-number 56001
peer 1.1.1.1 connect-interface LoopBack 0
peer 3.3.3.3 as-number 56001
peer 3.3.3.3 connect-interface LoopBack 0
peer 5.5.5.5 as-number 56001
peer 5.5.5.5 connect-interface LoopBack 0
peer 6.6.6.6 as-number 56001
peer 6.6.6.6 connect-interface LoopBack 0
  • 可以用dis bgp peer 查看邻居关系建立情况
[R1]dis bgp peer

 BGP local router ID : 1.1.1.1
 Local AS number : 56001
 Total number of peers : 4		  Peers in established state : 4

  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State Pre
fRcv

  2.2.2.2         4       56001       13       14     0 00:11:22 Established    
   0
  3.3.3.3         4       56001       11       12     0 00:09:27 Established    
   0
  6.6.6.6         4       56001        9       10     0 00:08:00 Established    
   0
  7.7.7.7         4       56001        3        3     0 00:01:23 Established    
   0
  • 在R1上添加并宣告业务网段
[R1]int loo 1
[R1-LoopBack1]ip add 11.0.0.1 30
[R1-LoopBack1]
[R1]bgp 56001
[R1-bgp]network 11.0.0.0 30

2)配置路由反射器

  • 通过配置路由反射器,实现市与省内路由互通

R2配置路由反射客户端

//通过配置路由反射器让R5能够学习到业务网段
bgp 56001
reflector cluster-id 100
peer 1.1.1.1 reflect-client
peer 5.5.5.5 reflect-client

R6配置路由器反射客户端

//在生产环境中我们还需要再R6上配置路由反射器,实现室内路由互通
bgp 56001
reflector cluster-id 100
peer 1.1.1.1 reflect-client
peer 5.5.5.5 reflect-client
  • 需要在R3和R7上配置路由反射器来实现省内路由互通

R3配置路由器反射客户端

//R3与R6没有建立邻居关系,所以不需要做R6的反射
bgp 56001
reflector cluster-id 200
peer 2.2.2.2 reflect-client

R7配置路由器反射客户端

//R7与R2没有建立邻居关系,所以不需要做R2的反射
bgp 56001
reflector cluster-id 200
peer 6.6.6.6 reflect-client
  • 配置完成后可实现省内互通

3)配置EBGP

  • 建立EBGP邻居实现全省和互联网路由互传
//配置静态路由
[R3]ip route-static 4.4.4.4 32 34.0.0.2
[R7]ip route-static 8.8.8.8 32 78.0.0.2
[R4]ip route-static 3.3.3.3 32 34.0.0.1
[R8]ip route-static 7.7.7.7 32 78.0.0.1

//建立EBGP邻居
[R3]bgp 56001
[R3-bgp]peer 4.4.4.4 as-number 56002
[R3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R3-bgp]peer 4.4.4.4 ebgp-max-hop 2
[R4]router id  4.4.4.4
[R4]bgp 56002
[R4-bgp]peer 3.3.3.3 as-number 56001
[R4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R4-bgp]peer 3.3.3.3 ebgp-max-hop 2
[R7]bgp 56001
[R7-bgp]peer 8.8.8.8 as-number 56002
[R7-bgp]peer 8.8.8.8 connect-interface LoopBack 0
[R7-bgp]peer 8.8.8.8 ebgp-max-hop 2
[R8]router id  8.8.8.8
[R8]bgp 56002
[R8-bgp]peer 7.7.7.7 as-number 56001
[R8-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[R8-bgp]peer 7.7.7.7 ebgp-max-hop 2
  • 给R4添加一条业务网段
[R4]int loo 1
[R4-LoopBack1]ip add 44.0.0.1 30
[R4-LoopBack1]q
[R4]bgp 56002
[R4-bgp]net	
[R4-bgp]network 44.0.0.0 30
  • R3和R7做个优化,使其他邻居路由器查看路由表的时候会更清晰
[R3-bgp]peer 1.1.1.1 next-hop-local
[R3-bgp]peer 2.2.2.2 next-hop-local
[R3-bgp]peer 5.5.5.5 next-hop-local
[R3-bgp]peer 7.7.7.7 next-hop-local
[R7-bgp]peer 1.1.1.1 next-hop-local
[R7-bgp]peer 3.3.3.3 next-hop-local
[R7-bgp]peer 5.5.5.5 next-hop-local
[R7-bgp]peer 6.6.6.6 next-hop-local

3.测试

  • 在R1上ping测试44.0.0.1这个业务地址
[R1]ping -a 11.0.0.1 44.0.0.1
  PING 44.0.0.1: 56  data bytes, press CTRL_C to break
    Reply from 44.0.0.1: bytes=56 Sequence=1 ttl=253 time=110 ms
    Reply from 44.0.0.1: bytes=56 Sequence=2 ttl=253 time=70 ms
    Reply from 44.0.0.1: bytes=56 Sequence=3 ttl=253 time=70 ms
    Reply from 44.0.0.1: bytes=56 Sequence=4 ttl=253 time=60 ms
    Reply from 44.0.0.1: bytes=56 Sequence=5 ttl=253 time=90 ms

  --- 44.0.0.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 60/80/110 ms

你可能感兴趣的:(华为)