TRUNK
SW1基本配置(f0/1加入vla2,f0/2加入vla3,f0/24为中继链路接口)
Switch>en Switch#vlan database Switch(vlan)#vlan 2 Switch(vlan)#vlan 3 Switch(vlan)#exit Switch#conf t Switch(config)#int f0/1 Switch(config-if)#switchport access vlan 2 Switch(config-if)#exit Switch(config)#int f0/2 Switch(config-if)#switchport access vlan 3 Switch(config-if)#end SW2基本配置(f0/1加入vla2,f0/2加入vla3,f0/24为中继链路接口) Switch>en Switch#vlan database Switch(vlan)#vlan 2 Switch(vlan)#vlan 3 Switch(vlan)#exit Switch#conf t Switch(config)#int f0/1 Switch(config-if)#switchport access vlan 2 Switch(config-if)#exit Switch(config)#int f0/2 Switch(config-if)#switchport access vlan 3 Switch(config-if)#endSwitch#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 2 VLAN0002 active Fa0/1 3 VLAN0003 active Fa0/2创建trunk模式的中继链路
Switch#conf t Switch(config)#int f0/24 Switch(config-if)#switchport mode trunk Switch#show runinterface FastEthernet0/1
switchport access vlan 2 ! interface FastEthernet0/2 switchport access vlan 3 ! interface FastEthernet0/24 switchport mode trunk