實驗拓撲:
實驗要求:
使用R1與R2使用RIPv2協議,R7與R2使用靜態路由,R5與R6使用RIPv2協議,R5與R8使用ospf協議,R2與R5使用MPLS/BGP
使得R1與R6連通,R7與R8連通。
實驗步驟:
0.基礎配置:
各接口配好網段ip地址
R1 :F0/0 12.1.1.1
R2 :F0/0 12.1.1.2, F2/0 23.1.1.2 ,F1/0 27.1.1.2
R3 :F0/0 23.1.1.3 ,F1/0 34.1.1.3
.......
.......
如是配置,保證直連ping通
1.配置PE-P之間的IGP和MPLS
IGP:
R2:
conf t
router ospf 1
router-id 2.2.2.2
network 23.1.1.0 0.0.0.255 a 0
network 2.2.2.2 0.0.0.0 a 0
R3 :
conf t
router ospf 1
router-id 3.3.3.3
network 0.0.0.0 0.0.0.0 a 0
R4 :
conf t
router ospf 1
router-id 4.4.4.4
network 0.0.0.0 0.0.0.0 a 0
R5:
conf t
router ospf 1
router-id 5.5.5.5
network 45.1.1.0 0.0.0.255 a 0
network 5.5.5.5 0.0.0.0 a 0
MPLS:
R2:
conf t
mpls label range 200 299
int f2/0
mpls ip
R3:
conf t
mpls label range 300 399
int r f0/0 ,f1/0
mpls ip
R4:
conf t
mpls label range 400 499
int r f0/0 ,f1/0
mpls
R5:
conf t
mpls label rang 500 599
int f0/0
mpls
2.配置PE-CE之間的路由協議:
R1與R2 RIPv2
R1:
router rip
no au
ve 2
net 0.0.0.0
R2:
ip vrf A
rd 1:100
route-target 1:200
int f0/0
ip vrf forwarding A
ip add 12.1.1.2 255.255.255.0
router rip
no au
ve 2
address-family ipv4 vrf A
net 12.1.1.0
R7與R2 static
R7:
ip route 0.0.0.0 0.0.0.0 27.1.1.2
R2:
ip vrf B
rd 2:111
route-target 2:222
int f1/0
ip vrf forwarding B
ip add 27.1.1.2 255.255.255.0
ip route vrf B 7.7.7.7 255.255.255.255 27.1.1.7
R5與R6 RIPv2
R6:
router rip
no au
ve 2
net 0.0.0.0
R5:
ip vrf A
rd 1:100
router-target 1:200
int f1/0
ip vrf forwording A
ip add 56.1.1.6 255.255.255.0
router rip
no au
ve 2
address-family ipv4 vrf A
net 56.1.1.0
R5與R8 ospf
R8:
router ospf 100
router-id 8.8.8.8
net 0.0.0.0 0.0.0.0 a 0
R5:
ip vrf B
rd 2:111
route-target 2:222
int f2/0
ip vrf forwarding B
ip add 58.1.1.5 255.255.255.0
router ospf 100 vrf B
router-id 55.55.55.55 //5.5.5.5已經被ospf進程1使用了
net 58.1.1.0 0.0.0.255 a 0
3.配置PE-PE之間的MP-BGP
R2:
router bgp 2345
bgp router-id 2.2.2.2
nei 5.5.5.5 remote-as 2345
nei 5.5.5.5 up lo 0
nei 5.5.5.5 next-hop-self
address-family vpnv4
nei 5.5.5.5 ac
nei 5.5.5.5 send-commiucation
R2:
router bgp 2345
bgp router-id 5.5.5.5
nei 2.2.2.2 remote-as 2345
nei 2.2.2.2 up lo 0
nei 2.2.2.2 next-hop-self
address-family vpnv4
nei 2.2.2.2 ac
nei 2.2.2.2 send-commiucation
4.配置PE的BGP與IGP路由重分發
R2:
在BGP裏重分發RIP
router bgp 2345
address-family ipv4 vrf A
redistribute rip
在RIP裏重分發BGP
router rip
address-family ipv4 vrf A
redistribute bgp 2345 metric transparent
R5:
在BGP裏重分發RIP
router bgp 2345
address-family ipv4 vrf A
redistribute rip
在RIP裏重分發BGP
router rip
address-family ipv4 vrf A
redistribute bgp 2345 metric transparent
R2:
在bgp 裏重分發static
router bgp 2345
address-family ipv4 vrf B
redistribute static
redistribute connection //重分發直連
#########不需要在靜態裏重分發bgp,加個默認路由即可###########
R5:
在BGP裏重分發OSPF
router bgp 2345
address-famliy ipv4 vrf B
redistribute ospf 100 vrf B
在ospf裏重分發BGP
router ospf 100 vrf B
redistribute bgp 2345 subnets