Realize data communication between different VLANs with single-arm routing and three-layer switch

@ Cenjeal by two ways data communication between vlan

1. Use two-layer switch + router (one-arm routing)

Insert picture description here
1.1 PC1 configuration
Manually configure pc1's IP address: 192.168.2.10
Subnet mask: 255.255.255.0
Gateway: 192.168.2.1
1.2 PC2 configuration
Manually configure pc2's IP address: 192.168.3.10
Subnet mask: 255.255.255.0
Gateway: 192.168 .3.1

2. Switch configuration
Insert picture description here
1. Enter the commands vlan 2 and vlan 3 to divide vlan2 and vlan3
2. Enter interface e0/0/1, because it is connected to PC1, set the interface mode to access, and the default vlan is vlan2
3. Enter interface e0/0 /2, because it is connected to PC2, the interface mode is set to access, and the default vlan is vlan3
. 4. Enter interface g0/0/1. Because it is connected to the router, set the interface mode to trunk. By default, all vlans are allowed to pass (port trunk allow -pass vlan all)

3. Router configuration
Insert picture description here
1. Enter the command int g0/0/0 to enter the interface 0
enter the command undo shutdown to enable the interface

2. Enter the command int g0/0/0.1 to enter the sub-interface 0.1,
enter the command vlan-type dot1q 2 default, use vlan 2 as the default vlan under this sub-interface,
enter the command ip add 192.168.2.1 255.255.255.0 to configure the address under the vlan

3. Enter the command int g0/0/0.2 to enter the sub-interface 0.2,
enter the command vlan-type dot1q 3 default, use vlan 3 as the default vlan under this sub-interface,
enter the command ip add 192.168.3.1 255.255.255.0 to configure the address under the vlan

4. PC1 ping PC2 IP address, the test found that it can be pinged
Insert picture description here

2. Use a three-tier switch

Insert picture description here
Switch configuration

1. Enter the command vlan 2 and vlan 3 to divide vlan2 and vlan3

2.1
Insert picture description here
Enter the command int g0/0/1 to enter interface 1 and
enter the command port link-type access to set the interface mode to access and
enter the command port default vlan 2 to set the default vlan to vlan2

2.2Insert picture description here
Enter the command int g0/0/2 to enter the interface 2
enter the command port link-type access to set the interface mode to access
enter the command port default vlan 3 to set the default vlan to vlan3

3.1Insert picture description here
Enter the command int vlanif 2 to enter vlan 2 and
enter the command ip add 192.168.2.1 24 to configure the address

3.2Insert picture description here
Enter the command int vlanif 3 to enter vlan 3 and
enter the command ip add 192.168.3.1 24 to configure the address

4. PC3 ping PC4, the test found that it can be pinged

Insert picture description here

Guess you like

Origin blog.csdn.net/cenjeal/article/details/106671508