Skip to main content


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

2013-01-03 23:50 浏览:

一.测试拓扑:

  

参考链接:
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
ncapsulation 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

本文出自 “httpyuntianjxxll.spac..” 博客