一 先看拓扑
二配置ip:配置规则 xy.1.1.x xy.1.1.y
例 r1-----r2
r1:12.1.1.1
r2:12.1.1.2
三运行IGP OSPF在 r1,r2,r3上 配置比较简单就不敲了 2,3的外网接口不宣告进igp
结果:+
、
四:BGP
R4:
bgp 4
router-id 4.4.4.4
undo summary automatic
undo synchronization
peer 24.1.1.2 as-number 10
ipv4-family unicast
peer 24.1.1.2 enable
network 4.4.4.4 255.255.255.255
R4:
bgp 10
router-id 2.2.2.2
undo summary automatic
undo synchronization
peer 24.1.1.4 as-number 4
ipv4-family unicast
peer 24.1.1.4 enable //这一步默认不用做因为会华为默认开启
//defalt ipv4-unicast 只要指定了地址和as号会自动使用ipv4单播来尝试自动建立邻居
:>:代表路由是有效的
*代表是最优路由 r:管理距离小不是最优
四.2跟3之间的IBGP邻居
R2:
bgp 10
router-id 2.2.2.2
undo summary automatic
undo synchronization
peer 3.3.3.3 as-number 10
peer 3.3.3.3 connect-interface loopback0
R3:
bgp 10
router-id 3.3.3.3
undo summary automatic
undo synchronization
peer 2.2.2.2 as-number 10
peer 2.2.2.2 connect-interface loopback0
peer 2.2.2.2. next-hop-local
默认建不了ibgp邻居 因为bgp建立邻居需要peer open报文中的SIP才能成功建立 它才认为是合法的 默认发送open报文的出接口就是sip 所以需要修改
这个i代表这条路由是以network的方式引入bgp的
所以在r2上
peer 3.3.3.3 next-hop-local
边界需要使用 ,既有ebgp邻居又有ibgp邻居
四bgp 3-5 ebgp
利用链接冗余性,使用环回口建立邻居关系
r3:
ip route-static 5.5.5.5 24 g0/0/1 35.1.1.5
bgp 10
undo summary automatic
undo synchronization
peer 5.5.5.5 as-number 5
peer 5.5.5.5 connect-interface loo 0
peer 5.5.5.5 ebgp-max-hop
//默认tll值1
r5:
ip route-static 3.3.3.3 24 g0/0/1 35.1.1.3
bgp 5
undo summary automatic
undo synchronization
peer 3.3.3.3 as-number 10
peer3.3.3.3 connect-interface loo 0
peer3.3.3.3 ebgp-max-hop
在r5上在创建一个环回口 宣告进bgp在来ping一下
是不能正常通信的,原因是因为r1上没有运行bgp
解决方案:
AR1
mpls isr-id 1.1.1.1
mpls
mpls ldp
int g0/0/1 int g0/0/0
mpls
mpls ldp
然后r2还r3也是同样的操作
最后一条 :因为华为路由器通过bgp转发数据的时候默认不会针对下一跳来执行标签封装
r1 r2 r3:
route recursive-loopup tunnel