路由器VRF多个虚拟路由器测试

一.测试拓扑:
  
参考链接:
A.Configuring VRF Tables-思科MPLS教程
http://www.doc88.com/p-085712708378.html
B.如何利用VRF在单台路由器上创建多份路由表
http://net.zdnet.com.cn/files/all-2081627.htm
C.在Cisco路由器上配置VRF-aware IPsec VPN
http://networking.ctocio.com.cn/76/12336576.shtml
二.基本配置:
A.SW1:
①创建VLAN
vlan database 
vlan 11
vlan 12
 exit
②接口划入VLAN
interface FastEthernet0/1
 switch mode access
 switchport access vlan 11
 no shut
interface FastEthernet0/2
 switch mode access
 switchport access vlan 12
 no shut
③trunk接口配置
interface FastEthernet0/0
 sw trunk encapsulation dot1q 
 switchport mode trunk
 no shut
B.R1:
①创建VRF
ip vrf vd01
 rd 1:1
ip vrf vd02
 rd 2:2
②划分子接口,并将子接口划分到vrf中
---处于不同vrf的子接口IP可以相同
interface FastEthernet0/0
 no shut
interface FastEthernet0/0.11
 encapsulation dot1Q 11
 ip vrf forwarding vd01
 ip address 10.1.1.1 255.255.255.0
interface FastEthernet0/0.12
 encapsulation dot1Q 12
 ip vrf forwarding vd02
 ip address 10.1.1.1 255.255.255.0
interface FastEthernet1/0
 no shut
interface FastEthernet1/0.21
 encapsulation dot1Q 21
 ip vrf forwarding vd01
 ip address 202.100.1.1 255.255.255.0
interface FastEthernet1/0.22
 encapsulation dot1Q 22
 ip vrf forwarding vd02
 ip address 202.100.1.1 255.255.255.0
③测试:
1.路由器能ping通VRF的接口地址
R1#ping vrf vd01 10.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms
R1#
R1#ping vrf vd02 10.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R1#
R1#ping vrf vd01 202.100.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.100.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R1#ping vrf vd02 202.100.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.100.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms
R1#
2.两个VPC配置相同的地址,都能ping通路由器的子接口地址
 
C.R2:
①创建VRF
ip vrf vd01
 rd 1:1
ip vrf vd02
 rd 2:2
②划分子接口,并将子接口划分到vrf中
---处于不同vrf的子接口IP可以相同
interface FastEthernet0/0
 no shut
interface FastEthernet0/0.11
 encapsulation dot1Q 11
 ip vrf forwarding vd01
 ip address 20.1.1.1 255.255.255.0
interface FastEthernet0/0.12
 encapsulation dot1Q 12
 ip vrf forwarding vd02
 ip address 20.1.1.1 255.255.255.0
interface FastEthernet1/0
 no shut
interface FastEthernet1/0.21
 encapsulation dot1Q 21
 ip vrf forwarding vd01
 ip address 202.100.1.2 255.255.255.0
interface FastEthernet1/0.22
 encapsulation dot1Q 22
 ip vrf forwarding vd02
 ip address 202.100.1.2 255.255.255.0
③测试:
R2#ping vrf vd01 202.100.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.100.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 20/42/80 ms
R2#ping vrf vd02 202.100.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.100.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 36/53/80 ms
R2#
---R2能ping通R2的相连的子接口地址
D.SW2:
①创建VLAN
vlan database 
vlan 11
vlan 12
 exit
②接口划入VLAN
interface FastEthernet0/1
 switch mode access
 switchport access vlan 11
 no shut
interface FastEthernet0/2
 switch mode access
 switchport access vlan 12
 no shut
③trunk接口配置
interface FastEthernet0/0
 sw trunk encapsulation dot1q 
 switchport mode trunk
 no shut
④测试:
VPC3和VPC4配置相同ip地址能ping通路由器的子接口地址
 
三.VRF静态路由配置:
A.R1:
ip route vrf vd01 20.1.1.0 255.255.255.0 202.100.1.2
ip route vrf vd02 20.1.1.0 255.255.255.0 202.100.1.2
B.R2:
ip route vrf vd01 10.1.1.0 255.255.255.0 202.100.1.1
ip route vrf vd02 10.1.1.0 255.255.255.0 202.100.1.1
四.效果测试:
VPC1能ping通VPC3,VPC2能ping通VPC4




本文转自 碧云天 51CTO博客,原文链接:http://blog.51cto.com/333234/1107107,如需转载请自行联系原作者

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值