[Experiment Name]
VLAN/802.1Q-communication between VLANs
[PURPOSE]
Communication between VLANs through Routers
[Experiment function]
Allows computer systems in the same VLAN to communicate with each other across routers, while computer systems in different VLANs can also communicate with each other.
[Lab device]
Routers (1), switches (1), and PCs (2) for direct connections (3)
[Experiment topology]
(Because a layer-3 switch has been configured to implement communication between different VLANs, a simple TP is used here! Configurations are the same. Here we mainly describe the configurations of the vro)
Lab procedure]
Vswitch
Switch> enable
Switch # configure terminal
Switch (config) # vlan 2
Switch (config-vlan) # exit
Switch (config) # vlan 3
Switch (config-vlan) # exit
Switch (config) # interface fastEthernet 0/2
Switch (config-if) # switchport access vlan 2
Switch (config-if) # exit
Switch (config) # interface fastEthernet 0/3
Switch (config-if) # switchport access vlan 3
Switch (config) # interface fastEthernet 0/24
Switch (config-if) # switchport mode trunk
(Here you will find that the second-layer switch configuration is just a few steps! Create a VLAN to divide the ports into VLANs and then set the TRUNK port)
Do you think the second layer is too pediatric! Oh, that's it! We need to despise the enemy in strategy and attach importance to the enemy in tactics #! Although it is simple, it cannot be careless!
Next, this section focuses on
Vro:
Router> enable
Router # configure terminal
Router (config) # interface fastEthernet 0/0 (physical interface connected to Layer 2 TRUNK port only needs to be enabled)
Router (config-if) # no shutdown
Router (config-if) # exit
Router (config) # interface fastEthernet 0/0. 2 (subinterface for accessing the physical interface :(. 2) It can be imagined that a physical interface can have billions of sub-interfaces and sub-interfaces can be set at will)
Router (config-subif) # encapsulation dot1Q 2 (When configuring the encapsulation protocol of the sub-interface, pay attention to the second after dot1Q! In this case, the VLAN number must correspond to the switch when the VLAN number is 2)
Router (config-subif) # ip address 192.168.2.254 255.255.255.0 (configure the ip address as the VLAN2 gateway)
Router (config-subif) # exit
Router (config) # interface fastEthernet 0/0. 3 (also for VLAN3)
Router (config-subif) # encapsulation dot1Q 3
Router (config-subif) # ip address 192.168.3.254 255.255.255.0
Configure IP 192.168.2.1 255.255.255.0 gateway 192.168.2.254 for the VLAN2 PC.
VLAN3 PC configuration IP 192.168.3.1 255.255.255.0 gateway 192.168.3.254
Found
PC> ping 192.168.3.1
Pinging 192.168.3.1 with 32 bytes of data:
Reply from 192.168.3.1: bytes = 32 time = 96 ms TTL = 127
Reply from 192.168.3.1: bytes = 32 time = 125 ms TTL = 127
Reply from 192.168.3.1: bytes = 32 time = 125 ms TTL = 127
Reply from 192.168.3.1: bytes = 32 time = 125 ms TTL = 127
Ping statistics for 192.168.3.1:
Packets: Sent = 4, stored ED = 4, Lost = 0 (0% loss ),
Approximate round trip times in milli-seconds:
Minimum = 96 ms, Maximum = 125 ms, Average = 117 ms
Different VLANs communicate through routers !!
This article is from "Everything is mouth-to-mouth !" Blog