이 블로그의 실습 프로그램은 Packet tracer을 사용합니다.
실습 1
구성도
VLAN 정보 확인
Switch#sh vlan brief
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
Gig0/1, Gig0/2
VLAN 생성
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch#sh vlan brief
~
10 VLAN0010 active
20 VLAN0020 active
switchport 에서 VLAN 을 지정
Switch(config)#int f0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#int f0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
VLAN 정보 확인
Switch#sh vlan brief
VLAN Name Status Ports
—- ——————————– ——— ——————————
~
10 VLAN0010 active Fa0/1
20 VLAN0020 active Fa0/2
나머지 switchport 에서 VLAN 을 지정 그리고 정보 확인까지
Switch(config)#int f0/11
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#int f0/12
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch#sh vlan brief
VLAN Name Status Ports
—- ——————————– ——— ——————————-
~
10 VLAN0010 active Fa0/1, Fa0/11
20 VLAN0020 active Fa0/2, Fa0/12
실습 2
실습 1의 구성도를 활용해 Trunk mode를 해주기
구성도
새로 만든 switch도 vlan 설정 그리고 양쪽 스위치 연결
Switch(config)#int f0/22
Switch(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
SW_L(config)#int f0/22
SW_L(config-if)#switchport mode access
SW_L(config-if)#switchport access vlan ?
<1-4094> VLAN ID of the VLAN when this port is in access mode
SW_L(config-if)#switchport access vlan 10
SW_R(config)#int f0/22
SW_R(config-if)#switchport mode access
SW_R(config-if)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
SW_R(config-if)#int f0/1
SW_R(config-if)#switchport mode access
SW_R(config-if)#switchport access vlan 10
SW_L(config)#int f0/23
SW_L(config-if)#switchport mode access
SW_L(config-if)#switchport access vlan ?
<1-4094> VLAN ID of the VLAN when this port is in access mode
SW_L(config-if)#switchport access vlan 20
SW_R(config)#int f0/23
SW_R(config-if)#switchport mode access
SW_R(config-if)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20
SW_R(config-if)#int f0/2
SW_R(config-if)#switchport mode access
SW_R(config-if)#switchport access vlan 20
하지만 이렇게 양쪽 switch를 통신하려면 많은 연결이 필요하니
Trunk라는 것으로 한개만 연결하여 여러개의 Vlan frame을 보낼 수 있도록 설정하겠다.
trunk 설정
- 왼쪽 스위치
SW_L(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
SW_L(config-if)#switchport mode trunk
SW_L(config-if)#switchport trunk allowed ?
vlan Set allowed VLANs when interface is in trunking mode
SW_L(config-if)#switchport trunk allowed vlan ?
WORD VLAN IDs of the allowed VLANs when this port is in trunking mode
add add VLANs to the current list
all all VLANs
except all VLANs except the following
none no VLANs
remove remove VLANs from the current list
SW_L(config-if)#switchport trunk allowed vlan 10,20
- 오른쪽 스위치
SW_R(config)#int f0/24
SW_R(config-if)#switchport mode trunk
SW_R(config-if)#switchport trunk allowed vlan 10,20