HCIP(BGP综合实验)

news2025/6/5 11:59:29

一、实验拓扑

  • AS 划分
    • AS1:R1(环回 L0:172.16.0.1/32,L1:192.168.1.0/24)
    • AS2:R2、R3、R4、R5、R6、R7(内部运行 OSPF,AS 号为 64512 和 64513 的联盟)
    • AS3:R8(环回 L0:172.16.0.8/32,L1:192.168.2.0/24)
  • 链路与环回
    • 骨干链路:AS2 内部使用 172.16.1.0/24 网段划分为 6 个 / 30 子网(如 172.16.1.0/30、172.16.1.4/30 等)。
    • 建邻环回:各路由器建邻环回地址均属于 172.16.0.0/24 网段(如 R1:172.16.0.1/32,R2:172.16.0.2/32 等)。
    • 业务环回:各路由器业务环回使用剩余子网(如 R3:172.16.3.0/24,R7:172.16.7.0/24)。

二、实验需求

  1. 特殊环回互通
    • AS1 的 192.168.1.0/24 和 AS3 的 192.168.2.0/24 不宣告任何协议,但需通过隧道实现互通。
  2. AS2 配置
    • 使用 172.16.0.0/16 划分 IP,内部运行 OSPF 协议。
  3. BGP 要求
    • 全网设备环回通过 BGP 互通,减少路由条目并避免环路。
    • AS2 内部采用联盟(Sub AS 64512 和 64513),通过路由反射器(R3、R6)优化 IBGP 建邻。

三、实验思路

  1. 子网划分
    • 建邻环回:172.16.0.0/24 划分为 8 个 / 32 地址(R1-R8 各一个)。
    • 骨干链路:172.16.1.0/24 划分为 6 个 / 30 子网(每链路两个 IP)。
    • 业务环回:剩余子网分配给各路由器业务接口(如 172.16.3.0/24 给 R3)。
  2. 协议配置
    • AS2 内部通过 OSPF 实现互通。
    • 配置 BGP 联盟、EBGP/IBGP 邻居关系,使用路由反射器防止环路。
    • 对 192.168.1.0/24 和 192.168.2.0/24 搭建 GRE 隧道,通过静态路由引导流量。

四、实验步骤

1. 接口与环回配置
  • 示例
    • R1:
      • 接口 GE0/0/0:12.1.1.1/24(连接 R2)。
      • 环回 L0:172.16.0.1/32(BGP 建邻),L1:192.168.1.1/24(业务,不宣告)。
    • R2:
      • 接口 GE0/0/0:12.1.1.2/24(连接 R1),GE0/0/1:172.16.1.1/30(连接 R3),GE0/0/2:172.16.1.21/30(连接 R5)。
      • 环回 L1:172.16.0.2/32(BGP 建邻)。
2. OSPF 配置(AS2 内部)
  • 配置示例
    [R2] ospf 1 router-id 2.2.2.2
    [R2-ospf-1-area-0.0.0.0] network 172.16.1.1 0.0.0.0  # 骨干链路接口
    [R2-ospf-1-area-0.0.0.0] network 172.16.1.21 0.0.0.0 # 骨干链路接口
    [R2-ospf-1-area-0.0.0.0] network 172.16.0.2 0.0.0.0 # 建邻环回
    
  • 目标:使 AS2 内部路由器通过 OSPF 学习到彼此的建邻环回和骨干链路路由,确保 BGP 建邻可达。
3. BGP 配置
  • 联盟与邻居关系
    • AS2 联盟:Sub AS 64512(R2、R3、R4)和 64513(R5、R6、R7),联盟 ID 为 2。
    • EBGP 邻居
      • R1 与 R2(直连接口,AS1-AS2)。
      • R7 与 R8(直连接口,AS2-AS3)。
      • 联盟内 EBGP:R2 与 R5、R4 与 R7(环回口建邻,修改 TTL 为 255)。
    • IBGP 邻居
      • R2 与 R3、R3 与 R4(R3 为路由反射器)。
      • R5 与 R6、R6 与 R7(R6 为路由反射器)。
  • 配置示例
    # R1(AS1)与R2(AS2)建立EBGP
    [R1] bgp 1
    [R1-bgp] peer 12.1.1.2 as-number 2
    [R1-bgp-af-ipv4] peer 12.1.1.2 enable
    
    # R2(Sub AS 64512)配置联盟
    [R2] bgp 64512
    [R2-bgp] confederation id 2
    [R2-bgp] confederation peer-as 64513  # 声明联盟内其他Sub AS
    [R2-bgp] peer 172.16.0.5 as-number 64513  # 与R5(Sub AS 64513)建立联盟内EBGP
    [R2-bgp] peer 172.16.0.5 connect-interface LoopBack1  # 使用环回口建邻
    [R2-bgp] peer 172.16.0.5 ebgp-max-hop 255  # 修改TTL防止环回丢包
    
