HCIP(BGP综合实验)

article/2025/6/7 22:37:57

一、实验拓扑

  • 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: PublicDestinations : 28       Routes : 28       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface12.1.1.0/24  Direct  0    0           D   12.1.1.2        GigabitEthernet
0/0/012.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/012.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0172.16.0.2/32  Direct  0    0           D   127.0.0.1       LoopBack1172.16.0.3/32  OSPF    10   1           D   172.16.1.2      GigabitEthernet
0/0/1172.16.0.4/32  OSPF    10   2           D   172.16.1.2      GigabitEthernet
0/0/1172.16.0.5/32  OSPF    10   1           D   172.16.1.22     GigabitEthernet
0/0/2172.16.0.6/32  OSPF    10   2           D   172.16.1.22     GigabitEthernet
0/0/2172.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: PublicDestinations : 28       Routes : 28       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0172.16.0.2/32  OSPF    10   1           D   172.16.1.21     GigabitEthernet
0/0/0172.16.0.3/32  OSPF    10   2           D   172.16.1.21     GigabitEthernet
0/0/0172.16.0.4/30  Direct  0    0           D   172.16.0.5      LoopBack0172.16.0.4/32  OSPF    10   3           D   172.16.1.21     GigabitEthernet
0/0/0172.16.0.5/32  Direct  0    0           D   127.0.0.1       LoopBack0172.16.0.6/32  OSPF    10   1           D   172.16.1.18     GigabitEthernet
0/0/1172.16.0.7/32  Direct  0    0           D   127.0.0.1       LoopBack0
2.查看邻居表,邻居是否起来,如果邻居没起来,即使后面宣告了网段,也不会全网通,所以这步很关键
R1
[R1]dis bgp peerBGP local router ID : 1.1.1.1    
Local AS number : 1
Total number of peers : 1       Peers in established state : 1Peer            V           AS  MsgRcvd MsgSent OutQ Up/Down      State Pre
fRCV 
12.1.1.2          4            2       14       9    0 00:06:45 Established6
R2
[R2]dis bgp peerBGP local router ID : 2.2.2.2
Local AS number : 64512
Total number of peers : 3      Peers in established state : 3Peer           V          AS  MsgRcvd MsgSent OutQ Up/Down      State Pre
fRCV12.1.1.1         4           1        9      15    0 00:06:32 Established1
172.16.0.3       4       64512       15      12    0 00:05:14 Established2
172.16.0.5       4       64513       14      14    0 00:04:19 Established5
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 : 2Peer          V           AS  MsgRcvd MsgSent OutQ Up/Down    State Pre
fRCV172.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 peerBGP local router ID : 4.4.4.4
Local AS number : 64512
Total number of peers : 2       Peers in established state : 2Peer           V           AS    MsgRcvd MsgSent OutQ Up/Down       State Pre   
fRCV172.16.0.3       4        64512         31      31    0 00:23:13 Established6
172.16.0.7       4        64513         30      29    0 00:23:13 Established5
R5
[R5]dis bgp peerBGP local router ID : 5.5.5.5
Local AS number : 64513
Total number of peers : 2      Peers in established state : 2Peer           V          AS  MsgRcvd MsgSent OutQ Up/Down       State Pre
fRCV172.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 peerBGP local router ID : 6.6.6.6
Local AS number : 64513
Total number of peers : 2      Peers in established state : 2Peer           V          AS  MsgRcvd MsgSent OutQ Up/Down       State Pre
fRcv172.16.0.5       4       64513       30      36    0 00:24:01 Established4
172.16.0.7       4       64513       32      31    0 00:24:06 Established6
R7
[R7]dis bgp peerBGP local router ID : 7.7.7.7
Local AS number : 64513
Total number of peers : 3       Peers in established state : 3Peer           V          AS   MsgRcvd MsgSent OutQ Up/Down       State Pre
fRCV34.1.1.8         4           3        28      34    0 00:25:06 Established1
172.16.0.4       4       64512        30      32    0 00:24:24 Established4
172.16.0.6       4       64513        31      33    0 00:24:32 Established5
R8
[R8]dis bgp peerBGP local router ID : 8.8.8.8
Local AS number : 3
Total number of peers : 1       Peers in established state : 1Peer           V          AS    MsgRcvd MsgSent OutQ Up/Down       State Pre
fRcv34.1.1.7         4          2          34      29    0 00:25:29 Established
7

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

