1. Introduction experiment
Hosts A and content B of different configuration vlan hope that they can communicate, and vlanif on the switch that is not connected to the PC.
Equipment planning
Types of | name | Quantity |
terminal | PC | 2 |
switch | S5700 | 2 |
vlan division
vlanid |
Subnet | Gateway |
2 | 192.168.1.0/24 | 192.168.1.1 (switch 2) |
3 | 192.168.2.0/24 | 192.168.2.1 (switch 2) |
Host ip planning
Host computer | ip | Switch Interface |
A | 192.168.1.2 | 0/0/1 switch |
B | 192.168.2.2 | 0/0/2 switch |
FIG 2. Connection as follows:
3. Switch configuration is as follows:
LSW1
sys
vlan batch 2 to 3
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 3
stp disable
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
LSW2
sys
vlan batch 2 to 3
interface Vlanif2
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif3
ip address 192.168.2.1 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
PC configuration is as follows
4. Test Connectivity
5. Summary
Two hosts are in different vlan, and not in the same subnet, but they can communicate, here I use the two switches, two switches are configured serial port and they are put through a vlan 2 and 3. switch 2 I configured ip address vlanif2 vlanif3, and then again even if I did not switch ip address configuration vlanif 1 can also make the two hosts communicate, is not it amazing that way.