MPLS跨域Option-A配置

7 篇文章 0 订阅

一.配置实例

实验目的:在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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值