

enableconfigure terminalhostname 이름원격에서 사용하기 위해서는 vlan1 에 IP를 할당해야 한다.
configure terminal
interface vlan 1
ip address 10.5.5.1 255.255.255.0
no shutdown
스위치에서 외부 네트워크와 통신하기 위해서는 default-gateway 가 설정되어야 한다.

ip default-gateway 172.30.137.1speed {10 | 100 | 1000 | auto}interface fa1/0
speed 100duplex {auto | full | half}duplex full스위치의 모든 포트는 라우터와 다르게 기본적으로 활성화되어 있다.
확인
show ip interface brief

사용하지 않는 포트를 아무런 설정 없이 그대로 방치하면 보안에 심각한 위협이 될 수 있다.
사용하지 않는 포트는 shutdown 시키는 것이 좋다.
한꺼번에 설정하는 명령
interface range 인터페이스 - 인터페이스번호
interface range fa 1/1 - 15
shutdown

특정 인터페이스 정보 확인
show interfaces 인터페이스이름
show interfaces FastEthernet 0/1
interface fa1/5
switchport mode access
switchport port-security
switchport port-security mac-address 실제MAC주소MAC 주소를 모르는 경우는 sticky 를 설정하면 처음 연결된 장비의 MAC 주소를 설정합니다.
switchport port-security mac-address sticky
장비를 여러 개 설정
switchport port-security maximum 최대연결개수
설정한 장비 이외의 장비가 접속하는 경우 대응
switchport port-security violation {shutdown | protect | restrict}
protect : 트래픽 폐기만 수행
restrict : 트래픽을 폐기하고, 경고 메세지 전송
shutdown : 트래픽을 폐기, 메세지 전송, 인터페이스 비활성화
보안 설정 때문에 shutdown이 되는 경우는 secure-shutdown 상태인데 이 상태에서 바로 shutdown 이 안되므로, shutdown을 하고 no shutdown을 수행
switch mode trunk
switchport trunk encapsulation dot1qswitch mode accessVLAN 생성 및 할당
생성
vlan 아이디
name 이름
인터페이스 할당, 인터페이스 설정에 들어가서
switch port access vlan 아이디
기본 VLAN은 1
vlan 2
name v2
exit
vlan 3
name v3
exit
vlan 99
name v99
exit
인터페이스를 포트에 할당
interface range FastEthernet 1/1 - 3
switchport access vlan 2
exit
interface range FastEthernet 1/4 - 6
switchport access vlan 3
exit
인터페이스의 VLAN 확인
show interface 인터페이스 switchport
show interface FastEthernet1/1 switchport

FastEthernet1/11 인터페이스를 Trunk 모드로 설정
configure terminal
interface FastEthernet1/11
switchport mode trunk
switchport trunk encapsulation dot1q
FastEthernet1/11 인터페이스의 VLAN 확인
show interface FastEthernet1/11 switchport

show interface FastEthernet1/11 trunk

Native VLAN 변경
switch trunk native vlan 번호