本文是笔者使用各种类型的交换机的笔记
常用手册
相关技术
VLAN
16 bits | 3 bits | 1 bit | 12 bits |
---|---|---|---|
TPID | TCI | ||
PCP | DEI | VID |
802.1Q tag format
来自 https://en.wikipedia.org/wiki/IEEE_802.1Q
用过的配置
配置vlan、access、trunk、关闭stp
华为
1
2
3
4
5
6
7
8
9
10
11
12
13
system-view
vlan 2
qui
interface Ethernet 0/0/2
port link-type access
port default vlan 2
interface ethernet 0/0/4
port link-type trunk
port trunk allow-pass vlan 2
qui
stp disable
qui
save
思科
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
enable
conf t
vlan 2
exi
interface fa0/1
sw mode access
sw access vlan 2
interface fa0/8
switchport trunk encapsulation dot1q
sw mode trunk
sw trunk allow vlan 2
end
conf t
no spanning-tree vlan 1-4094
end
copy run start
模拟集线器(思科)
使用思科的 SPAN 功能,从而可以模拟集线器,实现打流(否则会遗漏许多报文):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
interface FastEthernet0/4
switchport access vlan 3
switchport mode access
!
interface FastEthernet0/5
switchport access vlan 3
switchport mode access
!
interface FastEthernet0/6
switchport access vlan 3
switchport mode access
!
monitor session 1 source interface Fa0/6
monitor session 1 destination interface Fa0/5
monitor session 2 source interface Fa0/6
monitor session 2 destination interface Fa0/4
链接
下面总结了本文中使用的所有链接: