• BGP综合部署


    目的:

    实现全网互通,并按要求的路线进行数据传输。

    部署拓扑图:

    配置文件:

    R1:
    #
    sysname r1
    #
    interface GigabitEthernet0/0/0
     ip address 12.1.1.1 255.255.255.0
    interface LoopBack0
     ip address 1.1.1.1 255.255.255.255
    #
    bgp 100
     peer 2.2.2.2 as-number 100
     peer 2.2.2.2 connect-interface LoopBack0
     #
    network 1.1.1.1 255.255.255.255
      network 12.1.1.0 255.255.255.0
      peer 2.2.2.2 enable
    #
    ospf 1 router-id 1.1.1.1
     area 0.0.0.0
      network 1.1.1.1 0.0.0.0
      network 12.1.1.0 0.0.0.255

    R2:
    #
    sysname r2
    #
    interface GigabitEthernet0/0/0
     ip address 12.1.1.2 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     ip address 28.1.1.2 255.255.255.0
    #
    interface GigabitEthernet0/0/2
     ip address 23.1.1.2 255.255.255.0
    #
    interface LoopBack0
     ip address 2.2.2.2 255.255.255.255
    #
    bgp 100
     router-id 2.2.2.2
     peer 1.1.1.1 as-number 100
     peer 1.1.1.1 connect-interface LoopBack0
     peer 3.3.3.3 as-number 200
     peer 3.3.3.3 ebgp-max-hop 255
     peer 3.3.3.3 connect-interface LoopBack0
     peer 8.8.8.8 as-number 300
     peer 8.8.8.8 ebgp-max-hop 255
     peer 8.8.8.8 connect-interface LoopBack0
     #
    network 1.1.1.1 255.255.255.255
      network 2.2.2.2 255.255.255.255
      network 3.3.3.3 255.255.255.255
      network 8.8.8.8 255.255.255.255
      network 12.1.1.0 255.255.255.0
      network 23.1.1.0 255.255.255.0
      network 28.1.1.0 255.255.255.0
      peer 1.1.1.1 enable
      peer 1.1.1.1 next-hop-local
      peer 3.3.3.3 enable
      peer 8.8.8.8 enable
      peer 8.8.8.8 route-policy as export
    #
    ospf 1 router-id 2.2.2.2
     area 0.0.0.0
      network 2.2.2.2 0.0.0.0
      network 12.1.1.0 0.0.0.255
    #
    route-policy as permit node 10
     apply as-path 555 666 777 additive
    #
    ip route-static 3.3.3.3 255.255.255.255 23.1.1.3
    ip route-static 8.8.8.8 255.255.255.255 28.1.1.8

    R3:
    #
    sysname r3
    #
    interface GigabitEthernet0/0/0
     ip address 35.1.1.3 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     ip address 36.1.1.3 255.255.255.0
    #
    interface GigabitEthernet0/0/2
     ip address 23.1.1.3 255.255.255.0
    #
    interface GigabitEthernet0/0/3
     ip address 34.1.1.3 255.255.255.0
    #
    interface LoopBack0
     ip address 3.3.3.3 255.255.255.255
    #
    bgp 200
     router-id 3.3.3.3
     peer 2.2.2.2 as-number 100
     peer 2.2.2.2 ebgp-max-hop 255
     peer 2.2.2.2 connect-interface LoopBack0
     peer 4.4.4.4 as-number 200
     peer 4.4.4.4 connect-interface LoopBack0
     peer 5.5.5.5 as-number 400
     peer 5.5.5.5 ebgp-max-hop 255
     peer 5.5.5.5 connect-interface LoopBack0
     peer 6.6.6.6 as-number 300
     peer 6.6.6.6 ebgp-max-hop 255
     peer 6.6.6.6 connect-interface LoopBack0
     #
      network 2.2.2.2 255.255.255.255
      network 3.3.3.3 255.255.255.255
      network 4.4.4.4 255.255.255.255
      network 5.5.5.5 255.255.255.255
      network 6.6.6.6 255.255.255.255
      network 34.1.1.0 255.255.255.0
      network 35.1.1.0 255.255.255.0
      network 36.1.1.0 255.255.255.0
      peer 2.2.2.2 enable
      peer 2.2.2.2 route-policy as export
      peer 4.4.4.4 enable
      peer 4.4.4.4 next-hop-local
      peer 5.5.5.5 enable
      peer 6.6.6.6 enable
      peer 6.6.6.6 route-policy as export
    #
    ospf 1 router-id 3.3.3.3
     area 0.0.0.0
      network 34.1.1.0 0.0.0.255
      network 3.3.3.3 0.0.0.0
    #
    route-policy as permit node 10
     if-match acl 2000
     apply as-path 444 555 666 additive
    #
    route-policy as permit node 20
    #
    ip route-static 2.2.2.2 255.255.255.255 23.1.1.2
    ip route-static 5.5.5.5 255.255.255.255 35.1.1.5
    ip route-static 6.6.6.6 255.255.255.255 36.1.1.6

    R4:
    #
    sysname r4
    #
    interface GigabitEthernet0/0/0
     ip address 45.1.1.4 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     ip address 34.1.1.4 255.255.255.0
    #
    interface LoopBack0
     ip address 4.4.4.4 255.255.255.255
    #
    bgp 200
     router-id 4.4.4.4
     peer 3.3.3.3 as-number 200
     peer 3.3.3.3 connect-interface LoopBack0
     peer 5.5.5.5 as-number 400
     peer 5.5.5.5 ebgp-max-hop 255
     peer 5.5.5.5 connect-interface LoopBack0
     #
      network 3.3.3.3 255.255.255.255
      network 4.4.4.4 255.255.255.255
      network 5.5.5.5 255.255.255.255
      network 34.1.1.0 255.255.255.0
      network 45.1.1.0 255.255.255.0
      peer 3.3.3.3 enable
      peer 3.3.3.3 next-hop-local
      peer 5.5.5.5 enable
    #
    ospf 1 router-id 4.4.4.4
     area 0.0.0.0
      network 4.4.4.4 0.0.0.0
      network 34.1.1.0 0.0.0.255
    #
    ip route-static 5.5.5.5 255.255.255.255 45.1.1.5

    R5:
    #
    sysname r5
    #
    interface GigabitEthernet0/0/0
     ip address 56.1.1.5 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     ip address 35.1.1.5 255.255.255.0
    #
    interface GigabitEthernet0/0/2
     ip address 45.1.1.5 255.255.255.0
    #
    interface LoopBack0
     ip address 5.5.5.5 255.255.255.255
    #
    bgp 400
     router-id 5.5.5.5
     peer 3.3.3.3 as-number 200
     peer 3.3.3.3 ebgp-max-hop 255
     peer 3.3.3.3 connect-interface LoopBack0
     peer 4.4.4.4 as-number 200
     peer 4.4.4.4 ebgp-max-hop 255
     peer 4.4.4.4 connect-interface LoopBack0
     peer 6.6.6.6 as-number 300
     peer 6.6.6.6 ebgp-max-hop 255
     peer 6.6.6.6 connect-interface LoopBack0
     #
      network 3.3.3.3 255.255.255.255
      network 4.4.4.4 255.255.255.255
      network 5.5.5.5 255.255.255.255
      network 6.6.6.6 255.255.255.255
      network 35.1.1.0 255.255.255.0
      network 45.1.1.0 255.255.255.0
      network 56.1.1.0 255.255.255.0
      peer 3.3.3.3 enable
      peer 4.4.4.4 enable
      peer 6.6.6.6 enable
    #
    ip route-static 3.3.3.3 255.255.255.255 35.1.1.3
    ip route-static 6.6.6.6 255.255.255.255 56.1.1.6


    R6:
    #
    sysname r6
    #
    interface GigabitEthernet0/0/0
     ip address 67.1.1.6 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     ip address 56.1.1.6 255.255.255.0
    #
    interface GigabitEthernet0/0/2
     ip address 36.1.1.6 255.255.255.0
    #
    interface LoopBack0
     ip address 6.6.6.6 255.255.255.255
    #
    bgp 300
     router-id 6.6.6.6
     peer 3.3.3.3 as-number 200
     peer 3.3.3.3 ebgp-max-hop 255
     peer 3.3.3.3 connect-interface LoopBack0
     peer 5.5.5.5 as-number 400
     peer 5.5.5.5 ebgp-max-hop 255
     peer 5.5.5.5 connect-interface LoopBack0
     peer 7.7.7.7 as-number 300
     peer 7.7.7.7 connect-interface LoopBack0
     peer 8.8.8.8 as-number 300
     peer 8.8.8.8 connect-interface LoopBack0
     #
      network 3.3.3.3 255.255.255.255
      network 5.5.5.5 255.255.255.255
      network 6.6.6.6 255.255.255.255
      network 7.7.7.7 255.255.255.255
      network 8.8.8.8 255.255.255.255
      network 36.1.1.0 255.255.255.0
      network 56.1.1.0 255.255.255.0
      network 67.1.1.0 255.255.255.0
      peer 3.3.3.3 enable
      peer 5.5.5.5 enable
      peer 7.7.7.7 enable
      peer 7.7.7.7 next-hop-local
      peer 8.8.8.8 enable
      peer 8.8.8.8 next-hop-local
    #
    ospf 1 router-id 3.3.3.3
     area 0.0.0.0
      network 6.6.6.6 0.0.0.0
      network 67.1.1.0 0.0.0.255
    #
    ip route-static 3.3.3.3 255.255.255.255 36.1.1.3
    ip route-static 5.5.5.5 255.255.255.255 56.1.1.5

    R7
    #
    sysname r7
    #
    interface GigabitEthernet0/0/0
     ip address 78.1.1.7 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     ip address 67.1.1.7 255.255.255.0
    #
    interface LoopBack0
     ip address 7.7.7.7 255.255.255.255
    #
    bgp 300
     router-id 7.7.7.7
     peer 6.6.6.6 as-number 300
     peer 6.6.6.6 connect-interface LoopBack0
     peer 8.8.8.8 as-number 300
     peer 8.8.8.8 connect-interface LoopBack0
     #
      network 6.6.6.6 255.255.255.255
      network 7.7.7.7 255.255.255.255
      network 8.8.8.8 255.255.255.255
      network 67.1.1.0 255.255.255.0
      network 78.0.0.0
      network 78.1.1.0 255.255.255.0
      peer 6.6.6.6 enable
      peer 8.8.8.8 enable
    #
    ospf 1 router-id 7.7.7.7
     area 0.0.0.0
      network 7.7.7.7 0.0.0.0
      network 67.1.1.0 0.0.0.255
      network 78.1.1.0 0.0.0.255


    R8
    #
    sysname r8
    #
    interface GigabitEthernet0/0/0
     ip address 28.1.1.8 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     ip address 78.1.1.8 255.255.255.0
    #
    interface LoopBack0
     ip address 8.8.8.8 255.255.255.255
    #
    bgp 300
     router-id 8.8.8.8
     peer 2.2.2.2 as-number 100
     peer 2.2.2.2 ebgp-max-hop 255
     peer 2.2.2.2 connect-interface LoopBack0
     peer 6.6.6.6 as-number 300
     peer 6.6.6.6 connect-interface LoopBack0
     peer 7.7.7.7 as-number 300
     peer 7.7.7.7 connect-interface LoopBack0
     #
      network 2.2.2.2 255.255.255.255
      network 6.6.6.6 255.255.255.255
      network 7.7.7.7 255.255.255.255
      network 8.8.8.8 255.255.255.255
      network 28.1.1.0 255.255.255.0
      network 78.1.1.0 255.255.255.0
      peer 2.2.2.2 enable
      peer 6.6.6.6 enable
      peer 6.6.6.6 next-hop-local
      peer 7.7.7.7 enable
      peer 7.7.7.7 next-hop-local
    #
    ospf 1 router-id 8.8.8.8
     area 0.0.0.0
      network 78.1.1.0 0.0.0.255
      network 8.8.8.8 0.0.0.0
    #
    ip route-static 2.2.2.2 255.255.255.255 28.1.1.2

  • 相关阅读:
    postgresql清理工具
    Vue 创建项目
    Vue3 项目打包
    Oracle Linux7 与Oracle Linux8 下载rpm包的位置
    PostgreSQL 关闭session链接,删除数据库方法(转载)
    浅析状态机模式的理解以及如何使用状态机模式简化代码里复杂的 if else 逻辑
    浅析黑盒/白盒测试用例的基本设计方法:等价类划分法、临界值分析法、错误推测法、因果图法
    浅析设计测试用例的四条原则:单个用例覆盖最小化原则、测试用例替代产品文档功能原则、单次投入成本和多次投入成本原则、使测试结果分析和调试最简单化原则
    浅析软件测试中的一些常见理论:杀虫剂效应、金字塔模型、缺陷集群性原则、软件测试活动依赖于软件测试背景、软件测试的7大基本原则
    golang var xx struct定义struct类型变量?
  • 原文地址:https://www.cnblogs.com/xuhao0705/p/13828384.html
Copyright © 2020-2023  润新知