栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

MPLS跨域Option-A配置

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

MPLS跨域Option-A配置

一.配置实例

实验目的:在CE-A1能够ping 8.8.8.8 source 1.1.1.1

1.基本IP配置

2.AS内运行OSPF

PE-A

Router(config)# router ospf 110

Router(config-router)# router-id 2.2.2.2
 
Router(config-router)# network 2.2.2.2 0.0.0.0 area 0
 
Router(config-router)# network 10.1.23.2 0.0.0.0 area 0
P-A

Router(config)# router ospf 110

Router(config-router)# router-id 3.3.3.3
 
Router(config-router)#  network 3.3.3.3 0.0.0.0 area 0
 
Router(config-router)# network 10.1.23.3 0.0.0.0 area 0

Router(config-router)# network 10.1.34.3 0.0.0.0 area 0
ASBR-A

Router(config)# router ospf 110

Router(config-router)# router-id 4.4.4.4
 
Router(config-router)# network 4.4.4.4 0.0.0.0 area 0
 
Router(config-router)# network 10.1.34.4 0.0.0.0 area 0
ASBR-B

Router(config)# router ospf 110

Router(config-router)# router-id 5.5.5.5
 
Router(config-router)# network 5.5.5.5 0.0.0.0 area 0
 
Router(config-router)# network 10.1.56.5 0.0.0.0 area 0
P-B

Router(config)# router ospf 110

Router(config-router)# router-id 6.6.6.6
 
Router(config-router)# network 6.6.6.6 0.0.0.0 area 0
 
Router(config-router)# network 10.1.56.6 0.0.0.0 area 0

Router(config-router)# network 10.1.67.6 0.0.0.0 area 0
PE-B

Router(config)# router ospf 110

Router(config-router)# router-id 7.7.7.7
 
Router(config-router)# network 7.7.7.7 0.0.0.0 area 0
 
Router(config-router)# network 10.1.67.7 0.0.0.0 area 0

3.AS内激活MPLS

PE-A

Router(config)# ip cef		//通常默认开启

Router(config)# mpls label range xxx xxx		//选配

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/1
 
Router(config-if)# mpls ip
P-A

Router(config)# ip cef		//通常默认开启

Router(config)# mpls label range xxx xxx		//选配

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/0
 
Router(config-if)# mpls ip

Router(config)# int e0/1
 
Router(config-if)# mpls ip
ASBR-A

Router(config)# ip cef		//通常默认开启

Router(config)# mpls label range xxx xxx		//选配

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/0
 
Router(config-if)# mpls ip
ASBR-B

Router(config)# ip cef		//通常默认开启

Router(config)# mpls label range xxx xxx		//选配

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/1
 
Router(config-if)# mpls ip
P-B

Router(config)# ip cef		//通常默认开启

Router(config)# mpls label range xxx xxx		//选配

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/0
 
Router(config-if)# mpls ip

Router(config)# int e0/1
 
Router(config-if)# mpls ip
PE-B

Router(config)# ip cef		//通常默认开启

Router(config)# mpls label range xxx xxx		//选配

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/0
 
Router(config-if)# mpls ip

4.AS内PE和ASBR建立IBGP并使能MP-IBGP

PE-A

Router(config)# router bgp 1

Router(config-router)# bgp router-id interface Loopback0

Router(config-router)# no bgp default ipv4-unicast
 
Router(config-router)# neighbor 4.4.4.4 remote-as 1
 
Router(config-router)# neighbor 4.4.4.4 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 4.4.4.4 activate
ASBR-A

Router(config)# router bgp 1

Router(config-router)# bgp router-id interface Loopback0

Router(config-router)# no bgp default ipv4-unicast
 
Router(config-router)# neighbor 2.2.2.2 remote-as 1
 
Router(config-router)# neighbor 2.2.2.2 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 2.2.2.2 activate
ASBR-B

Router(config)# router bgp 2

Router(config-router)# bgp router-id interface Loopback0

Router(config-router)# no bgp default ipv4-unicast
 
Router(config-router)# neighbor 7.7.7.7 remote-as 1
 
Router(config-router)# neighbor 7.7.7.7 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 7.7.7.7 activate
PE-B

