2019/04/01
[CCNA Notes 8-2] VLAN Connectivity
Switch(config-if)#switchport ?
access Set access mode characteristics of the interface
mode Set trunking mode of the interface
native Set trunking native characteristics when interface is in trunking mode
nonegotiate Device will not engage in negotiation protocol on this interface
port-security Security related command
priority Set appliance 802.1p priority
trunk Set trunking characteristics of the interface
voice Voice appliance attributes
SwitchA#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, 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
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
Remote SPAN VLANs
------------------------------------------------------------------------------
Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
SwitchA(config)#vlan 10
SwitchA(config-vlan)#name HR //人力資源部
SwitchA(config-vlan)#vlan 20
SwitchA(config-vlan)#name Sales //業務部
SwitchA(config-vlan)#do sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, 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
10 HR active
20 Sales active
...
SwitchA(config)#int range fa0/1-3
SwitchA(config-if)#switchport mode ?
access Set trunking mode to ACCESS unconditionally
dynamic Set trunking mode to dynamically negotiate access or trunk mode
trunk Set trunking mode to TRUNK unconditionally
SwitchA(config-if-range)#switchport mode access
SwitchA(config-if-range)#switchport access vlan 10
SwitchA(config)#int range fa0/4-5
SwitchA(config-if-range)#switchport mode access
SwitchA(config-if-range)#switchport access vlan 20
SwitchA(config-if-range)#do sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active 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
10 HR active Fa0/1, Fa0/2, Fa0/3
20 Sales active Fa0/4, Fa0/5
...
SwitchA(config)#vlan 100
SwitchA(config-vlan)#name voice
SwitchA(config-vlan)#do sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active 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
10 HR active Fa0/1, Fa0/2, Fa0/3
20 Sales active Fa0/4, Fa0/5
100 voice active
...
SwitchA#show int fa0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 10 (HR)
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: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none
SwitchA(config-if)#int fa0/1-5
SwitchA(config-if)#switchport voice vlan 100
SwitchA#sh int fa0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 10 (HR)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: 100
...
SwitchA(config)#int fa0/20
SwitchA(config-if)#switchport mode trunk
SwitchA(config-if)#do sh int trunk
Port Mode Encapsulation Status Native vlan
Fa0/20 on 802.1q trunking 1 ..... (n-802.1q被協商)
Port Vlans allowed on trunk
Fa0/20 1-1005
Port Vlans allowed and active in management domain
Fa0/20 1
Port Vlans in spanning tree forwarding state and not pruned
Fa0/20 1
SwitchA(config-if)#do sh int fa0/20 switchport
Name: Fa0/20
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)
...
右邊的 SwitchB 設定也差不多。
vlan 10
name HR
vlan 20
name Sales
vlan 100
name voice
int range fa0/6-7
switchport mode access
switchport access vlan 10
int range fa0/11-13
switchport mode access
switchport access vlan 20
int range fa0/6-7, fa0/11-13
switchport voice vlan 100
int fa0/20
switchport mode trunk
此時,兩台 switch 間相同的 VLAN (PCA,B,C,0,1)可以溝通了,但不同的 vlan (10、20)還是無法溝通的,缺少Routing的設備。
Configuring Trunk Commands:
interface interface number
switchport mode trunk
switchport trunk native vlan number
switchport trunk allowed vlan add vlan_list
switchport trunk allowed vlan remove vlan_list
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言