局域网组网 实验7 MPLS VNP

在这里插入图片描述
在这里插入图片描述
配置:
AR1:

#
interface GigabitEthernet0/0/0
 ip address 10.1.2.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 10.1.1.1 255.255.255.255 
#
ip route-static 10.1.3.0 255.255.255.0 10.1.2.2
ip route-static 10.1.4.0 255.255.255.0 10.1.2.2

AR2:

#
interface GigabitEthernet0/0/0
 ip address 10.1.2.1 255.255.255.0
#
interface LoopBack0
 ip address 10.1.1.1 255.255.255.0 
#
rip 1
 version 2
 network 10.0.0.0
AR3:
#
ip vpn-instance a1
 ipv4-family
  route-distinguisher 2:2
  vpn-target 2:2 export-extcommunity
  vpn-target 2:2 import-extcommunity
#
ip vpn-instance b1
 ipv4-family
  route-distinguisher 1:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance b1
 ip address 10.1.2.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance a1
 ip address 10.1.2.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 34.1.1.3 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255 
#
bgp 1
 router-id 3.3.3.3
 peer 5.5.5.5 as-number 1 
 peer 5.5.5.5 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 5.5.5.5 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 5.5.5.5 enable
 #
 ipv4-family vpn-instance a1 
  import-route rip 1
 #
 ipv4-family vpn-instance b1 
  import-route direct
  import-route static
#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 34.1.1.3 0.0.0.0 
#
rip 1 vpn-instance a1
 undo summary
 version 2
 network 10.0.0.0
 import-route bgp
#
ip route-static vpn-instance b1 10.1.1.0 255.255.255.0 10.1.2.1

AR4:

#
mpls lsr-id 4.4.4.4
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 45.1.1.4 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
 ip address 34.1.1.4 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.0 
#
ospf 1 router-id 4.4.4.4 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 34.1.1.4 0.0.0.0 
  network 45.1.1.4 0.0.0.0 
AR5:
#
ip vpn-instance a2
 ipv4-family
  route-distinguisher 2:2
  vpn-target 2:2 export-extcommunity
  vpn-target 2:2 import-extcommunity
#
ip vpn-instance b2
 ipv4-family
  route-distinguisher 1:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 45.1.1.5 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance b2
 ip address 10.1.3.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 57.1.1.5 255.255.255.0 
#
interface GigabitEthernet2/0/0
 ip binding vpn-instance a2
 ip address 10.1.3.2 255.255.255.0 
#
interface LoopBack0
 ip address 5.5.5.5 255.255.255.0 
#
bgp 1
 router-id 5.5.5.5
 peer 3.3.3.3 as-number 1 
 peer 3.3.3.3 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 3.3.3.3 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 3.3.3.3 enable
 #
 ipv4-family vpn-instance a2 
  import-route ospf 2
 #
 ipv4-family vpn-instance b2 
  import-route direct
  import-route static
#
ospf 1 router-id 5.5.5.5 
 silent-interface GigabitEthernet0/0/2
 area 0.0.0.0 
  network 5.5.5.5 0.0.0.0 
  network 45.1.1.5 0.0.0.0 
  network 57.1.1.5 0.0.0.0 
#
ospf 2 vpn-instance a2
 import-route bgp
 area 0.0.0.0 
  network 10.1.3.0 0.0.0.255 
#
ip route-static vpn-instance b2 10.1.4.0 255.255.255.0 10.1.3.1

AR6:

#
interface GigabitEthernet0/0/1
 ip address 10.1.3.1 255.255.255.0 
#
interface LoopBack0
 ip address 10.1.4.1 255.255.255.0 
#
ip route-static 10.1.1.0 255.255.255.0 10.1.3.2
ip route-static 10.1.2.0 255.255.255.0 10.1.3.2
AR7:
#
interface GigabitEthernet0/0/1
 ip address 10.1.3.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 57.1.1.7 255.255.255.0 
#
interface LoopBack0
 ip address 10.1.4.2 255.255.255.0 
#
ospf 1 
 area 0.0.0.0 
  network 10.1.3.1 0.0.0.0 
  network 10.1.4.0 0.0.0.255 
#
ip route-static 0.0.0.0 0.0.0.0 57.1.1.5

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

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值