BGP-ISIS实验

BGP-ISIS实验_第1张图片

(控制层面)ISIS 主要功能跑底层框架路由网段:直连、环回地址

(数据层面)IBGP 直接宣告的方式,将业务网段发布

业务网段不在ISIS里面跑

BARS/SR中,它是有好多条业务网段,上万条

如果在ISIS里面跑,ISIS内的链路信息数据库会变得很庞大

所以业务网段由IBGP发布出去

学习到的知识点:

1.AS6500 ISIS能通

2.IBGP能通

3.EBGP能通

4.优化路由器反射器,next-hop-local

实验步骤:

1.配置接口IP

R1

system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 30
[R1-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]q
[R1]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 16.0.0.1 30
[R1-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R1-GigabitEthernet0/0/1]q
[R1]int loo 0
[R1-LoopBack0]ip add 1.1.1.1 32
[R1-LoopBack0]q
[R1]int loo 1
[R1-LoopBack1]ip add 11.0.0.1 30
[R1-LoopBack1]q

R2

system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 30
[R2-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]q
[R2]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 23.0.0.1 30
[R2-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R2-GigabitEthernet0/0/1]q
[R2]int g 0/0/2
[R2-GigabitEthernet0/0/2]ip add 26.0.0.1 30
[R2-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R2-GigabitEthernet0/0/2]q
[R2]int g 0/0/3
[R2-GigabitEthernet0/0/3]ip add 25.0.0.2 30
[R2-GigabitEthernet0/0/3]un sh
Info: Interface GigabitEthernet0/0/3 is not shutdown.
[R2-GigabitEthernet0/0/3]q
[R2]int loo 0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-LoopBack0]q

R3

[Huawei]sysname r3
[r3]UN IN EN
Info: Information center is disabled.
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.0.0.2 30
[r3-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r3-GigabitEthernet0/0/0]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 34.0.0.1 30
[r3-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[r3-GigabitEthernet0/0/1]q
[r3]int g 0/0/2
[r3-GigabitEthernet0/0/2]ip add 37.0.0.1 30
[r3-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[r3-GigabitEthernet0/0/2]q
[r3]int loo 0
[r3-LoopBack0]ip add 3.3.3.3 32
[r3-LoopBack0]q

R4

system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys	
[Huawei]sysname R4
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 34.0.0.2 30
[R4-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R4-GigabitEthernet0/0/0]q
[R4]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 48.0.0.1 30
[R4-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R4-GigabitEthernet0/0/1]q
[R4]int loo 0
[R4-LoopBack0]ip add 4.4.4.4 32
[R4-LoopBack0]q

R5

system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys	
[Huawei]sysname R5
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 56.0.0.1 30
[R5-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R5-GigabitEthernet0/0/0]q
[R5]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip add 25.0.0.1 30
[R5-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R5-GigabitEthernet0/0/1]q
[R5]int loo 0
[R5-LoopBack0]ip add 5.5.5.5 32
[R5-LoopBack0]q

R6

system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys	
[Huawei]sysname R6
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 56.0.0.2 30
[R6-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R6-GigabitEthernet0/0/0]q
[R6]int g 0/0/1
[R6-GigabitEthernet0/0/1]ip add 67.0.0.1 30
[R6-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R6-GigabitEthernet0/0/1]q
[R6]int g 0/0/2
[R6-GigabitEthernet0/0/2]ip add 26.0.0.2 30
[R6-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R6-GigabitEthernet0/0/2]q
[R6]int g 0/0/3
[R6-GigabitEthernet0/0/3]ip add 16.0.0.2 30
[R6-GigabitEthernet0/0/3]un sh
Info: Interface GigabitEthernet0/0/3 is not shutdown.
[R6-GigabitEthernet0/0/3]q
[R6]int loo 0
[R6-LoopBack0]ip add 6.6.6.6 32
[R6-LoopBack0]q

R7

system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys	
[Huawei]sysname R7
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]ip add 67.0.0.2 30
[R7-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R7-GigabitEthernet0/0/0]q
[R7]int g 0/0/01
[R7-GigabitEthernet0/0/1]ip add 78.0.0.1 30
[R7-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R7-GigabitEthernet0/0/1]q
[R7]int g 0/0/2
[R7-GigabitEthernet0/0/2]ip add 37.0.0.2 30
[R7-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R7-GigabitEthernet0/0/2]q
[R7]int loo 0
[R7-LoopBack0]ip add 7.7.7.7 32
[R7-LoopBack0]q

R8

system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys	
[Huawei]sysname R8
[R8]int g 0/0/0
[R8-GigabitEthernet0/0/0]ip add 78.0.0.2 30
[R8-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R8-GigabitEthernet0/0/0]q
[R8]int g 0/0/1
[R8-GigabitEthernet0/0/1]ip add 48.0.0.2 30
[R8-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R8-GigabitEthernet0/0/1]q
[R8]int loo 0
[R8-LoopBack0]ip add 8.8.8.8 32
[R8-LoopBack0]q
[R8]

接口IP配置完毕

开始配置isis

BGP-ISIS实验_第2张图片

R1是L1 R2是L1-2 R3是L2

R5是L1 R6是L1-2 R7是L2

R1

[R1]isis 
[R1-isis-1]network-entity 49.0001.0010.0100.1001.00
[R1-isis-1]is-level level-1
Info: IS Level Changed, Resetting ISIS...
[R1-isis-1]q
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]is en
[R1-GigabitEthernet0/0/0]q
[R1]int g 0/0/1
[R1-GigabitEthernet0/0/1]is en
[R1-GigabitEthernet0/0/1]q
[R1]int loo 0
[R1-LoopBack0]is en
[R1-LoopBack0]q

