MPLS实验

实验要求:

实验拓扑:

 实验思路:

1、配置ip地址(r20口和1口先不配)

 

2、在mpls域里面启动ospf,启动mpls

3、创建2个VRF空间,携带rd 和rt值,绑定VRF空间对应的接口,然后再接口配置ip

4、在vrf空间建立MP-BGP邻居发布路由

5、在r1r2、r4r5上写静态(r2上静态写入VRF空间),在r6、r2和r4、r7分别启动rip、ospf,在VRF空间r2、r7重发布

6、缺省使r7可以访问r2、r3环回

配置命令:

1、配置IP

2、启动ospf 、启动mpls

r2

ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 192.168.2.0 0.0.0.255 

network 10.0.0.0 0.0.0.255 

mpls lsr-id 2.2.2.2
mpls
mpls ldp

interface GigabitEthernet0/0/2
 ip address 192.168.2.1 255.255.255.0 
 mpls
 mpls ldp
 

r3

ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 192.168.2.0 0.0.0.255 
  network 192.168.4.0 0.0.0.255

r4

ospf 1 router-id 4.4.4.4 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 192.168.4.0 0.0.0.255

mpls lsr-id 4.4.4.4
mpls
mpls ldp

interface GigabitEthernet0/0/0
 ip address 192.168.4.2 255.255.255.0 
 mpls
 mpls ldp
3、创建2个VRF空间,携带rd 和rt值,绑定VRF空间对应的接口

r2

ip vpn-instance a
 ipv4-family
  route-distinguisher 100:100
  vpn-target 100:1 export-extcommunity
  vpn-target 100:2 import-extcommunity

interface GigabitEthernet0/0/0
 ip binding vpn-instance a
 ip address 192.168.1.2 255.255.255.0

ip vpn-instance b
 ipv4-family
  route-distinguisher 200:2
  vpn-target 200:1 export-extcommunity
  vpn-target 200:2 import-extcommunity

interface GigabitEthernet0/0/1
 ip binding vpn-instance b
 ip address 192.168.3.2 255.255.255.0 

r4

ip vpn-instance b
 ipv4-family
  route-distinguisher 100:100
  vpn-target 100:2 export-extcommunity
  vpn-target 100:1 import-extcommunity

interface GigabitEthernet0/0/1
 ip binding vpn-instance b
 ip address 192.168.5.1 255.255.255.0 

ip vpn-instance a
 ipv4-family
  route-distinguisher 200:2
  vpn-target 200:2 export-extcommunity
  vpn-target 200:1 import-extcommunity

interface GigabitEthernet0/0/2
 ip binding vpn-instance a
 ip address 192.168.6.1 255.255.255.0 

4、在vrf空间建立MP-BGP邻居发布路由

r2

bgp 2
 router-id 2.2.2.2
 peer 4.4.4.4 as-number 2 
 peer 4.4.4.4 connect-interface LoopBack0

ipv4-family vpnv4(让bgp传递vpn4)
  policy vpn-target
  peer 4.4.4.4 enable
ipv4-family vpn-instance a (VRF空间)
  import-route direct
  import-route static
 ipv4-family vpn-instance b 
  import-route rip 1
rip 1 vpn-instance b(在VRF空间内启动rip)
 version 2
 network 192.168.3.0
 import-route bgp
ip route-static vpn-instance a 1.1.1.0 255.255.255.0 192.168.1.1

r4

bgp 2
 router-id 4.4.4.4
 peer 2.2.2.2 as-number 2 
 peer 2.2.2.2 connect-interface LoopBack0
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 2.2.2.2 enable
 #
 ipv4-family vpn-instance a 
  import-route ospf 2
 #
 ipv4-family vpn-instance b 
  import-route direct
  import-route static

ospf 2 router-id 4.4.4.4 vpn-instance a
 import-route bgp
 area 0.0.0.0 
  network 192.168.6.0 0.0.0.255 
ip route-static vpn-instance b 5.5.5.0 255.255.255.0 192.168.5.2
 

5、使r7可以访问r2、r3环回

ip route-static 0.0.0.0 0.0.0.0 10.0.0.2

实验结果:

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值