4.
Advanced configuration commands
4.1
VLAN config
VLAN configuration commands include:
switchport mode
switchport pvid
switchport trunk|hybrid| access
show vlan
Function Brief
Ethernet is a shared communication media based on the Carrier
Sense Multiple Access/Collision Detect (CSMA/CD) technology. A LAN built
using the Ethernet technology is not only a collision domain, but also a
broadcast domain. When the number of hosts on the network is large, the
collision becomes serious, broadcast flooding occurs, and the performance
is significantly degraded. Even worse, the network is unavailable.
Deployment of bridges or L2 switches on the Ethernet can resolve the
problem of serous collision, but still cannot isolate broadcast packets. To
address this issue, the Virtual Local Area Network (VLAN) technology
emerges. This technology can divide a physical LAN into multiple logical
LANs, that is, VLANs. Hosts located in the same VLAN can directly
communicate with each other, but hosts located in different VLANs cannot
communicate with each other. In this way, broadcast packets are confined in
the same VLAN. That is, each VLAN is a broadcast domain.
Advantages of VLAN are as follows:
1) Improve network performance. Broadcast packets are confined in the
VLAN, which effectively controls broadcast storms of the network, saves the
network bandwidth, and improves the network processing capability.
2) Enhance network security. Devices in different VLANs cannot access
each other, and hosts in different VLANs cannot directly communicate with
each other. Packets must be forwarded at L3 through network layer devices,
such as routers or L3 switches.
3) Simplify network management. Hosts in the same virtual work group are
not limited to a certain physical range, which simplifies network management,
and makes it convenient for people in different areas to set up work groups.