4. 路由宣告与隧道配置
  • BGP 宣告
    • 宣告各路由器的建邻环回和业务环回(除 192.168.1.0/24 和 192.168.2.0/24)。
  • GRE 隧道
    • 目的:实现 192.168.1.0/24 与 192.168.2.0/24 互通。
    • 配置
      # R1隧道配置
      [R1] interface Tunnel0/0/0
      [R1-Tunnel0/0/0] ip address 10.1.1.1 24
      [R1-Tunnel0/0/0] tunnel-protocol gre
      [R1-Tunnel0/0/0] source 172.16.0.1  # 源为R1建邻环回
      [R1-Tunnel0/0/0] destination 172.16.0.8  # 目的为R8建邻环回
      
      # R8隧道配置
      [R8] interface Tunnel0/0/0
      [R8-Tunnel0/0/0] ip address 10.1.1.2 24
      [R8-Tunnel0/0/0] tunnel-protocol gre
      [R8-Tunnel0/0/0] source 172.16.0.8
      [R8-Tunnel0/0/0] destination 172.16.0.1
      
    • 静态路由
      [R1] ip route-static 192.168.2.0 24 10.1.1.2  # 通过隧道转发至R8
      [R8] ip route-static 192.168.1.0 24 10.1.1.1  # 通过隧道转发至R1
      
5. 测试验证
  • BGP 邻居状态:通过dis bgp peer确认所有邻居状态为Established
  • 路由表检查:通过dis bgp routing-table验证各路由器学习到全网环回路由。
  • 连通性测试
    • 普通环回互通:如 R3(172.16.3.1) ping R7(172.16.7.1)。
    • 特殊环回互通:R1(192.168.1.1) ping R8(192.168.2.8),通过 GRE 隧道实现通信。

五、关键技术点

  1. BGP 联盟(Confederation)
    • 将 AS2 划分为两个 Sub AS,通过联盟内 EBGP 解决 IBGP 路由黑洞问题,同时隐藏内部 Sub AS 编号。
  2. 路由反射器(Route Reflector)
    • 在 AS2 的 Sub AS 内设置 R3 和 R6 为路由反射器,减少 IBGP 全连接复杂度,防止环路。
  3. GRE 隧道
    • 用于传输未宣告的特殊网段流量,通过隧道封装跨越 BGP 网络实现互通。
  4. TTL 修改与更新源
    • 联盟内 EBGP 使用环回口建邻时,需修改ebgp-max-hop(TTL)确保数据包可达。

六、具体配置

