VLAN
VLAN 생성
switch#conf t <- configure terminal 약자 switch(config)#vlan 2 <- vlan 2번을 생성 switch(config-vlan)#name VLAN_NUM2 <- 이름은 'VLAN_NUM2' 라고 함 switch(config-vlan)#exit <- 설정 저장하고 나가기 switch(config)#exit <- 설정 저장하고 나가기 switch#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Gi0/1, Gi0/2, Gi0/17, Gi0/26 2 VLAN_NUM2 active
VLAN 2번에 VLAN_NUM2 라는 이름으로 새로운 vlan이 생성된것을 확인 할 수 있습니다.
vlan에 인터페이스 추가
switch#conf t switch(config)#interface gigabitEthernet 0/2 <- vlan에 포함 시킬 포트 switch(config-if)#switchport access vlan 2 <- vlan2에 등록 함 switch(config-if)#exit switch(config)#exit switch#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Gi0/1, Gi0/17, Gi0/26 2 VLAN_NUM2 active Gi0/2
VLAN2에 Gi0/2가 포함되어 있는게 보이시죠?
vlan에 IP 주소 설정
switch#conf t
switch(config)#interface vlan 2
switch(config-if)#ip address 10.10.10.2 255.255.255.0 <- vlan2에 ip를 설정 함
switch(config-if)#no shutdown <- shutdown 앞에 'no'가 붙었으므로, 인터페이스를 살리라는 뜻.
switch(config-if)#exit
switch(config)#exit
switch#show interfaces vlan 2 <- vlan2의 정보 조회
Vlan2 is up, line protocol is down
Hardware is EtherSVI, address is 1c17.d3e5.c14e (bia 1c17.d3e5.c14e)
Internet address is 10.10.10.2/24
MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
.. 이하 생략 ..
IP주소가 정상적으로 설정 된것을 볼 수 있습니다.
vlan에 설정한 IP 주소 삭제
switch#conf t
switch(config)#interface vlan 2
switch(config-if)#no ip address <- vlan2의 ip를 삭제 함
switch(config-if)#exit
switch(config)#exit
switch#show interfaces vlan 2 <- vlan2의 정보 조회
Vlan2 is up, line protocol is down
Hardware is EtherSVI, address is 1c17.d3e5.c14e (bia 1c17.d3e5.c14e)
MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
.. 이하 생략 ..
IP주소가 정상적으로 제거 된것을 볼 수 있습니다.
vlan 삭제
switch#conf t switch(config)#no interfaces vlan 2 <- vlan2 를 삭제함 (cisco 스위치는 앞에 'no'를 붙이면 제거/삭제 의 의미를 가짐) switch(config)#exit switch#show interfaces status Port Name Status Vlan Duplex Speed Type Gi0/1 notconnect 1 auto auto 10/100/1000BaseTX Gi0/2 notconnect 2 auto auto 10/100/1000BaseTX
이상하게도.. vlan2를 지웠는데
2번 포트는 여전히 Vlan 2에 포함되어있다고 나옵니다.
default vlan으로 돌아가게 하고 싶다면 아래 명령(인터페이스 제거)을 수행해야 합니다.
vlan에 등록했던 인터페이스 제거
switch#conf t switch(config)#interface gigabitEthernet 0/2 <- vlan에서 제거할 포트 switch(config-if)#no switchport access vlan 2 <- vlan2 에서 제거 switch(config-if)#exit switch(config)#exit switch#show inter status Port Name Status Vlan Duplex Speed Type Gi0/1 notconnect 1 auto auto 10/100/1000BaseTX Gi0/2 notconnect 1 auto auto 10/100/1000BaseTX