一.测试拓扑: 二.基本配置: 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: http://www.luyouqiwang.com/15195/ .!!!! 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 。 |
不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流
GMT+8, 2024-5-7 02:01 , Processed in 0.797858 second(s), 15 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.