配置BGP-LS示例
BGP-LS(BGP Link-state)汇总IGP协议收集的拓扑信息上送给上层控制器。
组网需求
- 降低对上层控制器计算能力的要求,且不再对控制器的IGP能力有要求;
- BGP协议将各个进程或各个AS的拓扑信息做汇总,直接将完整的拓扑信息上送给控制器,有利于路径选择和计算;
- 网络中所有拓扑信息均通过BGP协议上送控制器,使拓扑上送协议归一化。
如图10-51所示,Controller为控制器,DeviceC与控制器相连,用来给控制器上送拓扑。DeviceA、DeviceB、DeviceC和DeviceD之间通过IS-IS协议实现IP网络互连,DeviceA、DeviceB和DeviceC属于区域10,DeviceD属于区域20,DeviceA和DeviceB是Level-1设备,DeviceC是Level-1-2设备,DeviceD是Level-2设备。
数据准备
为完成此配置例,需准备如下的数据:
DeviceA、DeviceB、DeviceC和DeviceD的区域地址。
DeviceA、DeviceB、DeviceC和DeviceD的级别。
DeviceC的IS-IS中BGP-LS的标识。
DeviceC和Controller的BGP AS号、BGP-LS的区域AS号和BGP-LS的区域标识符。
操作步骤
- 配置各路由器接口的IP地址,具体配置过程请参考配置文件。
- 配置IS-IS基本功能。
# 配置DeviceA。
[~DeviceA] isis 1
[*DeviceA-isis-1] is-level level-1
[*DeviceA-isis-1] network-entity 10.0000.0000.0001.00
[*DeviceA-isis-1] quit
[*DeviceA] interface gigabitethernet 0/2/0
[*DeviceA-GigabitEthernet0/2/0] isis enable 1
[*DeviceA-GigabitEthernet0/2/0] commit
[~DeviceA-GigabitEthernet0/2/0] quit
# 配置DeviceB。
[~DeviceB] isis 1
[*DeviceB-isis-1] is-level level-1
[*DeviceB-isis-1] network-entity 10.0000.0000.0002.00
[*DeviceB-isis-1] quit
[*DeviceB] interface gigabitethernet 0/1/8
[*DeviceB-GigabitEthernet0/1/8] isis enable 1
[*DeviceA-GigabitEthernet0/1/8] commit
[~DeviceB-GigabitEthernet0/1/8] quit
# 配置DeviceC。
[~DeviceC] isis 1
[*DeviceC-isis-1] network-entity 10.0000.0000.0003.00
[*DeviceC-isis-1] quit
[*DeviceC] interface gigabitethernet 0/2/0
[*DeviceC-GigabitEthernet0/2/0] isis enable 1
[*DeviceC-GigabitEthernet0/2/0] quit
[*DeviceC] interface gigabitethernet 0/3/0
[*DeviceC-GigabitEthernet0/3/0] isis enable 1
[*DeviceC-GigabitEthernet0/3/0] quit
[*DeviceC] interface gigabitethernet 0/1/8
[*DeviceC-GigabitEthernet0/1/8] isis enable 1
[*DeviceC-GigabitEthernet0/1/8] commit
[~DeviceC-GigabitEthernet0/1/8] quit
# 配置DeviceD。
[~DeviceD] isis 1
[*DeviceD-isis-1] is-level level-2
[*DeviceD-isis-1] network-entity 20.0000.0000.0004.00
[*DeviceD-isis-1] quit
[*DeviceD] interface gigabitethernet 0/3/0
[*DeviceD-GigabitEthernet0/3/0] isis enable 1
[*DeviceD-GigabitEthernet0/3/0] quit
[*DeviceD] interface LoopBack0
[*DeviceD-LoopBack0] isis enable 1
[*DeviceD-LoopBack0] commit
[~DeviceD-LoopBack0] quit
# 显示各路由器的IS-IS路由信息。
[~DeviceA] display isis route
Route information for ISIS(1) ----------------------------- ISIS(1) Level-1 Forwarding Table -------------------------------- IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags ------------------------------------------------------------------------------- 0.0.0.0/0 10 NULL GE0/2/0 10.1.1.1 A/-/-/- 10.1.1.0/24 10 NULL GE0/2/0 Direct D/-/L/- 10.1.2.0/24 20 NULL GE0/2/0 10.1.1.1 A/-/-/- 192.168.0.0/24 20 NULL GE0/2/0 10.1.1.1 A/-/-/- Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut, U-Up/Down Bit Set
[~DeviceB] display isis route
Route information for ISIS(1) ----------------------------- ISIS(1) Level-1 Forwarding Table -------------------------------- IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags ------------------------------------------------------------------------------- 0.0.0.0/0 10 NULL GE0/1/8 10.1.2.1 A/-/-/- 10.1.1.0/24 20 NULL GE0/1/8 10.1.2.1 A/-/-/- 10.1.2.0/24 10 NULL GE0/1/8 Direct D/-/L/- 192.168.0.0/24 20 NULL GE0/1/8 10.1.2.1 A/-/-/- Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut, U-Up/Down Bit Set
[~DeviceC] display isis route
Route information for ISIS(1) ----------------------------- ISIS(1) Level-1 Forwarding Table -------------------------------- IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags ------------------------------------------------------------------------------- 10.1.1.0/24 10 NULL GE0/2/0 Direct D/-/L/- 10.1.2.0/24 10 NULL GE0/1/8 Direct D/-/L/- 192.168.0.0/24 10 NULL GE0/3/0 Direct D/-/L/- Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut, U-Up/Down Bit Set ISIS(1) Level-2 Forwarding Table -------------------------------- IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags ------------------------------------------------------------------------------- 10.1.1.0/24 10 NULL GE0/2/0 Direct D/-/L/- 10.1.2.0/24 10 NULL GE0/1/8 Direct D/-/L/- 172.16.1.1/32 10 NULL GE0/3/0 192.168.0.2 A/-/-/- 192.168.0.0/24 10 NULL GE0/3/0 Direct D/-/L/- Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut, U-Up/Down Bit Set
[~DeviceD] display isis route
Route information for ISIS(1) ----------------------------- ISIS(1) Level-2 Forwarding Table -------------------------------- IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags ------------------------------------------------------------------------------- 10.1.1.0/24 20 NULL GE0/3/0 192.168.0.1 A/-/-/- 10.1.2.0/24 20 NULL GE0/3/0 192.168.0.1 A/-/-/- 172.16.1.1/32 0 NULL Loop0 Direct D/-/L/- 192.168.0.0/24 10 NULL GE0/3/0 Direct D/-/L/- Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut, U-Up/Down Bit Set
- 在DeviceA和Controller上部署BGP-LS特性。
# 在DeviceA上使能IS-IS拓扑发布功能。
[~DeviceA] isis 1
[*DeviceA-isis-1] bgp-ls enable
[*DeviceA-isis-1] bgp-ls identifier 20
[*DeviceA-isis-1] commit
[~DeviceA-isis-1] quit
# 在DeviceA上使能BGP-LS能力,并与Controller建立BGP-LS邻居。
[~DeviceA] bgp 100
[*DeviceA-bgp] peer 1.1.1.2 as-number 100
[*DeviceA-bgp] link-state-family unicast
[*DeviceA-bgp-af-ls] peer 1.1.1.2 enable
[*DeviceA-bgp-af-ls] commit
[~DeviceA-bgp-af-ls] quit
[~DeviceA-bgp] quit
# 在Controller上使能BGP-LS能力,并与DeviceA建立BGP-LS邻居。
[~Controller] bgp 100
[*Controller-bgp] peer 1.1.1.1 as-number 100
[*Controller-bgp] link-state-family unicast
[*Controller-bgp-af-ls] peer 1.1.1.1 enable
[*Controller-bgp-af-ls] commit
[~Controller-bgp-af-ls] quit
[~Controller-bgp] quit
- 检查配置结果。
# 在DeviceA上查看BGP-LS对等体及其状态信息。
[~DeviceA] display bgp link-state unicast peer
BGP local router ID : 10.1.1.2 Local AS number : 100 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 1.1.1.2 4 100 27 48 0 00:29:11 Established 17
# 在DeviceA上查看BGP-LS路由信息。
[~DeviceA] display bgp link-state unicast routing-table
BGP Local router ID is 10.1.1.2 Status codes: * - valid, > - best, d - damped, x - best external, a - add path, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Node Routes: 5 *> Network : [NODE][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.00]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [NODE][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.01]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [NODE][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.00]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [NODE][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.01]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [NODE][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0003.00]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? Total Number of Link Routes: 8 *> Network : [LINK][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.00]][REMOTE[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.01]][LINK[if-address0.0.0.0][peer-address0.0.0.0][if-address::][peer-address::][mt-id0]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [LINK][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.01]][REMOTE[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.00]][LINK[if-address0.0.0.0][peer-address0.0.0.0][if-address::][peer-address::][mt-id0]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [LINK][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.01]][REMOTE[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0003.00]][LINK[if-address0.0.0.0][peer-address0.0.0.0][if-address::][peer-address::][mt-id0]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [LINK][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.00]][REMOTE[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.01]][LINK[if-address0.0.0.0][peer-address0.0.0.0][if-address::][peer-address::][mt-id0]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [LINK][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.01]][REMOTE[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.00]][LINK[if-address0.0.0.0][peer-address0.0.0.0][if-address::][peer-address::][mt-id0]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [LINK][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.01]][REMOTE[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0003.00]][LINK[if-address0.0.0.0][peer-address0.0.0.0][if-address::][peer-address::][mt-id0]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [LINK][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0003.00]][REMOTE[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.01]][LINK[if-address0.0.0.0][peer-address0.0.0.0][if-address::][peer-address::][mt-id0]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [LINK][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0003.00]][REMOTE[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.01]][LINK[if-address0.0.0.0][peer-address0.0.0.0][if-address::][peer-address::][mt-id0]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? Total Number of IPv4 Prefix Routes: 5 *> Network : [IPV4-PREFIX][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0001.00]][PREFIX[mt-id0][ospf-route-type0][prefix10.1.1.0/24]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [IPV4-PREFIX][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0002.00]][PREFIX[mt-id0][ospf-route-type0][prefix10.1.2.0/24]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [IPV4-PREFIX][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0003.00]][PREFIX[mt-id0][ospf-route-type0][prefix10.1.1.0/24]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [IPV4-PREFIX][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0003.00]][PREFIX[mt-id0][ospf-route-type0][prefix10.1.2.0/24]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ? *> Network : [IPV4-PREFIX][ISIS-LEVEL-1][IDENTIFIER0][LOCAL[as100][bgp-ls-identifier10.1.1.2][ospf-area-id0.0.0.0][igp-router-id0000.0000.0003.00]][PREFIX[mt-id0][ospf-route-type0][prefix192.168.0.0/24]] NextHop : 0.0.0.0 LocPrf : MED : 0 PrefVal : 0 Path/Ogn : ?
从回显中可以看出,整个IS-IS网络的拓扑信息已经汇集到了DeviceA上,DeviceA可以通过BGP-LS路由将拓扑信息传递给已经与其建立了BGP-LS邻居的控制器(即Controller)。
配置文件
DeviceA的配置文件
# sysname DeviceA # isis 1 is-level level-1 network-entity 10.0000.0000.0001.00 bgp-ls enable level-1-2 bgp-ls identifier 20 # interface GigabitEthernet0/2/0 undo shutdown ip address 10.1.1.2 255.255.255.0 isis enable 1 # bgp 100 peer 1.1.1.2 as-number 100 ipv4-family unicast undo synchronization peer 1.1.1.2 enable link-state-family unicast peer 1.1.1.2 enable # return
DeviceB的配置文件
# sysname DeviceB # isis 1 is-level level-1 network-entity 10.0000.0000.0002.00 # interface GigabitEthernet0/1/8 undo shutdown ip address 10.1.2.2 255.255.255.0 isis enable 1 # return
DeviceC的配置文件
# sysname DeviceC # isis 1 network-entity 10.0000.0000.0003.00 # interface GigabitEthernet0/2/0 undo shutdown ip address 10.1.1.1 255.255.255.0 isis enable 1 # interface GigabitEthernet0/3/0 undo shutdown ip address 192.168.0.1 255.255.255.0 isis enable 1 # interface GigabitEthernet0/1/8 undo shutdown ip address 10.1.2.1 255.255.255.0 isis enable 1 # return
DeviceD的配置文件
# sysname DeviceD # isis 1 is-level level-2 network-entity 20.0000.0000.0004.00 # interface GigabitEthernet0/3/0 undo shutdown ip address 192.168.0.2 255.255.255.0 isis enable 1 # interface LoopBack0 ip address 172.16.1.1 255.255.255.255 isis enable 1 # return
Controller的配置文件
# sysname Controller # interface GigabitEthernet0/1/0 undo shutdown ip address 1.1.1.2 255.255.255.0 # bgp 100 peer 1.1.1.1 as-number 100 ipv4-family unicast undo synchronization peer 1.1.1.1 enable link-state-family unicast peer 1.1.1.1 enable # return