R2

[R2]isis 
[R2-isis-1]network-entity 49.0001.0020.0200.2002.00
[R2-isis-1]is-level level-1-2
[R2-isis-1]q
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]is en
[R2-GigabitEthernet0/0/0]q
[R2]int g 0/0/1
[R2-GigabitEthernet0/0/1]is en
[R2-GigabitEthernet0/0/1]q
[R2]int g 0/0/2
[R2-GigabitEthernet0/0/2]is en
[R2-GigabitEthernet0/0/2]q
[R2]int g 0/0/3
[R2-GigabitEthernet0/0/3]is en
[R2-GigabitEthernet0/0/3]q
[R2]int loo 0
[R2-LoopBack0]is en
[R2-LoopBack0]q

R3:R3的与国干网相连的接口g0/0/1不需要开启isis ,因为它是要跑bgp的,R7也是同样的道理

[r3]isis	
[r3-isis-1]network-entity 49.0000.0030.0300.3003.00
[r3-isis-1]is-level level-2
Info: IS Level Changed, Resetting ISIS...
[r3-isis-1]q
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]is en
[r3-GigabitEthernet0/0/0]q
[r3]int g 0/0/2
[r3-GigabitEthernet0/0/2]is en
[r3-GigabitEthernet0/0/2]q
[r3]int loo 0
[r3-LoopBack0]is en
[r3-LoopBack0]q

R5

[R5]isis
[R5-isis-1]network-entity 49.0001.0050.0500.5005.00	
[R5-isis-1]is-level level-1
Info: IS Level Changed, Resetting ISIS...
[R5-isis-1]q
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]is en
[R5-GigabitEthernet0/0/0]q
[R5]int g 0/0/1
[R5-GigabitEthernet0/0/1]is en
[R5-GigabitEthernet0/0/1]q
[R5]int loo 0
[R5-LoopBack0]is en
[R5-LoopBack0]q

R6

[R6]isis
[R6-isis-1]network-entity 49.0001.0060.0600.6006.00
[R6-isis-1]is-level level-1-2
[R6-isis-1]q
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]is en
[R6-GigabitEthernet0/0/0]q
[R6]int g 0/0/1
[R6-GigabitEthernet0/0/1]is en
[R6-GigabitEthernet0/0/1]q
[R6]int g 0/0/2
[R6-GigabitEthernet0/0/2]is en
[R6-GigabitEthernet0/0/2]q
[R6]int g 0/0/3
[R6-GigabitEthernet0/0/3]is en
[R6-GigabitEthernet0/0/3]q
[R6]int loo 0
[R6-LoopBack0]is en
[R6-LoopBack0]q

