标签:华为bgp isis
实验拓扑:
如图模拟市干省干国干设备(冗余链路配置差不多,已省略)在AS65001内部运行IS-IS协议。
实验需求:1.运行BGP协议,使R4可以学习到AR1上的业务网段,两边的业务网段可以互通
2.使用路由反射器,使AR5可以学习到AR1上的网段(R1与R5不建邻居)。
实验步骤:
进行基本配置
AR1
<Huawei>sy
[Huawei]int l0
[Huawei-LoopBack0]ip add 1.1.1.1 32
[Huawei-LoopBack0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 12.0.0.1 24
AR2
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]int l0
[Huawei-LoopBack0]ip add 2.2.2.2 32
[Huawei-LoopBack0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 12.0.0.2 24
[Huawei-GigabitEthernet0/0/1]
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/0]ip add 23.0.0.2 24
AR3
<Huawei>sy
[Huawei]int l0
[Huawei-LoopBack0]ip add 3.3.3.3 32
[Huawei-LoopBack0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 23.0.0.3 24
[Huawei-GigabitEthernet0/0/1]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 34.0.0.3 24
AR4
<Huawei>sy
[Huawei]int l0
[Huawei-LoopBack0]ip add 4.4.4.4 32
[Huawei-LoopBack0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 34.0.0.4 24
AR5
<Huawei>sy
[Huawei]int l0
[Huawei-LoopBack0]ip add 5.5.5.5 32
[Huawei-LoopBack0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 25.0.0.5 24
2.在AS65001内部运行ISIS协议
AR1
[Huawei]isis 1
[Huawei-isis-1]net 49.0001.0001.0001.0001.00
[Huawei-isis-1]int l0
[Huawei-LoopBack0]isis enable 1
[Huawei-LoopBack0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]isis enable 1
AR2
[Huawei]isis 1
[Huawei-isis-1]network-entity 49.0001.0002.0002.0002.00.
[Huawei-isis-1]int l0
[Huawei-LoopBack0]isis enable 1
[Huawei-LoopBack0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]isis enable 1
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]isis enable 1
[Huawei-GigabitEthernet0/0/2]int g0/0/0
[Huawei-GigabitEthernet0/0/0]isis enable 1
AR3
[Huawei]isis 1
[Huawei-isis-1]network-entity 49.0002.0003.0003.00
[Huawei-isis-1]int l0
[Huawei-LoopBack0]isis enable 1
[Huawei-LoopBack0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]isis enable 1
AR5
[Huawei]isis 1
[Huawei-isis-1]net 49.0001.0005.0005.0005.00
[Huawei-isis-1]int l0
[Huawei-LoopBack0]isis enable 1
[Huawei-LoopBack0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]isis enable 1
3.运行bgp协议,建立邻居关系
AR1
[Huawei]bgp 65001
[Huawei-bgp]peer 2.2.2.2 as-number 65001 //指定AR2为自己邻居
[Huawei-bgp]peer 2.2.2.2 connect-interface l0 //用自己环回口建立连接
[Huawei-bgp]peer 3.3.3.3 as-number 65001
[Huawei-bgp]peer 3.3.3.3 connect-interface l0
AR2
[Huawei]bgp 65001
[Huawei-bgp]peer 1.1.1.1 as-number 65001
[Huawei-bgp]peer 1.1.1.1 connect-interface l0
[Huawei-bgp]peer 5.5.5.5 as-number 65001
[Huawei-bgp]peer 5.5.5.5 connect-interface l0
[Huawei-bgp]peer 3.3.3.3 as-number 65001
[Huawei-bgp]peer 3.3.3.3 connect-interface l0
AR5
[Huawei]bgp 65001
[Huawei-bgp]peer 2.2.2.2 as-number 65001
[Huawei-bgp]peer 2.2.2.2 connect-interface l0
[Huawei-bgp]peer 3.3.3.3 as-number 65001
[Huawei-bgp]peer 3.3.3.3 connect-interface l0
AR3
[Huawei]bgp 65001
[Huawei-bgp]peer 1.1.1.1 as-number 65001
[Huawei-bgp]peer 1.1.1.1 connect-interface l0
[Huawei-bgp]peer 2.2.2.2 as-number 65001
[Huawei-bgp]peer 2.2.2.2 connect-interface l0
[Huawei-bgp]peer 5.5.5.5 as-number 65001
[Huawei-bgp]peer 5.5.5.5 connect-interface l0
注意:AR3与AR4建邻居时,如果以环回口建连接,默认ebgp ttl为1不可达,需要修改ebgp-max-hop值
[Huawei-bgp]peer 4.4.4.4 as-number 65002
[Huawei-bgp]peer 4.4.4.4 connect-interface l0
[Huawei-bgp]peer 4.4.4.4 ebgp-max-hop 2 //ttl改为2,就可达了
AR4
[Huawei]bgp 65002
[Huawei-bgp]peer 3.3.3.3 as-number 65001
[Huawei-bgp]peer 3.3.3.3 connect-interface l0
[Huawei-bgp]peer 3.3.3.3 ebgp-max-hop 2
此时邻居已经建立完毕,但是注意,在AR3上要将自己AS内部的路由器的下一跳(next-hop)指定为自己,否则路由不可达
[Huawei-bgp]peer 1.1.1.1 next-hop-local
[Huawei-bgp]peer 2.2.2.2 next-hop-local
[Huawei-bgp]peer 5.5.5.5 next-hop-local
现在假设AR1为BARS/SR,上面有一业务网段11.1.1.1/24,查看国干设备AR4是否能学习到?
AR1
[Huawei]int l10
[Huawei-LoopBack10]ip add 11.1.1.1 24
[Huawei-LoopBack10]q
[Huawei]bgp 65001
[Huawei-bgp]network 11.1.1.1 24 //宣告网段
在AR4上面查看
[Huawei]dis bgp routing-table
BGP Local router ID is 4.4.4.4
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
*> 11.1.1.0/24 3.3.3.3 0 65001i
已经学习到了,并且是best,因此AR4会将此路由放入路由表
同理,在AR4上也有一个网段44.4.4.4/24,查看AR1能否学习?
AR4
[Huawei]int l10
[Huawei-LoopBack10]ip add 44.4.4.4 24
[Huawei-LoopBack10]q
[Huawei]bgp 65002
[Huawei-bgp]network 44.4.4.4 24
在AR1是查看
[Huawei]dis bgp routing-table
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.1.1.0/24 0.0.0.0 0 0 i
*>i 44.4.4.0/24 3.3.3.3 0 100 0 65002i
也学习到,同样也是最优路由,放入路由表
这时候,用AR1 ping 44.4.4.4 能否通?
<Huawei>ping 44.4.4.4
PING 44.4.4.4: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 44.4.4.4 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
不通,为什么?因为AR1默认用的是出接口g0/0/0去ping,而AR4学习不到AR1 g0/0/0的网段,所以不通。
如果AR1使用业务网段11.1.1.1/24去ping,能通吗?
[Huawei]ping -a 11.1.1.1 44.4.4.4
PING 44.4.4.4: 56 data bytes, press CTRL_C to break
Reply from 44.4.4.4: bytes=56 Sequence=1 ttl=253 time=300 ms
Reply from 44.4.4.4: bytes=56 Sequence=2 ttl=253 time=40 ms
Reply from 44.4.4.4: bytes=56 Sequence=3 ttl=253 time=50 ms
Reply from 44.4.4.4: bytes=56 Sequence=4 ttl=253 time=40 ms
Reply from 44.4.4.4: bytes=56 Sequence=5 ttl=253 time=40 ms
是可以的,因为11.1.1.1/24的网段AR4学到了。
4.路由反射器
这时候,BRAS/SR AR5学习不到AR1上的业务网段11.1.1.1/24(AR1与AR5不是邻居)
[Huawei]dis bgp routing-table
BGP Local router ID is 5.5.5.5
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 44.4.4.0/24 3.3.3.3 0 100 0 65002i
因为受到水平分割原则限制,从IBGP邻居学习到的路由不能发送给另一个IBGP邻居,这时候可以在AR2上做路由反射器
AR2
[Huawei]bgp 65001
[Huawei-bgp]peer 1.1.1.1 reflect-client //指定AR1为自己的client
[Huawei-bgp]peer 5.5.5.5 reflect-client //指定AR5为自己的client
在AR5上在查看一下
[Huawei]dis bgp routing-table
BGP Local router ID is 5.5.5.5
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 11.1.1.0/24 1.1.1.1 0 100 0 i
*>i 44.4.4.0/24 3.3.3.3 0 100 0 65002i
学到了,同理,AR5上的业务网段也可以被AR1所学到,实验完毕。
本文出自 “NE之路” 博客,请务必保留此出处http://332162926.blog.51cto.com/8831013/1553632
标签:华为bgp isis
原文地址:http://332162926.blog.51cto.com/8831013/1553632