시스코 스위치에서 VLAN 구성 마스터링: 종합 가이드
현대 기업 네트워크 아키텍처에서 가상 로컬 영역 네트워크(VLAN)는 단순한 편의를 넘어 보안, 성능 및 조직적 논리의 근간이 됩니다. 단일 물리 스위치를 여러 논리 네트워크로 분할함으로써, 엔지니어는 브로드캐스트 도메인을 격리하고 민감한 데이터를 보호하며 트래픽 관리를 간소화할 수 있습니다. 이 가이드는 시스코 IOS 기반 스위치에서 VLAN을 구성, 확인 및 관리하는 엄격한 단계별 절차를 제공하며, 정밀성과 모범 사례 준수를 추구하는 네트워크 전문가를 위해 맞춤화되었습니다.
1. VLAN 패러다임 이해
명령을 실행하기 전에 메커니즘을 이해하는 것이 중요합니다. VLAN은 이더넷 프레임에 802.1Q 식별자(ID)를 태그하여 스위치가 트래픽 스트림을 구별할 수 있게 합니다. 스위치의 포트는 일반적으로 두 가지 모드 중 하나에 할당됩니다:
- 액세스 포트: 최종 장치(PC, 프린터)에 연결되며 단일 VLAN의 트래픽을 전송합니다. 프레임은 장치로 향하는 포트에서 태그가 제거됩니다.
- 트렁크 포트: 다른 스위치 또는 라우터에 스위치를 연결합니다. 여러 VLAN의 트래픽을 전송하며 프레임 소유권을 식별하기 위해 802.1Q 태그를 유지합니다.
2. VLAN 생성 및 명명
분할의 첫 단계는 스위치 데이터베이스에 VLAN을 정의하는 것입니다. VLAN ID는 1에서 4094까지 범위를 가질 수 있지만, 표준 범위(1-1005)가 가장 일반적으로 사용됩니다.
Switch# configure terminal Switch(config)# vlan 10 Switch(config-vlan)# name DATA_NETWORK Switch(config-vlan)# exit Switch(config)# vlan 20 Switch(config-vlan)# name VOICE_NETWORK Switch(config-vlan)# exit Switch(config)# vlan 99 Switch(config-vlan)# name MANAGEMENT Switch(config-vlan)# end
모범 사례: VLAN에 항상 이름을 지정하십시오. 복잡한 환경에서 “VLAN 20”을 보는 것보다 “VOICE_NETWORK”를 보는 것이 문제 해결 시 훨씬 더 유용합니다.
3. VLAN에 포트 할당 (액세스 모드)
VLAN이 생성되면 물리 인터페이스를 해당 VLAN에 할당해야 합니다. 이 구성은 특정 포트로 들어오는 모든 트래픽이 특정 VLAN에 속함을 스위치에 알려줍니다.
단일 인터페이스 구성:
Switch(config)# interface GigabitEthernet0/1 Switch(config-if)# description Connection to HR_PC_01 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10 Switch(config-if)# no shutdown
여러 인터페이스 범위 구성:
Switch(config)# interface range GigabitEthernet0/2 - 10 Switch(config-if-range)# description HR_Department_PCs Switch(config-if-range)# switchport mode access Switch(config-if-range)# switchport access vlan 10
4. 트렁크 링크 구성 (인터-스위치 연결성)
스위치 간 트래픽을 전달하려면 트렁크 링크를 구성해야 합니다. 이 링크는 태그가 지정된 프레임을 전송합니다. 보안 목적으로 기본 VLAN 1이 아닌 다른 것을 네이티브 VLAN(태그가 유지되는 트래픽)으로 설정하는 것이 중요합니다.
Switch(config)# interface GigabitEthernet0/24
Switch(config-if)# description Uplink_to_Core_Switch
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk native vlan 99
Switch(config-if)# switchport trunk allowed vlan 10,20,99
Note: The command `switchport trunk encapsulation dot1q` may not be required on newer switches that only support 802.1Q, but it is mandatory on older models that also supported ISL.
5. Configuring Voice VLANs
In environments with IP phones, a single port often supports both a PC and a phone. Cisco switches use a specialized feature called “Voice VLAN” to handle this via a mini-trunk.
Switch(config)# interface GigabitEthernet0/5
Switch(config-if)# description PC_and_Phone
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# switchport voice vlan 20
Switch(config-if)# trust device cisco-phone
This configuration places data traffic in VLAN 10 (untagged) and voice traffic in VLAN 20 (tagged), ensuring Quality of Service (QoS) separation.
6. Verification and Troubleshooting
Configuration is only half the job; verification ensures stability. Use the following commands to validate your setup.
Verify VLAN Database
Ensure your VLANs are active and named correctly.
Switch# show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi0/11, Gi0/12...
10 DATA_NETWORK active Gi0/1, Gi0/2...
20 VOICE_NETWORK active Gi0/5
99 MANAGEMENT active
Verify Interface Assignments
Check the administrative and operational mode of specific ports.
Switch# show interfaces switchport
Name: Gi0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Access Mode VLAN: 10 (DATA_NETWORK)
Trunking Native Mode VLAN: 1 (default)
...
Verify Trunk Links
Confirm which ports are trunking and which VLANs are allowed across them.
Switch# show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi0/24 on 802.1q trunking 99
Port Vlans allowed on trunk
Gi0/24 10,20,99
7. Security Best Practices: VLAN Hopping Mitigation
Default configurations are often insecure. Attackers can exploit Dynamic Trunking Protocol (DTP) to hop between VLANs. Secure your ports with these standard hardening steps:
- Disable DTP on Access Ports: By hard-coding `switchport mode access`, you prevent the port from negotiating a trunk link.
- Shutdown Unused Ports: Any port not in use should be administratively down and assigned to a “black hole” VLAN (a VLAN with no Layer 3 access).
- Disable DTP Globally (Optional but Recommended): Use `switchport nonegotiate` on trunk links to stop DTP frames.
Switch(config)# interface GigabitEthernet0/24
Switch(config-if)# switchport nonegotiate
결론
Effective VLAN management is the bedrock of a stable network infrastructure. By strictly adhering to naming conventions, properly configuring trunk and access modes, and implementing security controls against VLAN hopping, network engineers ensure a scalable and secure environment. Regular auditing using verification commands is essential to maintaining configuration integrity over time.
왓츠앱+8613603031172