R7

[R7]isis 
[R7-isis-1]network-entity 49.0000.0070.0700.7007.00
[R7-isis-1]is-level level-2
Info: IS Level Changed, Resetting ISIS...
[R7-isis-1]q
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]is en
[R7-GigabitEthernet0/0/0]q
[R7]int g 0/0/2
[R7-GigabitEthernet0/0/2]is en
[R7-GigabitEthernet0/0/2]q
[R7]int loo 0
[R7-LoopBack0]is en
[R7-LoopBack0]q

R1和R5是L1路由,无法学习到L2类型的路由信息,只有一条汇总的默认路由,所以需要在L1-2的R2和R6上,在与L1路由器相连的接口上配置路由泄露,才可以学习到详细的路由信息

[R1]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 18       Routes : 21       

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
        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
       56.0.0.0/30  ISIS-L1 15   20          D   16.0.0.2        GigabitEthernet
0/0/1
       67.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

配置路由泄露

R2

[R2]isis 
[R2-isis-1]import-route ?
  bgp     Border Gateway Protocol (BGP) routes
  direct  Connect routes
  isis    Intermediate System to Intermediate System (ISIS) routes
  ospf    Open Shortest Path First (OSPF) routes
  rip     Routing Information Protocol (RIP) routes
  static  Static routes
  unr     User Network Routes (UNR) routes
[R2-isis-1]import-route isis level-2 into level-1 

R6

[R6]isi	
[R6-isis-1]imp isis level-2 into level-1 

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

先配置IBGP协议,建立相连的邻居关系

BGP-ISIS实验_第3张图片

R1的邻居关系为R2,R6

