A-A+

路由器VRF多个虚拟路由器测试的拓扑和基本配置方法

2015年11月21日 站长资讯 暂无评论

一.测试拓扑:

二.基本配置:

A.SW1:

①创建VLAN

  1. vlan database   
  2.   
  3. vlan 11   
  4.   
  5. vlan 12  
  6.   
  7.  exit   

②接口划入VLAN

  1. interface FastEthernet0/1   
  2.  switch mode access  
  3.  switchport access vlan 11   
  4.  no shut  
  5. interface FastEthernet0/2   
  6.  switch mode access  
  7.  switchport access vlan 12   
  8.  no shut  

③trunk接口配置

  1. interface FastEthernet0/0  
  2.  sw trunk encapsulation dot1q    
  3.  switchport mode trunk  
  4.  no shut   

B.R1:

①创建VRF

  1. ip vrf vd01  
  2.  rd 1:1   
  3. ip vrf vd02  
  4.  rd 2:2   

②划分子接口,并将子接口划分到vrf中

  1. ---处于不同vrf的子接口IP可以相同   
  2. interface FastEthernet0/0  
  3.  no shut   
  4. interface FastEthernet0/0.11  
  5.  encapsulation dot1Q 11   
  6.  ip vrf forwarding vd01  
  7.  ip address 10.1.1.1 255.255.255.0   
  8. interface FastEthernet0/0.12  
  9.  encapsulation dot1Q 12   
  10.  ip vrf forwarding vd02  
  11.  ip address 10.1.1.1 255.255.255.0   
  12. interface FastEthernet1/0  
  13.  no shut   
  14. interface FastEthernet1/0.21  
  15.  encapsulation dot1Q 21   
  16.  ip vrf forwarding vd01  
  17.  ip address 202.100.1.1 255.255.255.0   
  18. interface FastEthernet1/0.22  
  19.  encapsulation dot1Q 22   
  20.  ip vrf forwarding vd02  
  21.  ip address 202.100.1.1 255.255.255.0   

③测试:

1.路由器能ping通VRF的接口地址

  1. R1#ping vrf vd01 10.1.1.1  
  2.   
  3. Type escape sequence to abort.  
  4. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:   
  5. !!!!!  
  6. Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms   
  7. R1#  
  8. R1#ping vrf vd02 10.1.1.1   
  9.   
  10. Type escape sequence to abort.   
  11. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:  
  12. !!!!!   
  13. Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms  
  14. R1#   
  15. R1#ping vrf vd01 202.100.1.1  
  16.   
  17. Type escape sequence to abort.  
  18. Sending 5, 100-byte ICMP Echos to 202.100.1.1, timeout is 2 seconds:   
  19. !!!!!  
  20. Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms   
  21. R1#ping vrf vd02 202.100.1.1  
  22.   
  23. Type escape sequence to abort.  
  24. Sending 5, 100-byte ICMP Echos to 202.100.1.1, timeout is 2 seconds:   
  25. !!!!!  
  26. Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms   
  27. 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:
http://www.xiaoxiongboke.com .!!!!
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 。

标签:

给我留言