广播风暴
单交换配置VLAN
跨交换配置VLAN
通信过程中,会产生大量广播帧
广播域 - 广播可以抵达的地方;这个区域越小越好
Broadcast Storm is a network condition in which so many broadcasts are occurring (for example, for apress verification purposes) that normal communication is disrupted.
continually sending out broadcast messages
the wire is continually busy
no other station is able to transmit information
根据 IEEE 802.1Q 标准,VLAN ID 是 12 位,因此理论上最多支持 2^12 = 4096 个 VLAN - 4K
其中 VLAN 0 和 VLAN 4095 被保留;VLAN 1 为默认 VLAN,所以实际可用的 VLAN ID 范围是 1-4094
一个端口只能属于一个VLAN;所以一般称 port VLAN
默认模式
一般用于链接用户计算机
access端口只能属于一个VLAN
用于交换机之间或交换机和路由器之间的链接
trunk端口可以属于多个VLAN
混合模式
华为专有模式
二层交换机无法实现不同VLAN之间的通信
跨VLAN通信,需要三层设备
| Preamble | SFD | Destination MAC | Source MAC | Type | Data | FCS |
| 7 | 1 | 6 | 6 | 2 | 46-1500 | 4 |
| Preamble | SFD | Destination MAC | Source MAC | VLAN | Type | Data | FCS |
| 7 | 1 | 6 | 6 | 4 | 2 | 46-1500 | 4 |
| TPID | TCI | ||
| 2byte | 1bit | 3bit | 12bit |
固定为0x8100
Priority:VLAN优先级;3bit
CFI:格式;1bit
VLAN ID:VLAN号;12bit
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 20
Switch(config-if)#switchport trunk allowed vlan 20, 30
Switch(config-if)#switchport trunk allowed vlan 20-30
Switch#show interfaces trunk
Switch#show interfaces fa0/4 switchport
创建vlan10
添加相应的端口 fa0/1 - 可以简写为f0/1
指定访问模式
Switch>en Switch#conf ter Switch(config)#vlan 10 Switch(config-vlan)#inter f0/1 Switch(config-if)#switchport access vlan 10 Switch(config-if)#inter f0/2 Switch(config-if)#switchport access vlan 10 Switch(config-if)#end
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24, Gig0/1, Gig0/2
10 VLAN0010 active Fa0/1, Fa0/2
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
192.168.1.1 → 192.168.1.3:失败
C:\>ping 192.168.1.3
Pinging 192.168.1.3 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.1.3:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\>
192.168.1.1 → 192.168.1.5:失败
C:\>ping 192.168.1.5
Pinging 192.168.1.5 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.1.5:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\>
模拟通信模式下,某个PC发送广播,查看各PC的通信情况
Switch#conf ter Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#inter fa0/4 Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 20 Switch(config-if)#end
Switch#show interfaces trunk Port Mode Encapsulation Status Native vlan Fa0/4 on 802.1q trunking 1 Port Vlans allowed on trunk Fa0/4 20 Port Vlans allowed and active in management domain Fa0/4 20 Port Vlans in spanning tree forwarding state and not pruned Fa0/4 20 Switch#
Switch#show interfaces tru Switch#show interfaces trunk Port Mode Encapsulation Status Native vlan Fa0/4 auto n-802.1q trunking 1 Port Vlans allowed on trunk Fa0/4 1-1005 Port Vlans allowed and active in management domain Fa0/4 1,20,30 Port Vlans in spanning tree forwarding state and not pruned Fa0/4 1,20,30
Switch#show interfaces tru Switch#show interfaces trunk Port Mode Encapsulation Status Native vlan Fa0/4 on 802.1q trunking 1 Port Vlans allowed on trunk Fa0/4 20 Port Vlans allowed and active in management domain Fa0/4 20 Port Vlans in spanning tree forwarding state and not pruned Fa0/4 20
Switch#show interfaces fa0/4 switchport Name: Fa0/4 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: 20 Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none
单交换机
跨交换机
Virtual LAN, or VLAN, is a networking technology that allows networks to be segmented logically without having to be physically rewired.
Each station can be assigned a VLAN identification number (ID), and stations with the same VLAN ID (no matter what physical switch they are connected to) can act and function as though they are all on the same physical network segment. Broadcasts sent by one host are received only by hosts with the same VLAN ID.
自己指定VLAN号和对应的端口
测试不同VLAN之间的通信
测试广播域的通信