• BGP联邦实验详解 超级超级超级超级超级详细!附有源码自取~


    BGP联邦实验

    image-20220731154646232

    第一步,配置各个路由器接口地址和环回接口

    [R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
    [R1-LoopBack0]ip address 1.1.1.1 24
    
    [R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
    [R2-GigabitEthernet0/0/1]ip address 23.1.1.2 24
    [R2-LoopBack0]ip address 2.2.2.2 24
    
    [R3-GigabitEthernet0/0/1]ip address 34.1.1.3 24
    [R3-GigabitEthernet0/0/0]ip address 23.1.1.3 24
    [R3-LoopBack0]ip address 3.3.3.3 24
    
    [R4-GigabitEthernet0/0/0]ip address 34.1.1.4 24
    [R4-GigabitEthernet0/0/1]ip address 45.1.1.4 24
    [R4-LoopBack0]ip address 4.4.4.4 24
    
    [R5-GigabitEthernet0/0/0]ip address 45.1.1.5 24
    [R5-GigabitEthernet0/0/1]ip address 56.1.1.5 24
    [R5-LoopBack0]ip address 5.5.5.5 24
    
    [R6-GigabitEthernet0/0/0]ip address 56.1.1.6 24
    [R6-GigabitEthernet0/0/1]ip address 67.1.1.6 24
    [R6-LoopBack0]ip address 6.6.6.6 24
    
    [R7-GigabitEthernet0/0/0]ip address 67.1.1.7 24
    [R7-GigabitEthernet0/0/1]ip address 78.1.1.7 24
    [R7-LoopBack0]ip address 7.7.7.7 24
    
    [R8-GigabitEthernet0/0/0]ip address 78.1.1.8 24
    [R8-LoopBack0]ip address 8.8.8.8 24
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29

    第二步,配置静态路由

    [R1]ip route-static 2.2.2.2 24 12.1.1.2 
    [R2]ip route-static 1.1.1.1 24 12.1.1.1
    
    [R7]ip route-static 8.8.8.8 24 78.1.1.8
    [R8]ip route-static 7.7.7.7 24 78.1.1.7
    
    • 1
    • 2
    • 3
    • 4
    • 5

    第三步,在R1,R2间启动BGP协议

    [R1]bgp 1
    [R1-bgp]peer 2.2.2.2 as-number 2
    [R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0
    [R1-bgp]peer 2.2.2.2 ebgp-max-hop 2
    
    [R2]bgp 64512
    [R2-bgp]confederation id 2   
    [R2-bgp]peer 1.1.1.1 as-number 1
    [R2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
    [R2-bgp]peer 1.1.1.1 ebgp-max-hop 2
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    第四步,在R7,R8间启动BGP协议

    [R8]bgp 3
    [R8-bgp]peer 7.7.7.7 as-number 2
    [R8-bgp]peer 7.7.7.7 connect-interface LoopBack 0
    [R8-bgp]peer 7.7.7.7 ebgp-max-hop 2
    
    [R7]bgp 64513 
    [R7-bgp]confederation id 2
    [R7-bgp]peer 8.8.8.8 as-number 3
    [R7-bgp]peer 8.8.8.8 connect-interface LoopBack 0
    [R7-bgp]peer 8.8.8.8 ebgp-max-hop 2
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    第五步,在中间启动OSPF协议

    [R2]ospf 1
    [R2-ospf-1]area 0
    [R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
    [R2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
    
    [R3]ospf 1
    [R3-ospf-1]area 0
    [R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
    [R3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
    [R3-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255
    
    [R4]ospf 1
    [R4-ospf-1]area 0
    [R4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
    [R4-ospf-1-area-0.0.0.0]network 45.1.1.0 0.0.0.255
    [R4-ospf-1-area-0.0.0.0]network 4.4.4.0 0.0.0.255
    
    [R5]ospf 1
    [R5-ospf-1]area 0
    [R5-ospf-1-area-0.0.0.0]network 45.1.1.0 0.0.0.255
    [R5-ospf-1-area-0.0.0.0]network 56.1.1.0 0.0.0.255
    [R5-ospf-1-area-0.0.0.0]network 5.5.5.0 0.0.0.255
    
    [R6]ospf 1 
    [R6-ospf-1]area 0
    [R6-ospf-1-area-0.0.0.0]network 56.1.1.0 0.0.0.255
    [R6-ospf-1-area-0.0.0.0]network 67.1.1.0 0.0.0.255
    [R6-ospf-1-area-0.0.0.0]network 6.6.6.0 0.0.0.255
    
    [R7]ospf 1
    [R7-ospf-1]area 0
    [R7-ospf-1-area-0.0.0.0]network 67.1.1.0 0.0.0.255
    [R7-ospf-1-area-0.0.0.0]network 7.7.7.0 0.0.0.255
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33

    第六步,在中间区域启动联邦

    [R2]bgp 64512
    [R2-bgp]confederation id 2
    [R2-bgp]peer 3.3.3.3 as-number 64512
    [R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0   
    [R2-bgp]peer 3.3.3.3 next-hop-local
    
    [R3]bgp 64512
    [R3-bgp]confederation id 2
    [R3-bgp]peer 2.2.2.2 as-number 64512
    [R3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
    [R3-bgp]peer 2.2.2.2 next-hop-local
    
    [R3-bgp]peer 4.4.4.4 as-number 64512
    [R3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
    [R3-bgp]peer 4.4.4.4 next-hop-local
    
    [R4]bgp 64512
    [R4-bgp]confederation id 2
    [R4-bgp]confederation peer-as 64513
    [R4-bgp]peer 3.3.3.3 as-number 64512
    [R4-bgp]peer 3.3.3.3 connect-interface LoopBack 0 
    [R4-bgp]peer 3.3.3.3 next-hop-local
    
    [R4-bgp]peer 5.5.5.5 as-number 64513
    [R4-bgp]peer 5.5.5.5 connect-interface LoopBack 0
    [R4-bgp]peer 5.5.5.5 ebgp-max-hop 2
    
    [R5]bgp 64513
    [R5-bgp]confederation id 2
    [R5-bgp]confederation peer-as 64512
    [R5-bgp]peer 4.4.4.4 as-number 64512
    [R5-bgp]peer 4.4.4.4 connect-interface LoopBack 0
    [R5-bgp]peer 4.4.4.4 ebgp-max-hop 2
    
    [R5-bgp]peer 6.6.6.6 as-number 64513
    [R5-bgp]peer 6.6.6.6 connect-interface LoopBack 0     
    [R5-bgp]peer 6.6.6.6 next-hop-local
    
    [R6]bgp 64513
    [R6-bgp]confederation id 2
    [R6-bgp]peer 5.5.5.5 as-number 64513
    [R6-bgp]peer 5.5.5.5 connect-interface LoopBack 0
    [R6-bgp]peer 5.5.5.5 next-hop-local
    
    [R6-bgp]peer 7.7.7.7 as-number 64513
    [R6-bgp]peer 7.7.7.7 connect-interface LoopBack 0
    [R6-bgp]peer 7.7.7.7 next-hop-local
    
    [R7]bgp 64513
    [R7-bgp]confederation id 2
    [R7-bgp]peer 6.6.6.6 as-number 64513
    [R7-bgp]peer 6.6.6.6 connect-interface LoopBack 0
    [R7-bgp]peer 6.6.6.6 next-hop-local
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53

    第七步,将R3,R7作为反射器

    [R3]bgp 64512
    [R3-bgp]peer 2.2.2.2 reflect-client 
    
    [R6]bgp 64513
    [R6-bgp]peer 7.7.7.7 reflect-client
    
    • 1
    • 2
    • 3
    • 4
    • 5

    第八步,分别在R1,R8上新建一个环回,并在bgp中宣告(用于检测)

    [R1-LoopBack1]ip address 99.1.1.1 24
    [R1]bgp 1
    [R1-bgp]network 99.1.1.0 24
    
    [R8-LoopBack1]ip address 88.1.1.1 24
    [R8]bgp 3
    [R8-bgp]network 88.1.1.0 24
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    最后检测:

    image-20220731164119979

    image-20220731155954702

    image-20220731164157750

  • 相关阅读:
    顺序栈(数组模拟)
    Win11使用WSL2安装ubuntu,ubuntu桌面配置,ubuntu子系统删除
    村委会外出人员
    NgRx不使用effect,怎样将数据存入store
    大厂常见面试题LRU算法实现
    STM32连接WIFI-ESP8266实战—AP模式运用
    一篇详解,Postman设置token依赖步骤
    MySQL-0-概述-介绍和安装以及MySQL数据模型
    【C++百宝箱】语法总结:引用 | 内联函数 | auto | 范围for循环
    24年大一训练一(东北林业大学)
  • 原文地址:https://blog.csdn.net/weixin_49252364/article/details/126087427