R1
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 172.16.0.1 32
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.1 24
[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.1.1.2 as-number 2
[R1-bgp]ipv4-family unicast 
[R1-bgp-af-ipv4]peer 12.1.1.2 enable
[R1-bgp-af-ipv4]network 172.16.0.1 32
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.1.1.1 255.255.255.0 
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 172.16.0.1
[R1-Tunnel0/0/0]destination 172.16.0.8
[R1]ip route-static 192.168.2.0 255.255.255.0 10.1.1.2
R2
[Huawei]sysname R2
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 172.16.1.1 30
[R2]interface GigabitEthernet 0/0/2
[R2-GigabitEthernet0/0/2]ip address 172.16.1.21 30
[R2]interface LoopBack 1
[R2-LoopBack1]ip address 172.16.0.2 32
[R2]ospf router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 172.16.1.21 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[R2]bgp 64512
[R2-bgp]confederation id 2
[R2-bgp]router-id 2.2.2.2
[R2-bgp]confederation peer-as 64513
[R2-bgp]peer 12.1.1.1 as-number 1
[R2]bgp 64512
[R2-bgp]peer 172.16.0.5 as-number 64513
[R2-bgp]peer 172.16.0.5 connect-interface LoopBack 1
[R2-bgp]peer 172.16.0.5 ebgp-max-hop
[R2-bgp]ipv4-family unicast 
[R2-bgp-af-ipv4]peer 172.16.0.5 enable 
[R2-bgp]peer 172.16.0.3 as-number 64512
[R2-bgp]peer 172.16.0.3 connect-interface LoopBack 1
[R2-bgp]peer 172.16.0.3 next-hop-local 
[R2-bgp]ipv4-family unicast 
[R2-bgp-af-ipv4]peer 172.16.0.3 enable
[R2-bgp-af-ipv4]network 172.16.0.2 32 
R3
[Huawei]sysname R3
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.1.2 30
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 172.16.1.5 30
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 172.16.0.3 24
[R3]interface LoopBack 1
[R3-LoopBack1]ip address 172.16.3.1 24
[R3]ospf router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.1.2 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 172.16.1.5 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 172.16.3.1 0.0.0.0
[R3]bgp 64512
[R3-bgp]router-id 3.3.3.3
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.0.2 as-number 64512
[R3-bgp]peer 172.16.0.2 connect-interface LoopBack 0
[R3-bgp]peer 172.16.0.2 next-hop-local
[R3-bgp]ipv4-family unicast 
[R3-bgp-af-ipv4]peer 172.16.0.2 enable
[R3-bgp]peer 172.16.0.4 as-number 64512
[R3-bgp]peer 172.16.0.4 connect-interface LoopBack 0
[R3-bgp]peer 172.16.0.4 next-hop-local
[R3-bgp]ipv4-family unicast
[R3-bgp-af-ipv4]peer 172.16.0.4 enable
[R3-bgp]peer 172.16.0.2 reflect-client
[R3-bgp-af-ipv4]network 172.16.0.3 32
[R3-bgp-af-ipv4]network 172.16.3.1 24
R4
[Huawei]sysname R4
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 172.16.1.6 30
[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip address 172.16.1.9 30
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 172.16.0.4 32
[R4]interface LoopBack 1
[R4-LoopBack1]ip address 172.16.4.1 24
[R4]ospf router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 172.16.1.6 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 172.16.1.9 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 172.16.0.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 172.16.4.1 0.0.0.0
[R4]bgp 64512
[R4-bgp]router-id 4.4.4.4
[R4-bgp]confederation id 2
[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.0.7 as-number 64513
[R4-bgp]peer 172.16.0.7 connect-interface LoopBack 0
[R4-bgp]peer 172.16.0.7 ebgp-max-hop
[R4-bgp]ipv4-family unicast
[R4-bgp-af-ipv4]peer 172.16.0.7 enable
[R4-bgp]peer 172.16.0.4 as-number 64512
[R4-bgp]peer 172.16.0.3 connect-interface LoopBack 0
[R4-bgp]peer 172.16.0.3 next-hop-local
[R4-bgp]ipv4-family unicast
[R4-bgp-af-ipv4]peer 172.16.0.3 enable 
[R4-bgp-af-ipv4]network 172.16.0.4 32
[R4-bgp-af-ipv4]network 172.16.4.1 24
R5
[Huawei]sysname R5
[R5]interface GigabitEthernet 0/0/0
[R5-GigabitEthernet0/0/0]ip address 172.16.1.22 30
[R5]interface GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]ip address 172.16.1.17 30
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 172.16.0.5 32
[R5-LoopBack0]ip address 172.16.0.5 30
[R5]interface LoopBack 1
[R5-LoopBack1]ip address 172.16.5.1 24
[R5]ospf router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.1.22 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 172.16.1.17 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 172.16.5.1 0.0.0.0
[R5]bgp 64513
[R5-bgp]router-id 5.5.5.5
[R5-bgp]confederation id 2
[R5-bgp]confederation  peer-as 64512
[R5-bgp]peer 172.16.0.2 as-number 64512
[R5-bgp]peer 172.16.0.2 connect-interface LoopBack 0
[R5-bgp]peer 172.16.0.2 ebgp-max-hop
[R5-bgp]ipv4-family unicast
[R5-bgp-af-ipv4]peer 172.16.0.2 enable
[R5-bgp]peer 172.16.0.6 as-number 64513
[R5-bgp]peer 172.16.0.6 connect-interface LoopBack 0
[R5-bgp]peer 172.16.0.6 next-hop-local 	
[R5-bgp]ipv4-family unicast 	
[R5-bgp-af-ipv4]peer 172.16.0.6 enable 
[R5-bgp-af-ipv4]network 172.16.0.5 32
[R5-bgp-af-ipv4]network 172.16.5.1 24
R6
[Huawei]sysname R6
[R6]interface GigabitEthernet 0/0/0
[R6-GigabitEthernet0/0/0]ip address 172.16.1.18 30
[R6]interface GigabitEthernet 0/0/1
[R6-GigabitEthernet0/0/1]ip address 172.16.1.13 30
[R6]interface LoopBack 0
[R6-LoopBack0]ip address 172.16.0.6 32
[R6]interface LoopBack 1
[R6-LoopBack1]ip address 172.16.6.1 24
[R6]ospf router-id 6.6.6.6
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 172.16.1.18 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 172.16.1.13 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 172.16.0.6 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 172.16.6.1 0.0.0.0
[R6]bgp 64513
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 2	
[R6-bgp]peer 172.16.0.5 as-number 64513
[R6-bgp]peer 172.16.0.5 connect-interface LoopBack 0
[R6-bgp]peer 172.16.0.5 next-hop-local 
[R6-bgp]ipv4-family unicast 
[R6-bgp-af-ipv4]peer 172.16.0.5 enable
[R6-bgp]peer 172.16.0.7 as-number 64513
[R6-bgp]peer 172.16.0.7 connect-interface LoopBack 0
[R6-bgp]peer 172.16.0.7 next-hop-local 
[R6-bgp]ipv4-family unicast 
[R6-bgp-af-ipv4]peer 172.16.0.7 enable 
[R6-bgp]peer 172.16.0.7 reflect-client 
[R6-bgp-af-ipv4]network 172.16.0.6 32
[R6-bgp-af-ipv4]network 172.16.6.1 24
R7
[Huawei]sysname R7
[R7]interface GigabitEthernet 0/0/0
[R7-GigabitEthernet0/0/0]ip address 172.16.1.14 30
[R7]interface GigabitEthernet 0/0/2
[R7-GigabitEthernet0/0/2]ip address 34.1.1.7 24
[R7]interface LoopBack 0
[R7-LoopBack0]ip address 172.16.0.7 32
[R7]interface LoopBack 1
[R7-LoopBack1]ip address 172.16.7.1 24
[R7]ospf router-id 7.7.7.7
[R7-ospf-1-area-0.0.0.0]network 172.16.1.14 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 172.16.1.10 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 172.16.0.7 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 172.16.7.1 0.0.0.0
[R7]bgp 64513
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 2
[R7-bgp]confederation peer-as 64512
[R7-bgp]peer 34.1.1.8 as-number 3
[R7-bgp]ipv4-family unicast 
[R7-bgp-af-ipv4]peer 34.1.1.8 enable
[R7]bgp 64513
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 2
[R7-bgp]confederation peer-as 64512
[R7-bgp]peer 172.16.0.4 as-number 64512
[R7-bgp]peer 172.16.0.4 connect-interface LoopBack 0
[R7-bgp]peer 172.16.0.4 ebgp-max-hop
[R7-bgp]ipv4-family unicast
[R7-bgp-af-ipv4]peer 172.16.0.4 enable 
[R7-bgp]peer 172.16.0.6 as-number 64513
[R7-bgp]peer 172.16.0.6 connect-interface LoopBack 0
[R7-bgp]peer 172.16.0.6 next-hop-local 
[R7-bgp]ipv4-family unicast 
[R7-bgp-af-ipv4]peer 172.16.0.6 enable 
[R7-bgp-af-ipv4]network 172.16.0.7 32
[R7-bgp-af-ipv4]network 172.16.7.1 24
R8
[Huawei]sysname R8
[R8]interface GigabitEthernet 0/0/0
[R8-GigabitEthernet0/0/0]ip address 34.1.1.8 24
[R8]interface LoopBack 0
[R8-LoopBack0]ip address 172.16.0.8 32
[R8]interface LoopBack 1
[R8-LoopBack1]ip address 192.168.2.8 24
[R8]bgp 3
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 34.1.1.7 as-number 2
[R8-bgp]ipv4-family unicast 
[R8-bgp-af-ipv4]peer 34.1.1.7 enable 
[R8]int Tunnel 0/0/0
[R8-Tunnel0/0/0]ip address 10.1.1.2 255.255.255.0 
[R8-Tunnel0/0/0] tunnel-protocol gre
[R8-Tunnel0/0/0] source 172.16.0.8
[R8-Tunnel0/0/0]destination 172.16.0.1
[R8]ip route-static 192.168.1.0 24 10.1.1.1

 七、检查配置

1.查看R2-R7路由器的路由表,看表中是否学习到R2-R7的环回地址,这非常重要,关系到BGP的建邻。下图以R2和R5的路由表为例:
R2
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 28       Routes : 28       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       12.1.1.0/24  Direct  0    0           D   12.1.1.2        GigabitEthernet
0/0/0
       12.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
     12.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
     172.16.0.2/32  Direct  0    0           D   127.0.0.1       LoopBack1
     172.16.0.3/32  OSPF    10   1           D   172.16.1.2      GigabitEthernet
0/0/1
     172.16.0.4/32  OSPF    10   2           D   172.16.1.2      GigabitEthernet
0/0/1
     172.16.0.5/32  OSPF    10   1           D   172.16.1.22     GigabitEthernet
0/0/2
     172.16.0.6/32  OSPF    10   2           D   172.16.1.22     GigabitEthernet
0/0/2
     172.16.0.7/32  OSPF    10   3           D   172.16.1.22     GigabitEthernet
R5
[R5]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 28       Routes : 28       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
     172.16.0.2/32  OSPF    10   1           D   172.16.1.21     GigabitEthernet
0/0/0
     172.16.0.3/32  OSPF    10   2           D   172.16.1.21     GigabitEthernet
0/0/0
     172.16.0.4/30  Direct  0    0           D   172.16.0.5      LoopBack0
     172.16.0.4/32  OSPF    10   3           D   172.16.1.21     GigabitEthernet
0/0/0
     172.16.0.5/32  Direct  0    0           D   127.0.0.1       LoopBack0
     172.16.0.6/32  OSPF    10   1           D   172.16.1.18     GigabitEthernet
0/0/1
     172.16.0.7/32  Direct  0    0           D   127.0.0.1       LoopBack0
2.查看邻居表,邻居是否起来,如果邻居没起来,即使后面宣告了网段,也不会全网通,所以这步很关键
R1
[R1]dis bgp peer

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

  Peer            V           AS  MsgRcvd MsgSent OutQ Up/Down      State Pre
fRCV 
12.1.1.2          4            2       14       9    0 00:06:45 Established
 6
R2
[R2]dis bgp peer

BGP local router ID : 2.2.2.2
Local AS number : 64512
Total number of peers : 3      Peers in established state : 3
 
  Peer           V          AS  MsgRcvd MsgSent OutQ Up/Down      State Pre
fRCV

12.1.1.1         4           1        9      15    0 00:06:32 Established
 1
172.16.0.3       4       64512       15      12    0 00:05:14 Established
 2
172.16.0.5       4       64513       14      14    0 00:04:19 Established
 5
R3
[R3]dis bgp peer
BGP local router ID : 3.3.3.3
Local AS number : 64512
Total number of peers : 2      Peers in established state : 2

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

172.16.0.2      4        64512       24      20    0 00:09:42 Established
5
172.16.0.4      4        64512       30      30    0 00:22:33 Established
6
R4
[R4]dis bgp peer

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

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

172.16.0.3       4        64512         31      31    0 00:23:13 Established
 6
172.16.0.7       4        64513         30      29    0 00:23:13 Established
 5
R5
[R5]dis bgp peer

BGP local router ID : 5.5.5.5
Local AS number : 64513
Total number of peers : 2      Peers in established state : 2
 
  Peer           V          AS  MsgRcvd MsgSent OutQ Up/Down       State Pre
fRCV

172.16.0.2       4       64512       19      22    0 00:09:50 Established
3
172.16.0.6       4       64513       34      29    0 00:23:39 Established
5
R6
[R6]dis bgp peer

BGP local router ID : 6.6.6.6
Local AS number : 64513
Total number of peers : 2      Peers in established state : 2
 
  Peer           V          AS  MsgRcvd MsgSent OutQ Up/Down       State Pre
fRcv

172.16.0.5       4       64513       30      36    0 00:24:01 Established
 4
172.16.0.7       4       64513       32      31    0 00:24:06 Established
 6
R7
[R7]dis bgp peer

BGP local router ID : 7.7.7.7
Local AS number : 64513
Total number of peers : 3       Peers in established state : 3

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

34.1.1.8         4           3        28      34    0 00:25:06 Established
 1
172.16.0.4       4       64512        30      32    0 00:24:24 Established
 4
172.16.0.6       4       64513        31      33    0 00:24:32 Established
 5
R8
[R8]dis bgp peer

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

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

34.1.1.7         4          2          34      29    0 00:25:29 Established
7

3.查看bgp路由表的学习情况。

R1
[R1]dis bgp routing-table

 BGP Local router ID is 1.1.1.1
 Status codes: * - valid, > - best, d - damped,
              h - history, i - internal, s - suppressed, S - Stale
              Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 7
     Network            NextHop        MED        LocPrf   PrefVal Path/Ogn

*>   172.16.0.1/32      0.0.0.0         0                    0      i
*>   172.16.0.8/32      12.1.1.2                             0      2 3i
*>   172.16.3.0/24      12.1.1.2                             0      2i
*>   172.16.4.0/24      12.1.1.2                             0      2i
*>   172.16.5.0/24      12.1.1.2                             0      2i
*>   172.16.6.0/24      12.1.1.2                             0      2i
*>   172.16.7.0/24      12.1.1.2                             0      2i
R2
[R2]dis bgp routing-table

 BGP Local router ID is 2.2.2.2
 Status codes: * - valid, > - best, d - damped,
              h - history, i - internal, s - suppressed, S - Stale
              Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 8
     Network            NextHop        MED        LocPrf   PrefVal Path/Ogi

*>   172.16.0.1/32      0.0.0.0         0          100       0      1i
  i  172.16.0.5/32      172.16.0.5      0          100              (64513)i
*>i  172.16.0.8/32      172.16.0.7      0          100       0      (64513)3i
*>i  172.16.3.0/24      172.16.0.3      0          100       0      i
*>i  172.16.4.0/24      172.16.0.4      0          100       0      i
*>i  172.16.5.0/24      172.16.0.5      0          100       0      (64513)i
*>i  172.16.6.0/24      172.16.0.6      0          100       0      (64513)i
*>i  172.16.7.0/24      172.16.0.7      0          100       0      (64513)i
R3
[R3]dis bgp routing-table

 BGP Local router ID is 3.3.3.3
 Status codes: * - valid, > - best, d - damped,
              h - history, i - internal, s - suppressed, S - Stale
              Origin : i - IGP, e - EGP, ? - incomplete


Total Number of Routes: 13
     Network            NextHop        MED        LocPrf   PrefVal Path/Ogn
*>i  172.16.0.1/32      172.16.0.2      0          100       0      i
*>   172.16.0.3/32      0.0.0.0 0       0                           i
  i  172.16.0.4/32      172.16.0.4      0          100       0      i
*>i  172.16.0.8/32      172.16.0.7      0          100       0      (64513)3i
  i  172.16.0.9/32      172.16.0.7      0          100       0      (64513)3i
*>   172.16.3.0/24      0.0.0.0 0       0                           i
*>i  172.16.4.0/24      172.16.0.4      0          100       0      (64513)i
*>i  172.16.5.0/24      172.16.0.5      0          100       0      (64513)i
*>i  172.16.6.0/24      172.16.0.6      0          100       0      (64513)i
*>i  172.16.7.0/24      172.16.0.7      0          100       0      (64513)i
R4
[R4]dis bgp routing-table

 BGP Local router ID is 4.4.4.4
 Status codes: * - valid, > - best, d - damped,
              h - history, i - internal, s - suppressed, S - Stale
              Origin : i - IGP, e - EGP,? - incomplete


Total Number of Routes: 13
     Network            NextHop       MED        LocPrf     PrefVal Path/Ogn
*>i  172.16.0.1/32      172.16.0.2     0          100         0      li
*>   172.16.0.4/32      0.0.0.0        0                      0      i
  i  172.16.0.7/32      172.16.0.7     0          100         0      (64513)i
*>i  172.16.0.8/32      172.16.0.7     0          100         0      (64513) 3i
  i  172.16.0.9/32      172.16.0.7     0          100         0      (64513) 3i
*>i  172.16.3.0/24      172.16.0.3     0          100         0      i
*>   172.16.4.0/24      0.0.0.0        0                      0      i
*>i  172.16.5.0/24      172.16.0.5     0          100         0      (64513)i
  i  172.16.5.0/24      172.16.0.5     0          100         0      (64513)i
*>i  172.16.6.0/24      172.16.0.6     0          100         0      (64513)i
  i  172.16.6.0/24      172.16.0.6     0          100         0      (64513)i
*>i  172.16.7.0/24      172.16.0.7     0          100         0      (64513)i
  i  172.16.7.0/24      172.16.0.7     0          100         0      (64513)i
R5
[R5]dis bgp routing-table
 BGP Local router ID is 5.5.5.5
 Status codes: * - valid, > - best, d - damped,
               h - history, i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP,? - incomplete


Total Number of Routes: 10
     Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
*>i  172.16.0.1/32      172.16.0.2      0          100        0      (64512)1i
*>i  172.16.0.2/32      12.1.1.1        0          100        0      (64512)1i
*>   172.16.0.5/32      0.0.0.0         0                     0      i    
  i  172.16.0.6/32      172.16.0.6      0          100        0      i
*>i  172.16.0.8/32      172.16.0.7      0          100        0      3i
*>i  172.16.3.0/24      172.16.0.3      0          100        0      (64512)i
*>i  172.16.4.0/24      172.16.0.4      0          100        0      (64512)i
*>   172.16.5.0/24      0.0.0.0         0                     0      i
*>i  172.16.6.0/24      172.16.0.6      0          100        0      i
*>i  172.16.7.0/24      172.16.0.7      0          100        0      i
R6
[R6]dis bgp routing-table
 BGP Local router ID is 6.6.6.6
 Status codes: * - valid, > - best, d - damped,
               h - history, i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP,? - incomplete


Total Number of Routes: 12
     Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
*>i  172.16.0.1/32      172.16.0.2      0          100         0     (64512) 1i
  i  172.16.0.5/32      172.16.0.5      0          100         0     i
*>   172.16.0.6/32      0.0.0.0         0                      0     i
  i  172.16.0.7/32      172.16.0.7      0          100         0     i
*>i  172.16.0.8/32      172.16.0.7      0          100         0     3i
*>i  172.16.3.0/24      172.16.0.3      0          100         0     (64512)i
*>i  172.16.3.0/24      172.16.0.3      0          100         0     (64512)i
*>i  172.16.4.0/24      172.16.0.4      0          100         0     (64512)i
  i  172.16.4.0/24      172.16.0.4      0          100         0     (64512)i
*>i  172.16.5.0/24      172.16.0.5      0          100         0     i
*>   172.16.6.0/24      0.0.0.0         0                      0     i
*>i  172.16.7.0/24      172.16.0.7      0          100         0     i
R7
[R7]dis bgp routing-table
 BGP Local router ID is 7.7.7.7
 Status codes: * - valid, > - best, d - damped,
               h - history, i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP,? - incomplete


Total Number of Routes: 12
     Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
*>i  172.16.0.1/32      172.16.0.2      0          100        0     (64512)1i 
  i  172.16.0.4/32      172.16.0.4      0          100        0     (64512)i
  i  172.16.0.6/32      172.16.0.6      0          100        0     i
*>   172.16.0.7/32      0.0.0.0         0                     0     i
*>   172.16.0.8/32      34.1.1.8        0                     0     3i
*>i  172.16.3.0/24      172.16.0.3      0          100        0     (64512)i
*>i  172.16.3.0/24      172.16.0.3      0          100        0     (64512)i
*>i  172.16.4.0/24      172.16.0.4      0          100        0     (64512)i
  i  172.16.4.0/24      172.16.0.4      0          100        0     (64512)i
*>i  172.16.5.0/24      172.16.0.5      0          100        0     i
*>i  172.16.6.0/24      172.16.0.6      0          100        0     i
*>   172.16.7.0/24      0.0.0.0         0                     0     i
R8
[R8]dis bgp routing-table
 BGP Local router ID is 8.8.8.8
 Status codes: * - valid, > - best, d - damped,
               h - history, i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP,? - incomplete


Total Number of Routes: 1
     Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

*>   172.16.0.1/32      34.1.1.7                              0      2  li

4.测试:全网通

R1
[R1]ping -a 172.16.0.1 172.16.0.8
PING 172.16.0.8: 56 data bytes, press CTRL C to break
Reply from 172.16.0.8: bytes=56 Sequence=1 ttl=251 time=70 ms
Reply from 172.16.0.8: bytes=56 Sequence=2 ttl=251 time=50 ms
Reply from 172.16.0.8: bytes=56 Sequence=3 ttl=251 time=50 ms
Reply from 172.16.0.8: bytes=56 Sequence=4 ttl=251 time=50 ms
Reply from 172.16.0.8: bytes=56 Sequence=5 ttl=251 time=50 ms
R3
[R3]ping -a 172.16.3.1 172.16.0.1
PING 172.16.0.1: 56 data bytes, press CTRL C to break
Reply from 172.16.0.1: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 172.16.0.1: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 172.16.0.1: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 172.16.0.1: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 172.16.0.1: bytes=56 Sequence=5 ttl=254 time=30 ms

172.16.0.1 ping statistics
5 packet (s) transmitted
5 packet (s) received
0.00% packet loss
round-trip min/avg/max = 20/28/30 ms

[R3]ping -a 172.16.3.1 172.16.7.1
PING 172.16.7.1: 56 data bytes, press CTRL C to break
Reply from 172.16.7.1: bytes=56 Sequence=1 ttl=252 time=50 ms
Reply from 172.16.7.1: bytes=56 Sequence=2 ttl=252 time=50 ms
Reply from 172.16.7.1: bytes=56 Sequence=3 ttl=252 time=30 ms
Reply from 172.16.7.1: bytes=56 Sequence=4 ttl=252 time=40 ms
Reply from 172.16.7.1: bytes=56 Sequence=5 ttl=252 time=40 ms

172.16.7.1 ping statistics
5 packet (s) transmitted
5 packet (s) received
0.00% packet loss
round-trip min/avg/max = 30/42/50 ms
R8
[R8]ping -a 192.168.2.8 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 tt1=255 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=255 time=50 ms

192.168.1.1 ping statistics
5 packet (s) transmitted
5 packet (s) received
0.00% packet loss
round-trip min/avg/max = 40/44/50 ms

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2398142.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Attention Is All You Need (Transformer) 以及Transformer pytorch实现

参考https://zhuanlan.zhihu.com/p/569527564 Attention Is All You Need (Transformer) 是当今深度学习初学者必读的一篇论文。 一. Attention Is All You Need (Transformer) 论文精读 1. 知识准备 机器翻译,就是将某种语言的一段文字翻译成另一段文字。 由…

uniapp+vue2+uView项目学习知识点记录

持续更新中... 1、发送给朋友,分享到朋友圈功能开启 利用onShareAppMessage和onShareTimeline生命周期函数,在script中与data同级去写 // 发送给朋友 onShareAppMessage() {return {title: 清清前端, // 分享标题path: /pages/index/index, // 分享路…

精美的软件下载页面HTML源码:现代UI与动画效果的完美结合

精美的软件下载页面HTML源码:现代UI与动画效果的完美结合 在数字化产品推广中,一个设计精良的下载页面不仅能提升品牌专业度,还能显著提高用户转化率。本文介绍的精美软件下载页面HTML源码,通过现代化UI设计与丰富的动画效果&…

车载诊断架构 --- DTC消抖参数(Trip Counter DTCConfirmLimit )

我是穿拖鞋的汉子,魔都中坚持长期主义的汽车电子工程师。 老规矩,分享一段喜欢的文字,避免自己成为高知识低文化的工程师: 做到欲望极简,了解自己的真实欲望,不受外在潮流的影响,不盲从,不跟风。把自己的精力全部用在自己。一是去掉多余,凡事找规律,基础是诚信;二是…

javaEE->IO:

文件: 操作系统中会把很多 硬件设备 和 软件资源 抽象成“文件”,统一进行管理。 大部分谈到的文件,都是指 硬盘的文件,文件就相当于是针对“硬盘”数据的一种抽象 硬盘: 1.机械硬盘:便宜 2.固态硬盘&…

Oracle 用户/权限/角色管理

1. 用户 1.1. 用户的创建和删除 1.1.1. 创建用户 create user user identified {by password | externally} [ default tablespace tablespace ] [ temporary tablespace tablespace ] [ quota {integer [k | m ] | unlimited } on tablespace [ quota {integer [k | m ] | …

工厂方法模式深度解析:从原理到应用实战

作者简介 我是摘星,一名全栈开发者,专注 Java后端开发、AI工程化 与 云计算架构 领域,擅长Python技术栈。热衷于探索前沿技术,包括大模型应用、云原生解决方案及自动化工具开发。日常深耕技术实践,乐于分享实战经验与…

python可视化:端午假期旅游火爆原因分析

python可视化:端午假期旅游火爆原因分析 2025年的旅游市场表现强劲: 2025年端午假期全社会跨区域人员流动量累计6.57亿人次,日均2.19亿人次,同比增长3.0%。入境游订单同比大涨近90%,门票交易额(GMV&#…

SOC-ESP32S3部分:28-BLE低功耗蓝牙

飞书文档https://x509p6c8to.feishu.cn/wiki/CHcowZMLtiinuBkRhExcZN7Ynmc 蓝牙是一种短距的无线通讯技术,可实现固定设备、移动设备之间的数据交换,下图是一个蓝牙应用的分层架构,Application部分则是我们需要实现的内容,Protoc…

Git-flow流

Git git是版本控制软件,一般用来做代码版本控制 github是一个免费版本控制仓库是国内外很多开源项目的集中地,其本体是一个git服务器 Git初始化操作 git init 初始化仓库 git status 查看当前仓库的状态 git add . 将改动的文件加到暂存区 gi…

VirtualBox给Rock Linux9.x配置网络

写这篇文章之前,先说明一下,我参考的是我之前写的《VirtualBox Linux网络配置》 我从CentOS7转到了Rock9,和配置Centos7一样,主流程没有变化,变化的是Rock9.x中的配置文件和使用的命令。 我再说一次,因为主…

知识图谱增强的大型语言模型编辑

https://arxiv.org/pdf/2402.13593 摘要 大型语言模型(LLM)是推进自然语言处理(NLP)任务的关键,但其效率受到不准确和过时知识的阻碍。模型编辑是解决这些挑战的一个有前途的解决方案。然而,现有的编辑方法…

.NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想

在当今数据驱动的时代,向量数据库(Vector Database)作为一种新兴的数据库技术,正逐渐成为软件开发领域的重要组成部分。特别是在 .NET 生态系统中,向量数据库的应用为开发者提供了构建智能、高效应用程序的新途径。 一…

【claude+deepseek+gemini】基于李群李代数和螺旋理论工业机器人控制系统软件UI设计

claude的首次设计html是最佳的。之后让deepseek和gemini根据claude的UI设计进行改进设计。。。当然可以尝试很多次,也可以让他们之间来回不断改进…… claude deepseek-r1 0528 上图为deepseek首次设计,下面为改进设计 …… Gemini 2.5 Pro 0506 &#x…

阿里云国际站,如何通过代理商邀请的链接注册账号

阿里云国际站:如何通过代理商邀请链接注册,解锁“云端超能力”与专属福利? 渴望在全球化浪潮中抢占先机?想获得阿里云国际站的海量云资源、遍布全球的加速节点与前沿AI服务,同时又能享受专属折扣、VIP级增值服务支持或…

乾坤qiankun的使用

vue2 为主应用 react 为子应用 在项目中安装乾坤 yarn add qiankun # 或者 npm i qiankun -Svue主应用 在main.js中新增 (需要注意的是路由模型为history模式) registerMicroApps([{name: reactApp,entry: //localhost:3011,container: #container,/…

PH热榜 | 2025-06-03

1. Knowledge 标语:像认识朋友一样去销售给潜在客户,因为你其实了解他们! 介绍:Knowledge 是一个针对个人的销售智能平台,它利用行为数据和心理测评来识别市场上的潜在买家,并指导销售团队以最真实、最有…

论文略读: STREAMLINING REDUNDANT LAYERS TO COMPRESS LARGE LANGUAGE MODELS

2025 ICLR 判断模型层的重要性->剪去不重要的层(用轻量网络代替) 这种方法只减少了层数量,所以可以用常用的方法加载模型 层剪枝阶段 通过输入与输出的余弦相似度来判断各个层的重要性 具有高余弦相似度的层倾向于聚集在一起&#xff0c…

mapbox高阶,生成并加载等时图

👨‍⚕️ 主页: gis分享者 👨‍⚕️ 感谢各位大佬 点赞👍 收藏⭐ 留言📝 加关注✅! 👨‍⚕️ 收录于专栏:mapbox 从入门到精通 文章目录 一、🍀前言1.1 ☘️mapboxgl.Map 地图对象1.2 ☘️mapboxgl.Map style属性1.3 ☘️Fill面图层样式1.4 ☘️symbol符号图层…

DeepSeek眼中的文明印记:山海经

一、山海经到底是怎么回事? 《山海经》是中国古代一部极具神秘色彩的文化典籍,成书时间跨度较大(大致从战国至汉代),内容庞杂,涉及神话、地理、物产、巫术、医学、民俗等多个领域。关于它的性质&#xff0…