Case: Used in a switch to configure a LAN for an interface
Detailed explanation: one switch, two PCs, configure LAN for the two interfaces of the switch respectively
Note: The interface mode of the switch
● access, used to connect terminals, computers, printers
● trunk, used to connect other switches
icon |
---|
- Steps:
a. Build: one switch, two PCs
b. Set ip and subnet mask: configure IP addresses (1.1.1.1 and 1.1.1.2) and subnet masks (255.255.255.0) for PC1 and PC2 respectively c
. Enter the switch—set two VLANs (vlan 10 and vlan 20) for the two interfaces of the switch (g0/0/1 and g0/0/2) ⅰ. Set vlan for the two interfaces of the
switch- int g0/0/1 - enter the g0/0/1 interface
- vlan 10 - set vlan 10 for the switch g0/0/1 interface
- q - exit the g0/0/1 interface
- int g0/0/2 - enter the g0/0/2 interface
- vlan 20 - set vlan 20 for the switch g0/0/2 interface
- Check whether the creation is successful: display vlan
Ⅱ. Set the type of switch interface (here set g0/0/1 and g0/0/2) - port link-type access - set the g0/0/1 interface to access
- port link-type access——Set the g0/0/2 interface as access
Ⅲ. Set the two VLAN interfaces as the default interface (here set vlan 10 and vlan 20) - port default vlan 10
- port default vlan 20
d. Result: Enter display vlan to view
test |
---|