方案A:vpn-instance to vpn-instance(PE-CE)

方案A:vpn-instance to vpn-instance(PE-CE)

在这里插入图片描述
1.AS100 和AS200内部网络
(1)MPBGP

[R2-ospf-1]dis this
ospf 1 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 10.1.23.2 0.0.0.0 
[R3-ospf-1]dis this
ospf 1 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 10.1.23.3 0.0.0.0 
  network 10.1.34.3 0.0.0.0 
[R4-ospf-1]dis this
ospf 1 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 10.1.34.4 0.0.0.0 

[R2]bgp 100
[R2-bgp]pee 4.4.4.4 as 100
[R2-bgp]pee 4.4.4.4 c l0
[R2-bgp]ipv4-family vpnv4	
[R2-bgp-af-vpnv4]pee 4.4.4.4 enable 
[R4]bgp 100
[R4-bgp]pee 2.2.2.2 as 100
[R4-bgp]pee 2.2.2.2 c l0
[R4-bgp]ipv4-family vpnv4	
[R4-bgp-af-vpnv4]pee 2.2.2.2 enable

[R2]dis bgp vpnv4 all  peer 

[R7-ospf-2]dis th
ospf 2 
 area 0.0.0.0 
  network 7.7.7.7 0.0.0.0 
  network 10.1.67.7 0.0.0.0 
[R6-ospf-2]dis th
ospf 2 
 area 0.0.0.0 
  network 6.6.6.6 0.0.0.0 
  network 10.1.56.6 0.0.0.0 
  network 10.1.67.6 0.0.0.0
[R5-ospf-2]dis th
ospf 2 
 area 0.0.0.0 
  network 5.5.5.5 0.0.0.0 
  network 10.1.56.5 0.0.0.0 

[R7-bgp]dis th
bgp 200
 peer 5.5.5.5 as-number 200 
 peer 5.5.5.5 connect-interface LoopBack0
 ipv4-family vpnv4
  peer 5.5.5.5 enable
[R5-bgp]dis th
bgp 200
 peer 7.7.7.7 as-number 200 
 peer 7.7.7.7 connect-interface LoopBack0 
 ipv4-family vpnv4
  peer 7.7.7.7 enable

(2)MPLS LDP

[R2]mpls lsr-id  2.2.2.2
[R2]mpls
[R2-mpls]mpls ldp 
[R2-mpls-ldp]int g0/0/1
[R2-GigabitEthernet0/0/1]mpls
[R2-GigabitEthernet0/0/1]mpls ldp

[R3]mpls lsr-id  3.3.3.3
[R3]mpls
[R3-mpls]mpls ldp 
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]mpls
[R3-GigabitEthernet0/0/0]mpls ldp 
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]mpls
[R3-GigabitEthernet0/0/1]mpls ldp 

[R4]mpls lsr-id  4.4.4.4
[R4]mpls
[R4-mpls]mpls ldp 
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]mpls
[R4-GigabitEthernet0/0/0]mpls ldp 

2.在PE和ASBR-PE上创建VPN-instance,绑定接口,并且建立相应的邻居

[R2/R4-vpn-instance-1]dis this
ip vpn-instance 1
 ipv4-family
  route-distinguisher 1:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
[R5-vpn-instance-1]dis this
ip vpn-instance 1
 ipv4-family
  route-distinguisher 2:2
  vpn-target 2:2 export-extcommunity
  vpn-target 2:2 import-extcommunity

[R2-GigabitEthernet0/0/0]dis this
interface GigabitEthernet0/0/0
 ip binding vpn-instance 1
 ip address 10.1.12.2 255.255.255.0 
[R5-GigabitEthernet0/0/0]dis this
interface GigabitEthernet0/0/0
 ip binding vpn-instance 1
 ip address 10.1.45.5 255.255.255.0 
[R4-GigabitEthernet0/0/1]dis this
interface GigabitEthernet0/0/1
 ip binding vpn-instance 1
 ip address 10.1.45.4 255.255.255.0 
[R7-GigabitEthernet0/0/1]dis this
interface GigabitEthernet0/0/1
 ip binding vpn-instance 1
 ip address 10.1.78.7 255.255.255.0 

CE-PE建立EBGP邻居

[R1-bgp]dis this
bgp 300
 peer 10.1.12.2 as-number 100 

ASBR-PE设备(R4 和R5)建立VPN-instance的EBGP邻居

[R4]bgp 100	
[R4-bgp]ipv4-family vpn-instance 1
[R4-bgp-1]dis this
 ipv4-family vpn-instance 1 
  peer 10.1.45.5 as-number 200 
[R5]bgp 200
[R5-bgp]ipv4-family vpn-instance 1
[R5-bgp-1]dis this
 ipv4-family vpn-instance 1 
  peer 10.1.45.4 as-number 100 

[R4-bgp]dis bgp vpnv4 all  peer 
 Peer of IPv4-family for vpn instance :
 
 VPN-Instance 1, Router ID 10.1.34.4:
  10.1.45.5       4         200       60       60     0 00:57:30 Established 

3.生成路由传递

[R1]bgp 300
[R1-bgp]network 1.1.1.1 32
[R8]bgp 400
[R8-bgp]network  8.8.8.8 32

4.测试

[R4]dis bgp vpnv4 all routing-table
[R1]ping -a 1.1.1.1 8.8.8.8

在这里插入图片描述
在这里插入图片描述

  • 1
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值