[R1]router id 1.1.1.1
[R1]bgp 56001
[R1-bgp]peer 2.2.2.2 as-number 56001
[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R1-bgp]peer 3.3.3.3 as-n 56001
[R1-bgp]peer 3.3.3.3 con lo 0
[R1-bgp]peer 6.6.6.6 as-number 56001	
[R1-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[R1-bgp]peer 7.7.7.7 as-n 56001
[R1-bgp]peer 7.7.7.7 con lo 0
[R1-bgp]q

R2的邻居关系为R1,R3,R5,R6

[R2]router id 2.2.2.2
[R2]bgp 56001
[R2-bgp]peer 1.1.1.1 as-number 56001
[R2-bgp]peer 1.1.1.1 connect-interface lo 0
[R2-bgp]peer 3.3.3.3 as-n 56001
[R2-bgp]peer 3.3.3.3 con lo 0
[R2-bgp]peer 5.5.5.5 as-n 56001
[R2-bgp]peer 5.5.5.5 con lo 0
[R2-bgp]peer 6.6.6.6 as-n 56001
[R2-bgp]peer 6.6.6.6 con lo 0
[R2-bgp]q

R3的邻居关系为R1,R2,R5,R7

[r3]router id 3.3.3.3
[r3]bgp 56001
[r3-bgp]peer 1.1.1.1 as-n 56001
[r3-bgp]peer 1.1.1.1 con lo 0
[r3-bgp]peer 2.2.2.2 as-n 56001
[r3-bgp]peer 2.2.2.2 con lo 0
[r3-bgp]peer 5.5.5.5 as-n 56001
[r3-bgp]peer 5.5.5.5 con lo 0
[r3-bgp]peer 7.7.7.7 as-n 56001
[r3-bgp]peer 7.7.7.7 con lo 0
[r3-bgp]q

R5的邻居关系为R2,R3,R6,R7

[R5]router id 5.5.5.5
[R5]bgp 56001
[R5-bgp]peer 2.2.2.2 as-n 56001
[R5-bgp]peer 2.2.2.2 con lo 0
[R5-bgp]peer 3.3.3.3 as-n 56001
[R5-bgp]peer 3.3.3.3 con lo 0
[R5-bgp]peer 6.6.6.6 as-n 56001
[R5-bgp]peer 6.6.6.6 con lo 0
[R5-bgp]peer 7.7.7.7 as-n 56001
[R5-bgp]peer 7.7.7.7 con lo 0
[R5-bgp]q

R6的邻居关系是R1,R2,R5,R7

[R6]router id 6.6.6.6
[R6]bgp 56001
[R6-bgp]peer 1.1.1.1 as-n 56001
[R6-bgp]peer 1.1.1.1 con loo 0
[R6-bgp]peer 2.2.2.2 as-n 56001
[R6-bgp]peer 2.2.2.2 con loo 0
[R6-bgp]peer 5.5.5.5 as-n 56001
[R6-bgp]peer 5.5.5.5 con loo 0
[R6-bgp]peer 7.7.7.7 as-n 56001
[R6-bgp]peer 7.7.7.7 con lo 0
[R6-bgp]q

R7的邻居关系是R1,R3,R5,R6

[R7]router id 7.7.7.7
[R7]bgp 56001
[R7-bgp]peer 1.1.1.1 as-n 56001
[R7-bgp]peer 1.1.1.1 con lo 0
[R7-bgp]peer 3.3.3.3 as-nu 56001
[R7-bgp]peer 3.3.3.3 con lo 0
[R7-bgp]peer 5.5.5.5 as-n 56001
[R7-bgp]peer 5.5.5.5 con lo 0
[R7-bgp]peer 6.6.6.6 as-n 56001
[R7-bgp]peer 6.6.6.6 con lo 0
[R7-bgp]q

在R1的BGP内内宣告业务网段

[R1]bgp 56001
[R1-bgp]netwo	
[R1-bgp]network 11.0.0.0 30
[R1-bgp]q

到R5上查看路由,发现并没有学到11.0.0.0/30

这时可以配置路由反射来让其学习到

[R2]bgp 56001
[R2-bgp]reflector cluster-id 100
[R2-bgp]peer 1.1.1.1 reflect-client 

此时就可以发现R5上可以学习到11.0.0.0/30网段了

[R5]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
       11.0.0.0/30  IBGP    255  0          RD   1.1.1.1         GigabitEthernet
0/0/1

继续配置

[R2-bgp]peer 5.5.5.5 reflect-client 

在R6备用路由设置路由反射

[R6]bgp 56001
[R6-bgp]reflector cluster-id 100
[R6-bgp]peer 1.1.1.1 reflect-client 
[R6-bgp]peer 5.5.5.5 reflect-client 
[R6-bgp]q

在省干中配置,实现省内路由互通

R3配置

[r3]bgp 56001
[r3-bgp]reflector cluster-id 200
[r3-bgp]peer 2.2.2.2 reflect-client 

在R7配置

[R7]bgp 56001	
[R7-bgp]reflector cluster-id 200
[R7-bgp]peer 6.6.6.6 reflect-client 

此时省内级别路由已经实现互通

接下来开始处理EBGP邻居关系

R3

[r3]bgp 56001
[r3-bgp]peer 4.4.4.4 as-number 56002
[r3-bgp]peer 4.4.4.4 con lo 0
[r3-bgp]peer 4.4.4.4 ebgp-max-hop 2
[r3-bgp]q
[r3]dis bgp peer

  1.1.1.1         4       56001       72       73     0 01:09:21 Established    
   1
  2.2.2.2         4       56001      139      140     0 02:14:54 Established    
   1
  4.4.4.4         4       56002        0        0     0 00:02:06        Idle

R7

[R7]bgp 56001
[R7-bgp]peer 8.8.8.8 as-n 56002
[R7-bgp]peer 8.8.8.8 con lo 0
[R7-bgp]peer 8.8.8.8 ebgp-max-hop 2
[R7-bgp]q

R4

顺便设置模拟业务网段

[R4]int loo 1
[R4-LoopBack1]ip add 44.0.0.1 30
[R4-LoopBack1]q
[R4]router id 4.4.4.4
[R4-bgp]bgp 56002
  network 4.4.4.4 255.255.255.255
  network 34.0.0.0 255.255.255.252
  network 44.0.0.0 255.255.255.252
  network 48.0.0.0 255.255.255.252
[R4-bgp]peer 8.8.8.8 as-n 56002
[R4-bgp]peer 8.8.8.8 con lo 0
[R4-bgp]peer 3.3.3.3 as-n 56001
[R4-bgp]peer 3.3.3.3 con lo 0
[R4-bgp]peer 3.3.3.3 eb 2
[R4-bgp]q
[R4]dis bgp peer

 BGP local router ID : 4.4.4.4
 Local AS number : 56002
 Total number of peers : 2		  Peers in established state : 0

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

  3.3.3.3         4       56001        0        0     0 00:00:13        Idle    
   0
  8.8.8.8         4       56002        0        0     0 00:18:40        Idle    
   0
[R4]

R8

[R8]router id 8.8.8.8
[R8]bgp 56002
[R8-bgp]
 peer 4.4.4.4 as-number 56002
 peer 4.4.4.4 connect-interface LoopBack0
  network 8.8.8.8 255.255.255.255
  network 48.0.0.0 255.255.255.252
  network 78.0.0.0 255.255.255.252
  peer 4.4.4.4 enable
[R8]bgp 56002
[R8-bgp]peer 7.7.7.7 as-n 56001
[R8-bgp]peer 7.7.7.7 con lo 0
[R8-bgp]peer 7.7.7.7 eb 2
[R8-bgp]q
[R8]

配置静态路由

[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
[R8]dis bgp peer

 BGP local router ID : 8.8.8.8
 Local AS number : 56002
 Total number of peers : 2		  Peers in established state : 1

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

  4.4.4.4         4       56002        0        0     0 00:38:01        Idle    
   0
  7.7.7.7         4       56001        5        7     0 00:02:39 Established    
   1
   
[R4-bgp]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        3.3.3.3/32  Static  60   0          RD   34.0.0.1        GigabitEthernet
0/0/0
        4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0
       11.0.0.0/30  EBGP    255  0          RD   3.3.3.3         GigabitEthernet
0/0/0
       34.0.0.0/30  Direct  0    0           D   34.0.0.2        GigabitEthernet
0/0/0
       34.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
       44.0.0.0/30  Direct  0    0           D   44.0.0.1        LoopBack1
       44.0.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack1
       48.0.0.0/30  Direct  0    0           D   48.0.0.1        GigabitEthernet
0/0/1
       48.0.0.1/32  Direct  0    0           D   127.0.0.1       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

EBGP邻居关系建立,此时,R4R8学到了11.0.0.0/30的EBGP路由

R1中没有学到44.0.0.0/30

在bgp中注入静态路由

[r3-bgp]peer 1.1.1.1 next-hop-local //这条命令是优化下一跳
[r3-bgp]import-route static 

这时R1学到R4的所有网段(IBGP),还没有学到78.0.0.0/30

在R7中注入静态

[R7-bgp]import-route static 

此时学到78.0.0.0/30,下一跳是3.3.3.3

对所有节点进行下一跳优化

[r3-bgp]peer 1.1.1.1 next-hop-local
peer 2.2.2.2 next-hop-local
peer 5.5.5.5 next-hop-local
peer 7.7.7.7 next-hop-local
[R7-bgp]peer 1.1.1.1 next-hop-local
peer 3.3.3.3 next-hop-local
peer 5.5.5.5 next-hop-local
peer 6.6.6.6 next-hop-local

在R1上测试11.0.0.1ping 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=60 ms
    Reply from 44.0.0.1: bytes=56 Sequence=2 ttl=253 time=90 ms
    Reply from 44.0.0.1: bytes=56 Sequence=3 ttl=253 time=100 ms
    Reply from 44.0.0.1: bytes=56 Sequence=4 ttl=253 time=80 ms
    Reply from 44.0.0.1: bytes=56 Sequence=5 ttl=253 time=60 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/78/100 ms

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