BGP+MPLS实验

一、实验拓扑图
BGP+MPLS实验
二、实验步骤
一、配置IP地址
二、给AS 2配置OSPF
1、R2-R7配置相同
BGP+MPLS实验
修改:在R2-R7上都修改
[R2]int loo1
[R2-LoopBack1]ospf network-type broadcast
三、配置MPLS
给R2、R5、R7均配置
MPLS域不包含与R1、R8相连的接口
[R2]mpls lsr-id 172.16.1.2
[R2]mpls
[R2-mpls]mpls ldp
[R2-mpls-ldp]q
[R2]int g0/0/1 ----进入接口配置,MPLS区域里每个接口都要配置
[R2-GigabitEthernet0/0/1]mpls
[R2-GigabitEthernet0/0/1]mpls ldp
[R2]int g0/0/2
[R2-GigabitEthernet0/0/2]mpls
[R2-GigabitEthernet0/0/2]mpls ldp
[R2-GigabitEthernet0/0/2]q
四、配置BGP
只给R2、R5、R7配置BGP
在R1上:
[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.1.1.2 as-number 2
[R1-bgp]peer 15.1.1.5 as-number 2
在R2上:
[R2]bgp 2
[R2-bgp]router-id 172.16.1.2
[R2-bgp]peer 12.1.1.1 as-number 1 —与R1建邻
[R2-bgp]peer 172.16.1.7 as-number 2 —与R7建邻
[R2-bgp]peer 172.16.1.7 connect-interface LoopBack 0 ----因为是用环回建邻,所以要用环回发包,路由器默认用接口发包,要修改更新源
[R2-bgp]peer 172.16.1.5 as-number 2
[R2-bgp]peer 172.16.1.5 connect-interface LoopBack 0
在R5上:
[R5]bgp 2
[R5-bgp]router-id 172.16.1.5
[R5-bgp]peer 15.1.1.1 as-number 1
[R5-bgp]peer 172.16.1.2 as-number 2
[R5-bgp]peer 172.16.1.2 connect-interface LoopBack 0
[R5-bgp]peer 172.16.1.7 as-number 2
[R5-bgp]peer 172.16.1.7 connect-interface LoopBack 0
在R7上:
[R7]bgp 2
[R7-bgp]router-id 172.16.1.7
[R7-bgp]peer 78.1.1.8 as-number 3
[R7-bgp]peer 172.16.1.5 as-number 2
[R7-bgp]peer 172.16.1.5 connect-interface LoopBack 0
[R7-bgp]peer 172.16.1.2 as-number 2
[R7-bgp]peer 172.16.1.2 connect-interface LoopBack 0
在R8上:
[R8]bgp 3
[R8-bgp]peer 78.1.1.7 as-number 2
五、宣告
1、R3、R4、R6配置缺省路由,指向最近的配置了BGP的设备
[R3]ip route-static 0.0.0.0 0 172.16.0.1
[R4]ip route-static 0.0.0.0 0 172.16.0.26
[R6]ip route-static 0.0.0.0 0 172.16.0.13
2、宣告业务网段:
在R1上:
[R1]bgp 1
[R1-bgp]network 10.1.1.0 24
在R2上:
[R2]bgp 2
[R2-bgp]network 172.16.2.0 24
[R2-bgp]peer 172.16.1.5 next-hop-local —修改下一跳为本地,因为在一个AS之内传递,属性不变
[R2-bgp]peer 172.16.1.7 next-hop-local
在R5上:
[R5]bgp 2
[R5-bgp]network 172.16.5.0 24
[R5-bgp]peer 172.16.1.2 next-hop-local
[R5-bgp]peer 172.16.1.7 next-hop-local
在R7上:
[R7]bgp 2
[R7-bgp]network 172.16.7.0 24
[R7-bgp]peer 172.16.1.2 next-hop-local
[R7-bgp]peer 172.16.1.5 next-hop-local
在R8上:
[R8]bgp 3
[R8-bgp]network 10.1.2.0 24
此时R1和R8业务网段还是不能通信
解决:
[R2]route recursive-lookup tunnel
[R5]route recursive-lookup tunnel
[R7]route recursive-lookup tunnel
宣告AS2:
在R2上:
[R2]ip route-static 172.16.0.0 21 NULL 0
[R2]bgp 2
[R2-bgp]network 172.16.0.0 21
在R5上:
[R5]ip route-static 172.16.0.0 21 null 0
[R5]bgp 2
[R5-bgp]network 172.16.0.0 21
在R7上:
[R7]ip route-static 172.16.0.0 21 NULL 0
[R7]bgp 2
[R7-bgp]network 172.16.0.0 21

上一篇:MPLS VPN综合实验详解


下一篇:BGP路径属性分类与实验(华为设备)