R1
[R1]dis bgp routing-tableBGP Local router ID is 1.1.1.1Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 7Network            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-tableBGP Local router ID is 2.2.2.2Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 8Network            NextHop        MED        LocPrf   PrefVal Path/Ogi*>   172.16.0.1/32      0.0.0.0         0          100       0      1ii  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-tableBGP Local router ID is 3.3.3.3Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal Number of Routes: 13Network            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                           ii  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)3ii  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-tableBGP Local router ID is 4.4.4.4Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP,? - incompleteTotal Number of Routes: 13Network            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      ii  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) 3ii  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)ii  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)ii  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)ii  172.16.7.0/24      172.16.0.7     0          100         0      (64513)i
R5
[R5]dis bgp routing-tableBGP Local router ID is 5.5.5.5Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP,? - incompleteTotal Number of Routes: 10Network            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-tableBGP Local router ID is 6.6.6.6Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP,? - incompleteTotal Number of Routes: 12Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
*>i  172.16.0.1/32      172.16.0.2      0          100         0     (64512) 1ii  172.16.0.5/32      172.16.0.5      0          100         0     i
*>   172.16.0.6/32      0.0.0.0         0                      0     ii  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)ii  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-tableBGP Local router ID is 7.7.7.7Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP,? - incompleteTotal Number of Routes: 12Network            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)ii  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)ii  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-tableBGP Local router ID is 8.8.8.8Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP,? - incompleteTotal Number of Routes: 1Network            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 ms172.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 ms172.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 ms192.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.hkcw.cn/article/jdiFHBFuNX.shtml

相关文章

AI数字人技术革新进行时:井云数字人如何重塑人机交互未来?

老板们注意了!不用反复真人出镜拍摄,AI数字人来帮你做口播,只需3分钟克隆你的形象和声音,输入文案24小时随时都能生成视频! 在元宇宙概念持续升温、虚拟与现实加速融合的当下,AI数字人正以惊人的速度从科幻…

使用n8n工作流编排AI Agent处理爬取的网页信息

目录 使用docker本地部署n8n 例子 1.点击触发节点 2.RSS Read节点 3.Limit节点 4.FireCrawl节点 5.AI Agent节点 6.Aggregate节点 7.Markdown节点 8.Send Email节点 使用docker本地部署n8n docker-compose.yml: version: "3.8" services:n8n:…

【软考】计算机系统构成及硬件基础知识

文章目录 进制码制逻辑运算CPU的构成、CPU性能指标多级存储、存储器分类、高速缓存Cache总线指令、寻址方式、RISC/CISC流水线的概念、周期、计算公式输入输出系统校验码 (奇偶校验、CRC、海明码) 进制 二进制:0、1 八进制:0、1、2、3、4、5、6、7 十进…

纯色图片生成器

就是在测试代码的时候有时候会用到一些纯色的图片进行测试,后面突发奇想才搞了一个纯色生成器玩玩,有需要的可以三连自取哦~ 一键生成高清纯色背景,满足设计、演示、测试需求。支持自定义颜色代码,快速导出PNG。 效果如下&#x…

【知识点】第4章:程序控制结构

文章目录 知识点整理程序控制结构 练习题判断题简答题选择题 知识点整理 程序控制结构 程序由3种基本结构组成:顺序结构、分支结构和循环结构。 顺序结构是程序按照顺序依次执行的一种运行方式。 分支结构是程序根据条件判断结果而选择不同向前执行路径的一种方式…

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

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

win11中使用grep命令

Download grep-2.5.4-setup.exe (GnuWin) 安装后,在控制面板中设置好环境变量 Path中加入: E:\software\GnuWin32\bin 测试:

java30

1.多线程 多线程实现方式: 继承Thread: 注意:使用的是start方法,而不是run方法 实现runnable: 利用Callable接口和Future接口方式实现: 总结: 线程类Thread的成员方法: 注意:父类没有throws异常…

