MPLS-×××实验_第1张图片

配置脚本:

-----------------------------------------------------R4---------------------------------------------------------

en

conf t

ip cef

int f0/0

ip add 24.1.1.4 255.255.255.0

no shu

mpls ip

int loo 0

ip add 4.4.4.4 255.255.255.0

no shu

exit

router rip

ver 2

no au

netw 4.4.4.0

netw 24.1.1.0

----------------------------------------R2---------------------------------------

en

conf t

ip cef

ip vrf A

rd 1:1

route-target 1:1

exit

int f0/0

ip vrf forwarding A

ip add 24.1.1.2 255.255.255.0

no shu

mpls ip

int s1/0

ip add 12.1.1.2 255.255.255.0

no shu

mpls ip

int loo 0

ip add 2.2.2.2 255.255.255.0

no shu

exit

router rip

ver 2

no au

netw 12.1.1.0

netw 2.2.2.0

address-family ipv4 vrf A

netw 24.0.0.0

redistribute bgp 123 me tran

exit

exit

router bgp 123

no au

no sy

bgp router-id 2.2.2.2

nei 3.3.3.3 remote-as 123

nei 3.3.3.3 up loo 0

address-family ***v4

neighbor 3.3.3.3 activate

neighbor 3.3.3.3 send-community

exit

address-family ipv4 vrf A

redistribute rip

exit

----------------------------------------R1----------------------------------------

en

conf t

ip cef

int s1/0

ip add 12.1.1.1 255.255.255.0

no shu

mpls ip

int loo 0

ip add 1.1.1.1 255.255.255.0

int s1/1

ip add 13.1.1.1 255.255.255.0

no shu

mpls ip

exit

router rip

ver 2

no au

netw 13.1.1.0

netw 12.1.1.0

netw 1.1.1.0

------------------------------------------R3------------------------------------------

en

conf t

ip cef

ip vrf A

rd 1:1

route-target 1:1

exit

int s1/1

ip add 13.1.1.3 255.255.255.0

no shu

mpls ip

int f0/0

ip vrf forwarding A

ip add 35.1.1.3 255.255.255.0

no shu

mpls ip

int loo 0

ip add 3.3.3.3 255.255.255.0

exit

router rip

ver 2

no au

netw 13.1.1.0

netw 3.3.3.0

address-family ipv4 vrf A

netw 35.0.0.0

address-family ipv4 vrf A

redistribute bgp 123 metric transparent 

exit

exit

router bgp 123

no sy

no au

bgp router-id 3.3.3.3

nei 2.2.2.2 remote-as 123

nei 2.2.2.2 up loo 0

address-family ***v4

nei 2.2.2.2 activate

nei 2.2.2.2 send-community

address-family ipv4 vrf A

redistribute rip

-----------------------------------------R5-------------------------------------------

en

conf t

ip cef

int f0/0

ip add 35.1.1.5 255.255.255.0

no shu

mpls ip

int loo 0

ip add 5.5.5.5 255.255.255.0

no sh

router rip

no au

ver 2

netw 35.0.0.0

netw 5.0.0.0

配置步骤:

1.CEPEIGP

2.区分CE相同路由   (X:X)

RD的概念:route Distringushers

3.定义VRF虚拟路由表

 4.RTroute targets,路由的导入导出)

×××V4路由:IPv4+RD+RT

查看命令:

R2#show ip bgp ***v4 all(查看bgp***v4路由)

R2#show ip bgp ***v4 all +明显路由