H3C BGP配置12-BGP扩展功能典型配置举例1-BGP LS配置举例


1.组网需求  

  所有路由器运行BGP协议,Switch A与Switch B建立IBGP连接,Switch B分别与Switch C和Switch D建立IBGP连接。

  Switch B作为路由反射器,Switch A为Switch B的客户机。

  Switch A能够通过Switch B学到Switch C和Switch D发布的LS信息。

2.配置步骤

  1)配置各接口的IP地址,在Switch C和Switch D上配置OSPF

  2) 配置BGP连接

# 配置Switch A。
[SwitchA] bgp 100
[SwitchA-bgp-default] peer 192.1.1.2 as-number 100
[SwitchA-bgp-default] address-family link-state
[SwitchA-bgp-default-ls] peer 192.1.1.2 enable

# 配置Switch B。
[SwitchB] bgp 100
[SwitchB-bgp-default] peer 192.1.1.1 as-number 100
[SwitchB-bgp-default] peer 193.1.1.1 as-number 100
[SwitchB-bgp-default] peer 194.1.1.1 as-number 100
[SwitchB-bgp-default] address-family link-state
[SwitchB-bgp-default-ls] peer 192.1.1.1 enable
[SwitchB-bgp-default-ls] peer 193.1.1.1 enable
[SwitchB-bgp-default-ls] peer 194.1.1.1 enable

# 配置Switch C。
[SwitchC] bgp 100
[SwitchC-bgp-default] peer 193.1.1.2 as-number 100
[SwitchC-bgp-default] address-family link-state
[SwitchC-bgp-default-ls] peer 193.1.1.2 enable
[SwitchC-bgp-default-ls] quit
[SwitchC-bgp-default] quit
[SwitchC] ospf
[SwitchC-ospf-1] distribute bgp-ls
[SwitchC-ospf-1] area 0
[SwitchC-ospf-1-area-0.0.0.0] network 0.0.0.0 0.0.0.0

# 配置Switch D。
[SwitchD] bgp 100
[SwitchD-bgp-default] peer 194.1.1.2 as-number 100
[SwitchD-bgp-default] address-family link-state
[SwitchD-bgp-default-ls] peer 194.1.1.2 enable
[SwitchD-bgp-default-ls] quit
[SwitchD-bgp-default] quit
[SwitchD] ospf
[SwitchD-ospf-1] distribute bgp-ls
[SwitchD-ospf-1] area 0
[SwitchD-ospf-1-area-0.0.0.0] network 0.0.0.0 0.0.0.0

  3)配置路由反射器

# 配置Switch B。
[SwitchB] bgp 100
[SwitchB-bgp-default] address-family link-state
[SwitchB-bgp-default-ls] peer 192.1.1.1 reflect-client

3.验证配置

# 查看Switch A的LS信息。
[SwitchA] display bgp link-state
 Total number of routes: 4
 BGP local Switch ID is 192.1.1.1
 Status codes: * - valid, > - best, d - dampened, h - history,
               s - suppressed, S - stale, i - internal, e - external
               a – additional-path
       Origin: i - IGP, e - EGP, ? - incomplete
 Prefix codes: E link, V node, T IP reachable route, u/U unknown,
               I Identifier, N local node, R remote node, L link, P prefix,
               L1/L2 ISIS level-1/level-2, O OSPF, D direct, S static, B BGP
               a area-ID, , l link-ID, t topology-ID, s ISO-ID,
               c confed-ID/ASN, b bgp-identifier, r Switch-ID,
               i if-address, n peer-address, o OSPF Route-type, p IP-prefix
               d designated Switch address
i Network : [V][O][I0x0][N[c100][b193.1.1.1][a0.0.0.0][r193.1.1.1]]/376
    NextHop : 193.1.1.1                                LocPrf    : 100
    PrefVal : 0                                        OutLabel  : NULL
    MED     :
    Path/Ogn: i
i Network : [V][O][I0x0][N[c100][b194.1.1.1][a0.0.0.0][r194.1.1.1]]/376
    NextHop : 194.1.1.1                                LocPrf    : 100
    PrefVal : 0                                        OutLabel  : NULL
    MED     :
    Path/Ogn: i
i Network : [T][O][I0x0][N[c100][b193.1.1.1][a0.0.0.0][r193.1.1.1]][P[o0x1][p193.1.1.0/24]]/480
    NextHop : 193.1.1.1                                LocPrf    : 100
    PrefVal : 0                                        OutLabel  : NULL
    MED     :
    Path/Ogn: i
i Network : [T][O][I0x0][N[c100][b194.1.1.1][a0.0.0.0][r194.1.1.1]][P[o0x1][p194.1.1.0/24]]/480
    NextHop : 194.1.1.1                                LocPrf    : 100
    PrefVal : 0                                        OutLabel  : NULL
    MED     :
    Path/Ogn: i
可以看出,Switch A从Switch C和Switch D 学到了LS信息。