本文主要是介绍【锐捷路由】域内MPLS VPN配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
配置要求
RuijieR1和RuijieS1之间运行OSPF,归属区域0,进程号10
RuijieR2和RuijieS2之间运行OSPF,归属区域0,进程号20
RuijieR3和RuijieS3之间运行OSPF,归属区域0,进程号30
RuijieR1、RuijieR2和RuijieR3之间运行IBGP,AS号为100。IGP协议使用OSPF,归属区域0,进程号40。定义RuijieR1为路由反射器RR,使用Loopback接口建立BGP邻居关系
RuijieR1、RuijieR2和RuijieR3三个网络内部的局域网之间,通过MPLS VPN技术实现安全访问,其中RuijieR1、RuijieR2和RuijieR3开启MPLS报文转发及LDP标签转发协议,VRF名称为VPNA,RD值分别为100:1、100:2、100:3,RT值均为1:1。
RuijieS1、RuijieS2和RuijieS3作为CE设备,完成OSPF协议配置
网络拓扑
地址规划
设备 | 接口 | 地址规划 | 说明 |
---|---|---|---|
RuijieR1 | G0/0 | 12.1.1.1/30 | ToRuijieR2 |
G0/1 | 13.1.1.1/30 | ToRuijieR3 | |
G0/2 | 10.1.0.10/30 | ToRuijieS1 | |
Lo0 | 11.1.0.1/32 | ||
RuijieR2 | G0/0 | 10.1.0.18/30 | ToRuijieS2 |
G0/1 | 12.1.1.2/30 | ToRuijieR1 | |
Lo0 | 11.1.0.2/32 | ||
RuijieR3 | G0/0 | 10.1.0.22/30 | ToRuijieS3 |
G0/1 | 13.1.1.2/30 | ToRuijieR1 | |
Lo0 | 11.1.0.3/32 | ||
RuijieS1 | G0/0 | 10.1.0.9/30 | ToRuijieR1 |
Lo0 | 10.0.0.12/32 | ||
RuijieS2 | G0/1 | 10.1.0.17/30 | ToRuijieR2 |
Lo0 | 10.0.0.1/32 | ||
RuijieS3 | G0/0 | 10.1.0.21/30 | ToRuijieR3 |
Lo0 | 10.0.0.2/32 |
配置命令(地址配置略)
RuijieR1和RuijieS1之间运行OSPF,归属区域0,进程号10
RuiieS1#configure
RuiieS1(config)#router ospf 10
RuiieS1(config-router)#router-id 10.0.0.12
RuiieS1(config-router)#network 10.1.0.8 0.0.0.3 area 0
RuiieS1(config-router)#end
RuiieS1#
RuijieR2和RuijieS2之间运行OSPF,归属区域0,进程号20
RuijieS2#configure
RuijieS2(config)#router ospf 20
RuijieS2(config-router)#router-id 10.0.0.1
RuijieS2(config-router)#network 10.1.0.16 0.0.0.3 area 0
RuijieS2(config-router)#end
RuijieS2#
RuijieR3和RuijieS3之间运行OSPF,归属区域0,进程号30
RuijieS3#configure
RuijieS3(config)#router ospf 30
RuijieS3(config-router)#router-id 10.0.0.2
RuijieS3(config-router)#network 10.1.0.20 0.0.0.3 area 0
RuijieS3(config-router)#end
RuijieS3#
RuijieR1、RuijieR2和RuijieR3之间运行IBGP,AS号为100。IGP协议使用OSPF,归属区域0,进程号40。定义RuijieR1为路由反射器RR,使用Loopback接口建立BGP邻居关系
RuijieR1#configure
RuijieR1(config)#router ospf 40
RuijieR1(config-router)#router-id 11.1.0.1
RuijieR1(config-router)#network 12.1.1.0 0.0.0.3 area 0
RuijieR1(config-router)#network 13.1.1.0 0.0.0.3 area 0
RuijieR1(config-router)#network 11.1.0.1 0.0.0.0 area 0
RuijieR1(config-router)#end
RuijieR1#
RuijieR2#configure
RuijieR2(config)#router ospf 40
RuijieR2(config-router)#router-id 11.1.0.2
RuijieR2(config-router)#network 12.1.1.0 0.0.0.3 area 0
RuijieR2(config-router)#network 11.1.0.2 0.0.0.0 area 0
RuijieR2(config-router)#end
RuijieR2#
RuijieR3#configure
RuijieR3(config)#router ospf 40
RuijieR3(config-router)#router-id 11.1.0.3
RuijieR3(config-router)#network 13.1.1.0 0.0.0.3 area 0
RuijieR3(config-router)#network 11.1.0.3 0.0.0.0 area 0
RuijieR3(config-router)#end
RuijieR3#
RuijieR1#configure
RuijieR1(config)#router bgp 100
RuijieR1(config-router)#neighbor 11.1.0.2 remote-as 100
RuijieR1(config-router)#neighbor 11.1.0.2 update-source loopback 0
RuijieR1(config-router)#neighbor 11.1.0.2 route-reflector-client
RuijieR1(config-router)#neighbor 11.1.0.3 remote-as 100
RuijieR1(config-router)#neighbor 11.1.0.3 update-source loopback 0
RuijieR1(config-router)#neighbor 11.1.0.3 route-reflector-client
RuijieR1(config-router)#end
RuijieR1#
RuijieR2#configure
RuijieR2(config)#router bgp 100
RuijieR2(config-router)#neighbor 11.1.0.1 remote-as 100
RuijieR2(config-router)#neighbor 11.1.0.1 update-source loopback 0
RuijieR2(config-router)#end
RuijieR2#
RuijieR3#configure
RuijieR3(config)#router bgp 100
RuijieR3(config-router)#neighbor 11.1.0.1 remote-as 100
RuijieR3(config-router)#neighbor 11.1.0.1 update-source loopback 0
RuijieR3(config-router)#end
RuijieR3#
RuijieR1、RuijieR2和RuijieR3三个网络内部的局域网之间,通过MPLS VPN技术实现安全访问,其中RuijieR1、RuijieR2和RuijieR3开启MPLS报文转发及LDP标签转发协议,VRF名称为VPNA,RD值分别为100:1、100:2、100:3,RT值均为1:1。
RuijieR1#configure
RuijieR1(config)#mpls ip
RuijieR1(config)#mpls router ldp
RuijieR1(config-mpls-router)#ldp router-id interface loopback 0 force
RuijieR1(config-mpls-router)#exit
RuijieR1(config)#interface gigabitEthernet 0/0
RuijieR1(config-if-GigabitEthernet 0/0)#mtu 1530
RuijieR1(config-if-GigabitEthernet 0/0)#label-switching
RuijieR1(config-if-GigabitEthernet 0/0)#mpls ip
RuijieR1(config-if-GigabitEthernet 0/0)#exit
RuijieR1(config)#interface gigabitEthernet 0/1
RuijieR1(config-if-GigabitEthernet 0/1)#mtu 1530
RuijieR1(config-if-GigabitEthernet 0/1)#label-switching
RuijieR1(config-if-GigabitEthernet 0/1)#mpls ip
RuijieR1(config-if-GigabitEthernet 0/1)#exit
RuijieR1(config)#router bgp 100
RuijieR1(config-router)#bgp router-id 11.1.0.1
RuijieR1(config-router)#no bgp default ipv4-unicast
RuijieR1(config-router)#bgp log-neighbor-changes
RuijieR1(config-router)#address-family vpnv4 unicast
RuijieR1(config-router-af)#neighbor 11.1.0.2 activate
RuijieR1(config-router-af)#neighbor 11.1.0.2 send-community extended
RuijieR1(config-router-af)#neighbor 11.1.0.3 activate
RuijieR1(config-router-af)#neighbor 11.1.0.3 send-community extended
RuijieR1(config-router-af)#exit-address-family
RuijieR1(config-router)#exit
RuijieR1(config)#ip vrf VPNA
RuijieR1(config-vrf)#rd 100:1
RuijieR1(config-vrf)#route-target bo
RuijieR1(config-vrf)#route-target both 1:1
RuijieR1(config-vrf)#exit
RuijieR1(config)#router ospf 10 vrf VPNA
RuijieR1(config-router)#router-id 10.1.0.10
RuijieR1(config-router)#redistribute bgp metric-type 1 subnets
RuijieR1(config-router)#network 10.1.0.10 0.0.0.0 area 0
RuijieR1(config-router)#exit
RuijieR1(config)#router bgp 100
RuijieR1(config-router)#address-family ipv4 vrf VPNA
RuijieR1(config-router-af)#maximum-prefix 10000
RuijieR1(config-router-af)#redistribute ospf 10 match internal external
RuijieR1(config-router-af)#exit-address-family
RuijieR1(config-router)#exit
RuijieR1(config)#exit
RuijieR1#
RuijieR2#configure
RuijieR2(config)#mpls ip
RuijieR2(config)#mpls router ldp
RuijieR2(config-mpls-router)#ldp router-id interface loopback 0 force
RuijieR2(config-mpls-router)#exit
RuijieR2(config)#interface gigabitEthernet 0/1
RuijieR2(config-if-GigabitEthernet 0/1)#mtu 1530
RuijieR2(config-if-GigabitEthernet 0/1)#label-switching
RuijieR2(config-if-GigabitEthernet 0/1)#mpls ip
RuijieR2(config-if-GigabitEthernet 0/1)#exit
RuijieR2(config)#router bgp 100
RuijieR2(config-router)#bgp router-id 11.1.0.2
RuijieR2(config-router)#no bgp default ipv4-unicast
RuijieR2(config-router)#bgp log-neighbor-changes
RuijieR2(config-router)#address-family vpnv4 unicast
RuijieR2(config-router-af)#neighbor 11.1.0.1 activate
RuijieR2(config-router-af)#neighbor 11.1.0.1 send-community extended
RuijieR2(config-router-af)#exit-address-family
RuijieR2(config-router)#exit
RuijieR2(config)#ip vrf VPNA
RuijieR2(config-vrf)#rd 100:2
RuijieR2(config-vrf)#route-target both 1:1
RuijieR2(config-vrf)#exit
RuijieR2(config)#interface gigabitEthernet 0/0
RuijieR2(config-if-GigabitEthernet 0/0)#ip vrf forwarding VPNA
RuijieR2(config-if-GigabitEthernet 0/0)#ip address 10.1.0.18 30
RuijieR2(config-if-GigabitEthernet 0/0)#exit
RuijieR2(config)#router ospf 20 vrf VPNA
RuijieR2(config-router)#router-id 10.1.0.18
RuijieR2(config-router)#redistribute bgp metric-type 1 subnets
RuijieR2(config-router)#network 10.1.0.18 0.0.0.0 area 0
RuijieR2(config-router)#exit
RuijieR2(config)#router bgp 100
RuijieR2(config-router)#address-family ipv4 vrf VPNA
RuijieR2(config-router-af)#maximum-prefix 10000
RuijieR2(config-router-af)#redistribute ospf 30 match internal external
RuijieR2(config-router-af)#exit-address-family
RuijieR2(config-router)#exit
RuijieR2(config)#exit
RuijieR2#
RuijieR3#configure
RuijieR3(config)#mpls ip
RuijieR3(config)#mpls router ldp
RuijieR3(config-mpls-router)#ldp router-id interface loopback 0 force
RuijieR3(config)#interface gigabitEthernet 0/1
RuijieR3(config-if-GigabitEthernet 0/1)#mtu 1530
RuijieR3(config-if-GigabitEthernet 0/1)#label-switching
RuijieR3(config-if-GigabitEthernet 0/1)#mpls ip
RuijieR3(config-if-GigabitEthernet 0/1)#exit
RuijieR3(config)#router bgp 100
RuijieR3(config-router)#bgp router-id 11.1.0.3
RuijieR3(config-router)#no bgp default ipv4-unicast
RuijieR3(config-router)#bgp log-neighbor-changes
RuijieR3(config-router)#address-family vpnv4 unicast
RuijieR3(config-router-af)#neighbor 11.1.0.1 activate
RuijieR3(config-router-af)#neighbor 11.1.0.1 send-community extended
RuijieR3(config-router-af)#exit-address-family
RuijieR3(config-router)#exit
RuijieR3(config)#ip vrf VPNA
RuijieR3(config-vrf)#rd 100:3
RuijieR3(config-vrf)#route-target both 1:1
RuijieR3(config-vrf)#exit
RuijieR3(config)#interface gigabitEthernet 0/0
RuijieR3(config-if-GigabitEthernet 0/0)#ip vrf forwarding VPNA
RuijieR3(config-if-GigabitEthernet 0/0)#ip address 10.1.0.22 30
RuijieR3(config-if-GigabitEthernet 0/0)#exit
RuijieR3(config)#router ospf 30 vrf VPNA
RuijieR3(config-router)#router-id 10.1.0.22
RuijieR3(config-router)#redistribute bgp metric-type 1 subnets
RuijieR3(config-router)#network 10.1.0.22 0.0.0.0 area 0
RuijieR3(config-router)#exit
RuijieR3(config)#router bgp 100
RuijieR3(config-router)#address-family ipv4 vrf VPNA
RuijieR3(config-router-af)#maximum-prefix 10000
RuijieR3(config-router-af)#redistribute ospf 40 match internal external
RuijieR3(config-router-af)#exit-address-family
RuijieR3(config-router)#exit
RuijieR3(config)#exit
RuijieR3#
结果验证
这篇关于【锐捷路由】域内MPLS VPN配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!