MPLS ×××实例配置_VPN























需求:

R1 R5模拟A公司总分部网关,R6 R7模拟B公司总分部网关, R2 R3 R4模拟公网路由器,在两家公司内部架设MPLS ×××

 

公网底层起EIGRP邻居,保证TCP可达。

公网起×××V4 BGP邻居

R2(config)#router bgp 1

R2(config-router)#no address-family ipv4      

R2(config-router)#neighbor 4.4.4.4 remote-as 1

R2(config-router)#nei 4.4.4.4 update-source loo1

R2(config-router)#address-family vpnv4

R2(config-router-af)#nei 4.4.4.4 activate 

R2(config-router-af)#nei 4.4.4.4 next-hop-self 

 

R4(config)#router bgp 1

R4(config-router)#no address-family ipv4

R4(config-router)#nei 2.2.2.2 remote-as 1

R4(config-router)#nei 2.2.2.2 update-source loo1

R4(config-router)#address-family vpnv4

R4(config-router-af)#nei 2.2.2.2 activate 

R4(config-router-af)#nei 2.2.2.2 next-hop-self 

 

查看vpnv4 汇总情况

MPLS ×××实例配置_MPLS _02 

 

 

 

 

在公网上起MPLS

R2(config)#mpls ldp router-id loo1 //手动指定MPLS标识

R2(config)#int f1/0

R2(config-if)#mpls ip

R2(config-if)#mpl

R2(config-if)#mpls label range 200 299  //设定标签范围

 

R3(config)#mpls ldp router-id loo1

R3(config)#int f0/0

R3(config-if)#mpls ip

R3(config-if)#mpls label rang 200 299

R3(config)#int f0/1

R3(config-if)#mpls ip

R3(config-if)#mpls label rang 200 299

 

R4(config)#mpls ldp router-id loo1

R4(config)#int f0/0

R4(config-if)#mpls ip

R4(config-if)#mpls label range 200 299

MPLS ×××实例配置_MPLS _03 

MPLS ×××实例配置_VPN_04 

 

 

 

 

配置IGP

R2(config)#ip vrf A-site1  //创建VRF

R2(config-vrf)#rd 1:1

R2(config-vrf)#route-target both 1:1

R2(config)#ip vrf B-site1

R2(config-vrf)#rd 2:2

R2(config-vrf)#route-target both 2:2

R2(config)#int f0/0

R2(config-if)#ip vrf forwarding A-site1   //关联接口

R2(config-if)#ip add 192.168.12.2 255.255.255.0

R2(config)#int f0/1

R2(config-if)#ip vrf forwarding B-site1

R2(config-if)#ip add 172.16.26.2 255.255.255.0

 

R4(config)#ip vrf A-site2

R4(config-vrf)#rd 1:1

R4(config-vrf)#route-target both 1:1 

R4(config)#ip vrf B-site2

R4(config-vrf)#rd 2:2

R4(config-vrf)#route-target both 2:2

R4(config)#int f0/1

R4(config-if)#ip vrf forwarding A-site2

R4(config-if)#ip add 192.168.45.4 255.255.255.0

R4(config)#int f1/0

R4(config-if)#ip vrf forwarding B-site2

R4(config-if)#ip add 172.16.47.4 255.255.255.0

 

查找VRF表 A-site1 192.168.12.1 是否能沟通

MPLS ×××实例配置_VPN_05 

 

IGPOSPF邻居,绑定VRF

R1(config)#router os 1

R1(config-router)#net 192.168.12.1 0.0.0.0 a 1

R6(config)#router os 2

R6(config-router)#net 172.16.26.6 0.0.0.0 a 2

 

R2(config)#router os 1 vrf A-site1

R2(config-router)#net 192.168.12.2 0.0.0.0 a 1

R2(config)#router os 2 vrf B-site1

R2(config-router)#net 172.16.26.2 0.0.0.0 a 2

 

R5(config)#router os 1

R5(config-router)#net 192.168.45.5 0.0.0.0 a 1

R7(config)#router os 2

R7(config-router)#net 172.16.47.7 0.0.0.0 a 2

 

R4(config)#router os 1 vrf A-site2

R4(config-router)#net 192.168.45.4 0.0.0.0 a 1

R4(config)#router os 2 vrf B-site2

R4(config-router)#net 172.16.47.4 0.0.0.0 a 2

 

OSPF BGP相互重分发

R2(config)#router bgp 1

R2(config-router)#address-family ipv4 vrf A-site1

R2(config-router-af)#redistribute ospf 1 vrf A-site1

R2(config-router)#address-family ipv4 vrf B-site1

R2(config-router-af)#redistribute ospf 2 vrf B-site1

 

R4(config)#router bgp 1

R4(config-router)#address-family ipv4 vrf A-site2

R4(config-router-af)#redistribute ospf 1 vrf A-site2

R4(config-router)#address-family ipv4 vrf B-site2

R4(config-router-af)#redistribute ospf 2 vrf B-site2

 

R2(config)#router os 1

R2(config-router)#redistribute bgp 1 subnets 

R2(config)#router os 2

R2(config-router)#redistribute bgp 1 subnets 

 

R4(config)#router os 1

R4(config-router)#redistribute bgp 1 subnets 

R4(config)#router os 2

R4(config-router)#redistribute bgp 1 subnets 


R1上再起一个环回口,通告进OSPF 1 测试下连通性

 

MPLS ×××实例配置_MPLS _06