BGP 联盟示例

组网需求

  1. AS 200中有多台BGP路由器,现需要减少IBGP的连接数

组网拓扑

配置思路

  1. 在AS200中各路由器上配置BGP联盟
  2. 将设备划分为3个子自治系统:AS 65001、AS 65002、AS 65003
  3. AS65001内的三台路由器是IBGP全连接
  4. 实现减少IBGP的连接的需求

配置命令

  1. 配置各路由器基本功能以及各个接口IP地址

    • Router A配置

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      sys
      sys RouterA
      int g0/0/0
      ip add 10.1.3.1 30
      int g0/0/1
      ip add 10.1.4.1 30
      int g0/0/2
      ip add 10.1.1.1 30
      int g3/0/0
      ip add 10.1.2.1 30
      int g4/0/0
      ip add 200.1.1.1 30
      int LoopBack 0
      ip add 1.1.1.1 32
  • Router B配置

    1
    2
    3
    4
    5
    6
    sys
    sys RouterB
    int g0/0/0
    ip add 10.1.1.2 30
    int LoopBack 0
    ip add 2.2.2.2 32
  • Router C配置

    1
    2
    3
    4
    5
    6
    sys
    sys Router C
    int g0/0/0
    ip add 10.1.2.2 30
    int LoopBack 0
    ip add 3.3.3.3 32
  • Router D配置

    1
    2
    3
    4
    5
    6
    7
    8
    sys
    sys RouterD
    int g0/0/0
    ip add 10.1.3.2 30
    int g0/0/2
    ip add 10.1.5.1 30
    int LoopBack 0
    ip add 4.4.4.4 32
  • Router E配置

    1
    2
    3
    4
    5
    6
    7
    8
    sys
    sys RouterE
    int g0/0/1
    ip add 10.1.4.2 30
    int g0/0/2
    ip add 10.1.5.2 30
    int LoopBack 0
    ip add 5.5.5.5 32
  • Router F配置

    1
    2
    3
    4
    5
    6
    7
    8
    sys
    sys Router F
    int g0/0/0
    ip add 200.1.1.2 30
    int LoopBack 0
    ip add 9.1.1.1 32
    int LoopBack 1
    ip add 6.6.6.6 32
  1. 配置BGP联盟

    • Router A配置

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      sys
      bgp 650001
      router-id 1.1.1.1
      confederation id 200
      confederation peer-as 65002 65003
      peer 10.1.1.2 as-number 65002
      peer 10.1.2.2 as-number 65003

      ipv4-family unicast
      peer 10.1.1.2 next-hop-local
      peer 10.1.2.2 next-hop-local
  • Router B配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    sys
    bgp 65002
    router-id 2.2.2.2
    confederation id 200
    confederation peer-as 65001
    peer 10.1.1.1 as-number 65001

    ipv4-family unicast
    peer 10.1.1.1 next-hop-local
  • Router C配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    sys
    bgp 65003
    router-id 3.3.3.3
    confederation id 200
    confedetation peer-as 65001
    peer 10.1.2.2 as-number 65001

    ipv4-family unicast
    peer 10.1.2.2 next-hop-local
  1. 配置AS 65001内的IBGP

    • Router A配置

      1
      2
      3
      4
      5
      6
      7
      sys
      bgp 65001
      peer 10.1.4.2 as-number 65001
      peer 10.1.3.2 as-number 65001
      ipv4-family unicast
      peer 10.1.3.2 next-hop-local
      peer 10.1.4.2 next-hop-local
  • Router D配置

    1
    2
    3
    4
    5
    6
    sys
    bgp 65001
    router-id 4.4.4.4
    confederation id 200
    peer 10.1.3.1 as-number 65001
    peer 10.1.5.2 as-number 65001
  • Router E配置

    1
    2
    3
    4
    5
    6
    sys
    bgp 65001
    router-id 5.5.5.5
    confederation id 200
    peer 10.1.4.1 as-number 65001
    peer 10.1.5.1 as-number 65001
  1. 配置EBGP并宣告Router F的路由

    • Router A配置

      1
      2
      3
      sys
      bgp 65001
      peer 200.1.1.2 as-number 100
  • Router B配置

    1
    2
    3
    4
    5
    6
    7
    8
    sys
    sys Router F
    bgp 100
    router-id 6.6.6.6
    peer 200.1.1.1 as-number 200

    ipv4-family unicast
    network 9.1.1.1 32

结果查看

  1. 查看BGP路由表(以Router B为例)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    display bgp routing-table

    <Router B>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: 1
    Network NextHop MED LocPrf PrefVal Path/Ogn

    *>i 9.1.1.1/32 10.1.1.1 0 100 0 (65001) 100i
  1. 查看到9.1.1..1 32 的BGP路由表

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    display bgp routing-table 9.1.1.1 32

    <Router B>dis bgp routing-table 9.1.1.1 32

    BGP local router ID : 2.2.2.2
    Local AS number : 65002
    Paths: 1 available, 1 best, 1 select
    BGP routing table entry information of 9.1.1.1/32:
    From: 10.1.1.1 (1.1.1.1)
    Route Duration: 01h13m54s
    Relay IP Nexthop: 0.0.0.0
    Relay IP Out-Interface: GigabitEthernet0/0/0
    Original nexthop: 10.1.1.1
    Qos information : 0x0
    AS-path (65001) 100, origin igp, MED 0, localpref 100, pref-val 0, valid, exter
    nal-confed, best, select, active, pre 255
    Not advertised to any peer yet
吴超 wechat
subscribe to my blog by scanning my public wechat account