【复习】软件测试

软件测试复习 试题分布 软件测试绪论 软件测试定义 软件测试分类: 软件测试目的: 测试与开发的关系 过程和流程: 过程和流程是对同一事物不同级别的描述,并不是包含关系。过程抓大放小,流程事无巨细。白盒测…

闲谈PMIC和SBC

今天不卷,简单写点。 在ECU设计里,供电芯片选型是逃不开的话题,所以聊聊PMIC或者SBC的各自特点,小小总结下。 PMIC,全称Power Management Intergrated Circuits,听名字就很专业:电源管理&…

风机那么高,叶片怎么检查得到?

也许你曾见过电力巡检员爬到电杆上作检修工作,几层楼的高度尚且让人感觉危险值飙升,那巨人般高大的风机呢? 也许一想就让人脚底发颤。 在那些离我们普通人遥远的山上、海上,有这么一个群体,他们要在灼灼烈日下爬上14…

mac下通过anaconda安装Python

本次分享mac下通过anaconda安装Python、Jupyter Notebook、R。 anaconda安装 点击👉https://www.anaconda.com/download, 点击Mac系统安装包, 选择Mac芯片:苹果芯片 or intel芯片, 选择苹果芯片图形界面安装&#x…

视频转换新选择:XMedia Recode v3.6.1.2,绿色便携版来袭

嘿,各位朋友!今天给大家带来一款超好用的视频转换神器,XMedia Recode。这个工具刚刚出了新版本,v3.6.1.2,完全免费,没有广告,而且是绿色便携版,用起来特别方便。 使用方法超级简单&…

自驾总结_Localization

综述&#xff1a; Localizaiton的主要功能是根据车身姿态信息&#xff0c;Lidar数据&#xff0c;点云高精度地图&#xff0c;组合导航信息&#xff0c;在点云高精度地图覆盖的区域内&#xff08;时速<30km/h&#xff09;完成高精度的位姿输出。 在场景适应能力上&#xff0…

Python数据可视化科技图表绘制系列教程(一)

目录 创建多个坐标图形&#xff08;坐标系&#xff09; 图表的组成 创建图形与子图 创建子图1 创建子图2 创建子图3 创建子图4 创建子图5 添加图表元素 极坐标图1 极坐标图2 【声明】&#xff1a;未经版权人书面许可&#xff0c;任何单位或个人不得以任何形式复制、…

星动纪元的机器人大模型 VPP,泛化能力效果如何?与 VLA 技术的区别是什么?

点击上方关注 “终端研发部” 设为“星标”&#xff0c;和你一起掌握更多数据库知识 VPP 利用了大量互联网视频数据进行训练&#xff0c;直接学习人类动作&#xff0c;减轻了对于高质量机器人真机数据的依赖&#xff0c;且可在不同人形机器人本体之间自如切换&#xff0c;这有望…

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

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

动态规划-1143.最长公共子序列-力扣(LeetCode)

一、题目解析 对于给定了两个字符串中&#xff0c;需要找到最长的公共子序列&#xff0c;也就是两个字符串所共同拥有的子序列。 二、算法原理 1、状态表示 dp[i][j]&#xff1a;表示s1的[0,i]和s2的[0,j]区间内所有子序列&#xff0c;最长子序列的长度 2、状态转移方程 根…

EMQX 社区版单机和集群部署

EMQ 支持 Docker&#xff0c;宿主机&#xff0c;k8s部署&#xff1b;支持单机或集群部署。以下给出EMQX社区版单机和集群部署方法 1. Docker单机部署 官方推荐最小配置&#xff1a;2核 4G 下载容器镜像 docker pull emqx/emqx:5.3.2启动容器 docker run -d --name emqx \-…

小牛电动2025新品矩阵,引领技术普惠新风潮

自2014年成立以来&#xff0c;全球高端智能电动车领导品牌小牛电动已走过十个年头&#xff0c;在全球智能城市出行领域留下了深刻印记。秉持“科技、潮流、自由”的品牌理念&#xff0c;小牛电动致力于改变出行&#xff0c;让城市生活更美好。十年来&#xff0c;小牛电动推出多…