Router(config)# router bgp 2

Router(config-router)# bgp router-id interface Loopback0

Router(config-router)# no bgp default ipv4-unicast
 
Router(config-router)# neighbor 5.5.5.5 remote-as 1
 
Router(config-router)# neighbor 5.5.5.5 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 5.5.5.5 activate

5.AS内PE和ASBR绑定VPN实例

PE-A

Router(config)# ip vrf aolc

Router(config-vrf)# rd 1:1

Router(config-vrf)# route-target export 1:2		#需要和本AS内ASBR对应
 
Router(config-vrf)# route-target import 2:1		#需要和本AS内ASBR对应
 
Router(config)# int e0/0

Router(config-if)# ip vrf forwarding aolc

Router(config-if)# ip address 10.1.12.2 255.255.255.0
ASBR-A

Router(config)# ip vrf aolc

Router(config-vrf)# rd 1:1

Router(config-vrf)# route-target export 2:1		#需要和本AS内PE对应
 
Router(config-vrf)# route-target import 1:2		#需要和本AS内PE对应
 
Router(config)# int e0/1

Router(config-if)# ip vrf forwarding aolc

Router(config-if)# ip address 10.1.45.4 255.255.255.0
ASBR-B

Router(config)# ip vrf aolc

Router(config-vrf)# rd 1:1

Router(config-vrf)# route-target export 2:1		#需要和本AS内PE对应
 
Router(config-vrf)# route-target import 1:2		#需要和本AS内PE对应
 
Router(config)# int e0/1

Router(config-if)# ip vrf forwarding aolc

Router(config-if)# ip address 10.1.56.5 255.255.255.0
PE-B

Router(config)# ip vrf aolc

Router(config-vrf)# rd 1:1

Router(config-vrf)# route-target export 1:2		#需要和本AS内ASBR对应
 
Router(config-vrf)# route-target import 2:1		#需要和本AS内ASBR对应
 
Router(config)# int e0/0

Router(config-if)# ip vrf forwarding aolc

Router(config-if)# ip address 10.1.78.7 255.255.255.0

6.PE和CE间运行路由协议

CE-A

Router(config)# router bgp 65001

Router(config-router)# bgp router-id interface Loopback0
 
Router(config-router)# no bgp default ipv4-unicast
 
Router(config-router)# neighbor 10.1.12.2 remote-as 1

Router(config-router)# address-family ipv4
 
Router(config-router-af)# network 1.1.1.1 mask 255.255.255.255
 
Router(config-router-af)# neighbor 10.1.12.2 activate
PE-A

Router(config)# router BGP 1

Router(config-router)# address-family ipv4 vrf aolc

Router(config-router)# neighbor 10.1.12.1 remote-as 65001

Router(config-router)# neighbor 10.1.12.1 activate
CE-B

Router(config)# router bgp 65002

Router(config-router)# bgp router-id interface Loopback0
 
Router(config-router)# no bgp default ipv4-unicast
 
Router(config-router)# neighbor 10.1.78.7 remote-as 2

Router(config-router)# address-family ipv4
 
Router(config-router-af)# network 8.8.8.8 mask 255.255.255.255
 
Router(config-router-af)# neighbor 10.1.78.7 activate
PE-B

Router(config)# router BGP 2

Router(config-router)# address-family ipv4 vrf aolc

Router(config-router)# neighbor 10.1.78.7 remote-as 65002

Router(config-router)# neighbor 10.1.78.7 activate

7.ASBR间建立MP-EBGP

ASBR-A

Router(config)# router bgp 1

Router(config-router)# address-family ipv4 vrf aolc
 
Router(config-router-af)# neighbor 10.1.45.5 remote-as 2

Router(config-router-af)# neighbor 10.1.45.5 activate
ASBR-B

Router(config)# router bgp 2

Router(config-router)# address-family ipv4 vrf aolc
 
Router(config-router-af)# neighbor 10.1.45.4 remote-as 1

Router(config-router-af)# neighbor 10.1.45.4 activate

8.查看命令

查看vpnv4邻居

Router# sh ip bgp vpnv4 all summary

查看VRF路由表

Router# sh ip route vrf aolc
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/311002.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号