show vlan brief
show vlan id <VLAN_ID>
show vlan name <VLAN_NAME>
show interfaces status
show interfaces switchport
show interfaces trunk
show interfaces <IF> switchport
show mac address-table vlan <VLAN_ID>
show running-config | section vlan
show running-config interface <IF>
show running-config | include vlan
conf t
vlan 10
name USERS
vlan 20
name SERVERS
end
wr mem
conf t
no vlan 20
end
wr mem
참고: VLAN을 삭제해도 포트가 그 VLAN에 묶여있으면, 포트는 “없는 VLAN”을 참조하는 형태가 될 수 있어 운영상 혼란이 생깁니다. 삭제 전 포트 할당을 먼저 정리하는 습관 권장.
conf t
interface gigabitEthernet 1/0/5
description PC-05
switchport mode access
switchport access vlan 10
spanning-tree portfast
spanning-tree bpduguard enable
end
wr mem
conf t
interface range gi1/0/1-24
switchport mode access
switchport access vlan 10
spanning-tree portfast
spanning-tree bpduguard enable
end
wr mem
portfast는 PC/프린터 등 단말 포트에만bpduguard는 단말 포트에서 BPDU 들어오면 차단(루프/오배선 방지)conf t
interface gi1/0/48
description Uplink-to-Core
switchport mode trunk
end
wr mem
conf t
interface gi1/0/48
switchport mode trunk
switchport trunk allowed vlan 10,20,30
end
wr mem
conf t
interface gi1/0/48
switchport trunk allowed vlan add 40
switchport trunk allowed vlan remove 30
end
wr mem
conf t
interface gi1/0/48
switchport trunk native vlan 999
end
wr mem
권장: 트렁크는 “필요 VLAN만 허용” + Native VLAN은 미사용 VLAN(예: 999) 로 두고, 양단 동일하게 맞추기.
(전화기 포트: voice VLAN / PC: data VLAN)
conf t
interface gi1/0/10
description IPPhone+PC
switchport mode access
switchport access vlan 10
switchport voice vlan 110
spanning-tree portfast
spanning-tree bpduguard enable
end
wr mem
확인:
show interfaces gi1/0/10 switchport
L2 스위치에서 “관리용 IP”는 보통 VLAN 인터페이스(SVI)에 설정합니다.
conf t
interface vlan 10
description MGMT
ip address 192.168.10.2 255.255.255.0
no shutdown
exit
ip default-gateway 192.168.10.1
end
wr mem
확인:
show ip interface brief
show running-config interface vlan 10
L2 스위치는 라우팅을 안 하므로
ip default-gateway가 중요합니다(원격 관리용).
show interfaces trunk
show interfaces <IF> switchport
show interfaces trunk | include allowed
show interfaces <IF> switchport | include Native
show vlan brief
show interfaces status
show mac address-table interface <IF>
show mac address-table vlan <VLAN_ID>
interface <IF>
description <DESC>
switchport mode access
switchport access vlan <VID>
spanning-tree portfast
spanning-tree bpduguard enable
interface <IF>
description <UPLINK>
switchport mode trunk
switchport trunk allowed vlan <LIST>
switchport trunk native vlan 999