10.6 MPLS VPN

图片[1]-10.6 MPLS VPN-大赛人网
图10-9 MPLS VPN网络拓扑

1.PE1、P、PE2配置OSPF实现PE之间的互通

1)PE1配置OSPF

[PE1]ospf 1 router-id 1.1.1.1
[PE1-ospf-1]area 0
[PE1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255

2)P配置OSPF

[P]ospf 1 router-id 2.2.2.2
[P-ospf-1]area 0
[P-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[P-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255

3)PE2配置OSPF

[PE2]ospf 1 router-id 3.3.3.3 
[PE2-ospf-1]area 0
[PE2-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0    
[PE2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255

2.配置MPLS基本能力和MPLS LDP,建立MPLS LSP

1)PE1配置MPLS LDP

[PE1]mpls lsr-id 1.1.1.1
//定义mpls的router-id
[PE1]mpls
//开启mpls协议
[PE1]mpls ldp
//激活LDP协议
[PE1]interface GigabitEthernet 0/0/0
[PE1-GigabitEthernet0/0/0]mpls
[PE1-GigabitEthernet0/0/0]mpls ldp
//在所有标签经过的接口上开启协议  

2)P配置MPLS LDP

[P]mpls lsr-id 2.2.2.2
[P]mpls
[P]mpls ldp
[P]interface GigabitEthernet 0/0/0
[P-GigabitEthernet0/0/0]mpls
[P-GigabitEthernet0/0/0]mpls ldp
[P]interface GigabitEthernet 0/0/1
[P-GigabitEthernet0/0/0]mpls
[P-GigabitEthernet0/0/0]mpls ldp

3)PE2配置MPLS LDP

[PE2]mpls lsr-id 3.3.3.3
[PE2]mpls
[PE2]mpls ldp
[PE2]interface GigabitEthernet 0/0/1
[PE2-GigabitEthernet0/0/1]mpls
[PE2-GigabitEthernet0/0/1]mpls ldp

3.PE上配置使能IPv4地址族VPN实例,并把与CE相连的接口和相应的VPN实例绑定

1)PE1配置使能IPv4地址族VPN实例dsrwa

[PE1]ip vpn-instance dsrwa
//创建vrf空间
[PE1-vpn-instance-dsrwa]ipv4-family
[PE1-vpn-instance-dsrwa-af-ipv4]route-distinguisher 100:1
[PE1-vpn-instance-dsrwa-af-ipv4]vpn-target 111:1 export-extcommunity 
[PE1-vpn-instance-dsrwa-af-ipv4]vpn-target 111:1 import-extcommunity 
// 设置RD值和RT值,RT值必须对端的PE端一致

2)PE1配置使能IPv4地址族VPN实例dsrwb

[PE1]ip vpn-instance dsrwb
[PE1-vpn-instance-dsrwb]ipv4-family
[PE1-vpn-instance-dsrwb-af-ipv4]route-distinguisher 100:2
[PE1-vpn-instance-dsrwb-af-ipv4]vpn-target 222:2 export-extcommunity              
[PE1-vpn-instance-dsrwb-af-ipv4]vpn-target 222:2 import-extcommunity 

3)PE1与CE1相连的接口和相应的VPN实例绑定

[PE1]interface GigabitEthernet 0/0/1
[PE1-GigabitEthernet0/0/1]ip binding vpn-instance dsrwa
[PE1-GigabitEthernet0/0/1]ip address 14.1.1.1 8 

4)PE1与CE2相连的接口和相应的VPN实例绑定

[PE1]interface GigabitEthernet 0/0/2
[PE1-GigabitEthernet0/0/2]ip binding vpn-instance dsrwb
[PE1-GigabitEthernet0/0/2]ip address 15.1.1.1 8

5)PE2配置使能IPv4地址族VPN实例dsrwa

[PE2]ip vpn-instance dsrwa
[PE2-vpn-instance-dsrwa]ipv4-family
[PE2-vpn-instance-dsrwa-af-ipv4]route-distinguisher 200:1
[PE2-vpn-instance-dsrwa-af-ipv4]vpn-target 111:1 export-extcommunity
[PE2-vpn-instance-dsrwa-af-ipv4]vpn-target 111:1 import-extcommunity

6)PE2配置使能IPv4地址族VPN实例dsrwb

[PE2]ip vpn-instance dsrwb
[PE2-vpn-instance-dsrwb]ipv4-family
[PE2-vpn-instance-dsrwa-af-ipv4]route-distinguisher 200:2
[PE2-vpn-instance-dsrwb-af-ipv4]vpn-target 222:2 export-extcommunity
[PE2-vpn-instance-dsrwb-af-ipv4]vpn-target 222:2 import-extcommunity

7)PE2与CE3相连的接口和相应的VPN实例绑定

[PE2]interface GigabitEthernet 0/0/0
[PE2-GigabitEthernet0/0/0]ip binding vpn-instance dsrwa
[PE2-GigabitEthernet0/0/0]ip address 36.1.1.3 8

8)PE2与CE4相连的接口和相应的VPN实例绑定

[PE2]interface GigabitEthernet 0/0/2
[PE2-GigabitEthernet0/0/2]ip binding vpn-instance dsrwb
[PE2-GigabitEthernet0/0/2]ip address 37.1.1.3 8

4.PE之间配置MP-IBGP交换VPN路由信息

1)PE1配置

[PE1]bgp 123
[PE1-bgp]peer 3.3.3.3 as-number 123
[PE1-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[PE1-bgp]ipv4-family vpnv4
[PE1-bgp-af-vpnv4]peer 3.3.3.3 enable

2)PE2配置

[PE2]bgp 123
[PE2-bgp]peer 1.1.1.1 as-number 123
[PE2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[PE2-bgp]ipv4-family vpnv4
[PE2-bgp-af-vpnv4]peer 1.1.1.1 enable 

5.CE与PE之间配置EBGP交换VPN路由信息

1)CE1配置

[CE1]bgp 400
[CE1-bgp]peer 14.1.1.1 as-number 123
[CE1-bgp]ipv4-family unicast 
[CE1-bgp-af-ipv4]network 4.4.4.4 255.255.255.255

2)CE2配置

[CE2]bgp 500
[CE2-bgp]peer 15.1.1.1 as-number 123
[CE2-bgp]ipv4-family unicast
[CE2-bgp-af-ipv4]network 5.5.5.5 255.255.255.255 

3)CE3配置

[CE3]bgp 600
[CE3-bgp]peer 36.1.1.3 as-number 123
[CE3-bgp]ipv4-family unicast
[CE3-bgp-af-ipv4]network 6.6.6.6 255.255.255.255

4)CE4配置

[CE4]bgp 700
[CE4-bgp]peer 37.1.1.3 as-number 123
[CE4-bgp]ipv4-family unicast
[CE4-bgp-af-ipv4]network 7.7.7.7 255.255.255.255

5)PE1配置

[PE1]bgp 123 
[PE1-bgp]ipv4-family vpn-instance dsrwa
[PE1-bgp-dsrwa]peer 14.1.1.4 as-number 400
[PE1-bgp]ipv4-family vpn-instance dsrwb
[PE1-bgp-dsrwb]peer 15.1.1.5 as-number 500

6)PE2配置

[PE2]bgp 123
[PE2-bgp]ipv4-family vpn-instance dsrwa
[PE2-bgp-dsrwa]peer 36.1.1.6 as-number 600
[PE2-bgp]ipv4-family vpn-instance dsrwb
[PE2-bgp-dsrwb]peer 37.1.1.7 as-number 700
© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    请登录后查看评论内容