1、H3C BGP配置1。14BGP典型配置举例1。14。1BGP基本配置1.组网需求如图115所示,所有路由器均运行BGP协议。要求Router A和Router B之间建立EBGP连接,Router B和Router C之间建立IBGP连接,使得Router C能够访问Router A直连的8。1.1.0/24网段。2.组网图图1-15BGP基本配置组网图3。配置步骤(1)配置各接口的IP地址(略)(2)配置IBGP连接为了防止端口状态不稳定引起路由震荡,本举例使用Loopback接口来创建IBGP对等体。使用Loopback接口创建IBGP对等体时,因为Loopback接口不是两对等体实际连
2、接的接口,所以,必须使用peer connect-interface命令将Loopback接口配置为BGP连接的源接口.在AS 65009内部,使用OSPF协议,保证Router B到Router C的Loopback接口路由可达。#配置Router B.RouterB system-viewRouterB bgp 65009RouterB-bgp routerid 2。2.2.2RouterBbgp peer 3。3.3.3 as-number 65009RouterBbgp peer 3.3。3.3 connect-interface loopback 0RouterBbgp quitRo
3、uterB ospf 1RouterBospf1 area 0RouterBospf1area-0。0.0.0 network 2.2.2。2 0.0.0。0RouterBospf1area0.0。0.0 network 9.1.1。1 0。0。0。255RouterB-ospf-1-area0。0.0。0 quitRouterBospf1 quit#配置Router C。RouterC systemviewRouterC bgp 65009RouterC-bgp routerid 3。3.3。3RouterC-bgp peer 2。2。2.2 asnumber 65009RouterCbgp
4、 peer 2.2。2.2 connect-interface loopback 0RouterC-bgp quitRouterC ospf 1RouterCospf1 area 0RouterC-ospf1area0。0.0.0 network 3.3.3.3 0。0.0。0RouterC-ospf-1-area0。0.0。0 network 9。1。1.0 0。0。0。255RouterC-ospf1area-0。0.0.0 quitRouterCospf1 quitRouterC display bgp peerBGP local router ID : 3.3。3.3Local AS
5、number : 65009Total number of peers : 1 Peers in established state : 1 Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State 2.2.2。2 65009 7 10 0 0 00:06:09 Established以上显示信息表明Router B和Router C之间的IBGP连接已经建立。(3)配置EBGP连接EBGP邻居关系的两台路由器(通常属于两个不同运营商),处于不同的AS域,对端的Loopback接口一般路由不可达,所以一般使用直连地址建立BGP邻居。因为要求Route
6、r C能够访问Router A直连的8。1.1。0/24网段,所以,建立EBGP连接后,需要将8。1.1.0/24网段路由通告到BGP路由表中。#配置Router A。 8.1.1。0/24 0。0。0.0 0 0 i显示Router B的BGP路由表。RouterB display bgp routing-tableTotal Number of Routes: 1BGP Local router ID is 2.2。2。2Status codes: valid, VPNv4 best, - best, d - damped, h - history, i - internal, s - s
7、uppressed, S Stale Origin : i IGP, e - EGP, ? - incomplete Network NextHop MED LocPrf PrefVal Path/Ogn* 8。1.1.0/24 3.1.1.2 0 0 65008i#显示Router C的BGP路由表。RouterC display bgp routing-tableTotal Number of Routes: 1BGP Local router ID is 3。3。3。3Status codes: * - valid, VPNv4 best, - best, d - damped, h h
8、istory, i internal, s suppressed, S - Stale Origin : i - IGP, e - EGP, ? incomplete Network NextHop MED LocPrf PrefVal Path/Ogn i 8。1.1.0/24 3。1。1.2 0 100 0 65008i从路由表可以看出,Router A没有学到AS 65009内部的任何路由,Router C虽然学到了AS 65008中的8.1.1。0的路由,但因为下一跳3。1.1。2不可达,所以也不是有效路由。(4)配置BGP引入直连路由在Router B上配置BGP引入直连路由,以便R
9、outer A能够获取到网段9。1。1.0/24的路由,Router C能够获取到网段3.1.1。0/24的路由.配置Router B。RouterB bgp 65009RouterBbgp importroute direct#显示Router A的BGP路由表。RouterA display bgp routing-tableTotal Number of Routes: 4BGP Local router ID is 1.1.1.1Status codes: valid, - VPNv4 best, best, d damped, h - history, i internal, s -
10、 suppressed, S Stale Origin : i IGP, e EGP, ? incomplete Network NextHop MED LocPrf PrefVal Path/Ogn* 2。2。2.2/32 3。1。1。1 0 0 65009?* 3。1。1。0/24 3。1.1.1 0 0 65009?* 8.1.1.0/24 0.0.0。0 0 0 i 9.1.1.0/24 3.1。1.1 0 0 65009?以上显示信息表明,在Router B上引入直连路由后,Router A新增了到2.2.2。2/32和9。1.1.0/24两条路由。#显示Router C的BGP路由
11、表。RouterC display bgp routing-tableTotal Number of Routes: 4BGP Local router ID is 3。3.3。3Status codes: - valid, - VPNv4 best, best, d damped, h history, i - internal, s - suppressed, S Stale Origin : i - IGP, e EGP, ? incomplete Network NextHop MED LocPrf PrefVal Path/Ogn i 2.2.2.2/32 2。2.2。2 0 100
12、 0 ?*i 3。1.1。0/24 2.2.2。2 0 100 0 ?i 8.1.1.0/24 3.1。1。2 0 100 0 65008i i 9.1。1.0/24 2.2.2.2 0 100 0 ?以上显示信息表明,到8.1。1.0的路由变为有效路由,下一跳为Router A的地址。(5)验证配置结果#使用Ping进行验证。RouterC ping 8.1。1。1 PING 8.1。1。1: 56 data bytes, press CTRL_C to break Reply from 8.1.1.1: bytes=56 Sequence=1 ttl=254 time=2 ms Reply
13、 from 8.1.1.1: bytes=56 Sequence=2 ttl=254 time=2 ms Reply from 8。1.1。1: bytes=56 Sequence=3 ttl=254 time=2 ms Reply from 8.1.1.1: bytes=56 Sequence=4 ttl=254 time=2 ms Reply from 8。1.1。1: bytes=56 Sequence=5 ttl=254 time=2 ms 8。1。1。1 ping statistics - 5 packet(s) transmitted 5 packet(s) received 0。
14、00% packet loss round-trip min/avg/max = 2/2/2 ms1.14。2BGP与IGP交互配置1。组网需求如图116所示,公司A的所有设备在AS 65008内,公司B的所有设备在AS 65009内,AS 65008和AS 65009通过设备Router A和Router B相连.现要求实现Router A能够访问AS 65009内的网段9.1.2。0/24,Router C能够访问AS 65008内的网段8.1.1。0/24。2。组网图图1-16BGP与IGP交互配置组网图3。配置步骤(1)配置各接口的IP地址(略)(2)配置OSPF在AS 65009内配
15、置OSPF,使得Router B能获取到到9.1.2.0/24网段的路由。#配置Router B. system-viewRouterB ospf 1RouterB-ospf-1 area 0RouterBospf-1area-0.0。0。0 network 2.2.2.2 0。0。0。0RouterBospf1area0.0.0。0 network 9。1。1.0 0。0.0。255RouterB-ospf-1area-0.0。0.0 quitRouterBospf1 quit配置Router C。RouterC system-viewRouterC ospf 1RouterC-ospf1
16、importroute directRouterC-ospf-1 area 0RouterC-ospf-1area-0。0。0.0 network 9.1.1.0 0。0。0.255RouterCospf1-area-0。0。0。0 quitRouterC-ospf-1 quit(3)配置EBGP连接配置EBGP连接,并在Router A上将8。1。1。0/24网段通告到BGP路由表中,以便Router B获取到网段8.1。1。0/24的路由。#配置Router A。 best, d damped, h - history, i internal, s - suppressed, S - St
17、ale Origin : i - IGP, e - EGP, ? - incomplete Network NextHop MED LocPrf PrefVal Path/Ogn 3.3.3.3/32 3.1。1.1 1 0 65009? 8.1。1.0/24 0。0。0。0 0 0 i 9.1。2.0/24 3。1.1.1 1 0 65009?查看RouterC的路由表。RouterC display ip routing-tableRouting Tables: Public Destinations : 9 Routes : 9Destination/Mask Proto Pre Cos
18、t NextHop Interface2。2.2.2/32 OSPF 10 1 9.1.1.1 S2/03。3。3。3/32 Direct 0 0 127.0。0.1 InLoop08.1。1。0/24 O_ASE 150 19。1.1。1S2/09.1.1。0/24 Direct 0 0 9.1.1。2 S2/09。1。1。2/32 Direct 0 0 127.0.0。1 InLoop09.1。2.0/24 Direct 0 0 9。1。2。1 Eth1/19。1。2。1/32 Direct 0 0 127。0。0。1 InLoop0127.0。0。0/8 Direct 0 0 127。0
19、.0.1 InLoop0127.0.0.1/32 Direct 0 0 127.0。0.1 InLoop0(5)验证配置结果使用Ping进行验证。RouterA ping a 8.1。1.1 9.1.2.1 PING 9。1。2.1: 56 data bytes, press CTRL_C to break Reply from 9.1.2。1: bytes=56 Sequence=1 ttl=254 time=15 ms Reply from 9。1。2.1: bytes=56 Sequence=2 ttl=254 time=31 ms Reply from 9.1。2。1: bytes=56 Sequence=3 ttl=254 time=47 ms Reply from 9。1.2.1: bytes=56 Sequence=4 ttl=254 time=46 ms Reply from 9.1.2.1: bytes=56 Sequence=5 ttl=254 time=47 ms - 9.1。2。1 ping statistics - 5 packet(s) transmitted 5 pa
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1