한빛미디어㈜ - 1 - it cookbook ehanbit.net intro 640-821 icnd 640-811 ccna 640-801 √...

35
한한한한한한 - 1 - IT COOKBOOK ehanbit.net INTRO 640-821 ICND 640-811 CCNA 640-801 원원원 원원 IT 원 원원원 네네네네 네네네 네네 ehanbit.net

Upload: emory-robertson

Post on 12-Jan-2016

257 views

Category:

Documents


2 download

TRANSCRIPT

한빛미디어㈜ - 1 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

INTRO 640-821 ICND 640-811 CCNA 640-801

√ 원리를 알면 IT 가 맛있다네트워크 개론과 실습

ehanbit.net

한빛미디어㈜ - 2 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

chapter 12.

시스코 스위치의 설정과 VLAN

한빛미디어㈜ - 3 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

학습목표

• 시스코 스위치의 기본 설정

• VLAN 의 개념과 시스코 스위치의 VLAN 설정

• VLAN 간의 라우팅

한빛미디어㈜ - 4 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치의 부팅 (1)– 라우터와 똑같은 절차로 부팅됨C2950 Boot Loader (CALHOUN-HBOOT-M) Version 12.0(5.3)WC(1), MAINTENANCE INTERIM SOFTWARECompiled Mon 30-Apr-01 07:56 by devgoyalWS-C2950-24 starting...Base ethernet MAC Address: 00:08:a3:5e:12:c0Xmodem file system is available.Initializing Flash...flashfs[0]: 163 files, 3 directoriesflashfs[0]: 0 orphaned files, 0 orphaned directoriesflashfs[0]: Total bytes: 7741440flashfs[0]: Bytes used: 2963968flashfs[0]: Bytes available: 4777472flashfs[0]: flashfs fsck took 6 seconds....done initializing flash.Boot Sector Filesystem (bs:) installed, fsid: 3Parameter Block Filesystem (pb:) installed, fsid: 4Loading "flash:c2950-c3h2s-mz.120-5.3.WC.1.bin"...###############################################################################

한빛미디어㈜ - 5 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치의 부팅 (2)File "flash:c2950-c3h2s-mz.120-5.3.WC.1.bin" uncompressed and installed, entry point: 0x80010000 executing...

Restricted Rights LegendUse, duplication, or disclosure by the Government issubject to restrictions as set forth in subparagraph(c) of the Commercial Computer Software - RestrictedRights clause at FAR sec. 52.227-19 and subparagraph(c) (1) (ii) of the Rights in Technical Data and ComputerSoftware clause at DFARS sec. 252.227-7013. cisco Systems, Inc. 170 West Tasman Drive San Jose, California 95134-1706Cisco Internetwork Operating System Software IOS (tm) C2950 Software (C2950-C3H2S-M), Version 12.0(5.3)WC(1), MAINTENANCE INTERIM SOFTWARECopyright (c) 1986-2001 by cisco Systems, Inc.Compiled Mon 30-Apr-01 07:56 by devgoyalImage text-base: 0x80010000, data-base: 0x8031A000

한빛미디어㈜ - 6 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치의 부팅 (3)Initializing flashfs...flashfs[1]: 163 files, 3 directoriesflashfs[1]: 0 orphaned files, 0 orphaned directoriesflashfs[1]: Total bytes: 7741440flashfs[1]: Bytes used: 2963968flashfs[1]: Bytes available: 4777472flashfs[1]: flashfs fsck took 6 seconds.flashfs[1]: Initialization complete.Done initializing flashfs.C2950 POST: System Board Test : PassedC2950 POST: Ethernet Controller Test : PassedC2950 POST: MII TEST : Passedcisco WS-C2950-12 (RC32300) processor (revision B0) with 22260K bytes of memory.Processor board ID FOC0601X0GZLast reset from system-resetProcessor is running Enterprise Edition SoftwareCluster command switch capableCluster member switch capable12 FastEthernet/IEEE 802.3 interface(s)

한빛미디어㈜ - 7 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치의 부팅 (4)32K bytes of flash-simulated non-volatile configuration memory.Base ethernet MAC Address: 00:08:A3:5E:12:C0Motherboard assembly number: 73-5782-08Power supply part number: 34-0965-01Motherboard serial number: FOC06010211Power supply serial number: DAB05513BX3Model revision number: B0Motherboard revision number: B0Model number: WS-C2950-12System serial number: FOC0601X0GZ

Press RETURN to get started!C2950 INIT: Complete00:00:16: %SYS-5-CONFIG: Configured from NVRAM by console00:00:16: %SYS-5-RESTART: System restarted --Cisco Internetwork Operating System Software IOS (tm) C2950 Software (C2950-C3H2S-M), Version 12.0(5.3)WC(1), MAINTENANCE INTERIM SOFTWARECopyright (c) 1986-2001 by cisco Systems, Inc.Compiled Mon 30-Apr-01 07:56 by devgoyalswitch>

한빛미디어㈜ - 8 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치의 기본 설정 (1)

– IP 주소의 설정

– duplex 모드의 설정

switch#conf tEnter configuration commands, one per line. End with CNTL/Z.switch(config)#interface vlan 1switch(config-if)#ip address 192.168.0.100 255.255.255.0switch(config-if)#^Z

switch(config-if)# duplex {full | half | auto}

한빛미디어㈜ - 9 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

• 시스코 스위치의 기본 설정 (2)

– 스패닝 트리 프로토콜 우선순위의 설정

– 스패닝 트리 프로토콜 Cost 의 설정

Switch(config)# spanning-tree cost [cost 값 ] Switch(config)# spanning-tree vlan [vlan_ID] cost [cost 값 ]

Switch(config)# spanning-tree priority [priority 값 ]Switch(config)# spanning-tree vlan [vlan_ID] priority [priority 값 ]

한빛미디어㈜ - 10 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치의 기본설정 예 (1)switch>enableswitch#switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z.

switch(config)#hostname switchUPswitchUP(config)#switchUP(config)#enable secret c1sc0switchUP(config)#switchUP(config)#line con 0switchUP(config-line)#password c1sc0switchUP(config-line)#loginswitchUP(config-line)#exitswitchUP(config)#switchUP(config)#line vty 0 15switchUP(config-line)#password c1sc0switchUP(config-line)#loginswitchUP(config-line)#exit

한빛미디어㈜ - 11 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치의 기본설정 예 (2)switchUP(config)#switchUP(config)#interface fastEthernet 0/1switchUP(config-if)#speed 100switchUP(config-if)#duplex fullswitchUP(config-if)#exitswitchUP(config)#switchUP(config)#interface vlan 1switchUP(config-if)#ip address 192.168.0.100 255.255.255.0switchUP(config-if)#no shutdownswitchUP(config)#switchUP(config)#ip defult-gateway 192.168.0.1switchUP(config)#exitswitchUP#switchUP#copy run start Destination filename [startup-config]? Building configuration...[OK]

한빛미디어㈜ - 12 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치 관련 명령어 (1)– Show running-config

switchUP#sh ruBuilding configuration...

Current configuration:!version 12.0no service padservice timestamps debug uptimeservice timestamps log uptimeno service password-encryption!hostname switchUP!enable secret 5 $1$xI4p$Rm9JPEHRDzEMuWOTx/3Cs.!ip subnet-zerono ip domain-lookup!생략

한빛미디어㈜ - 13 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치 관련 명령어 (2)– User-exec 모드 명령어

switchUP>? Exec commands: access-enable Create a temporary Access-List entry clear Reset functions connect Open a terminal connection disable Turn off privileged commands disconnect Disconnect an existing network connection enable Turn on privileged commands exit Exit from the EXEC help Description of the interactive help system lock Lock the terminal login Log in as a particular user logout Exit from the EXEC name-connection Name an existing network connection ping Send echo messages rcommand Run command on remote switch resume Resume an active network connection set Set system parameter (not config) 생략 ..

한빛미디어㈜ - 14 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치 관련 명령어 (3)– Privilege-exec 모드 명령어

switchUP#? Exec commands: access-enable Create a temporary Access-List entry access-template Create a temporary Access-List entry archive manage archive files cd Change current directory clear Reset functions clock Manage the system clock cluster cluster exec mode commands configure Enter configuration mode connect Open a terminal connection copy Copy from one file to another debug Debugging functions (see also 'undebug') delete Delete a file dir List files on a filesystem disable Turn off privileged commands disconnect Disconnect an existing network connection enable Turn on privileged commands erase Erase a filesystem exit Exit from the EXEC format Format a filesystem fsck Fsck a filesystem 생략 ..

한빛미디어㈜ - 15 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치 관련 명령어 (4)– Show version

switchUP#show version Cisco Internetwork Operating System Software IOS (tm) C2950 Software (C2950-C3H2S-M), Version 12.0(5.3)WC(1), MAINTENANCE INTERIM SOFTWARE Copyright (c) 1986-2001 by cisco Systems, Inc. Compiled Mon 30-Apr-01 07:56 by devgoyal Image text-base: 0x80010000, data-base: 0x8031A000

ROM: Bootstrap program is CALHOUN boot loader

switchUP uptime is 4 minutes System returned to ROM by power-on System image file is "flash:c2950-c3h2s-mz.120-5.3.WC.1.bin"

cisco WS-C2950-12 (RC32300) processor (revision B0) with 22260K bytes of memory. Processor board ID FOC0601X0GZ Last reset from system-reset

한빛미디어㈜ - 16 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

시스코 스위치의 기본설정

• 시스코 스위치 관련 명령어 (5)– Show spanning-treeswitchUP#show spanning-tree

Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol Bridge Identifier has priority 32768, address 0008.a35e.12c0 Configured hello time 2, max age 20, forward delay 15 We are the root of the spanning tree Topology change flag not set, detected flag not set, changes 0 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Timers: hello 0, topology change 0, notification 0

Interface Fa0/3 (port 9) in Spanning tree 1 is down Port path cost 100, Port priority 128 Designated root has priority 32768, address 0008.a35e.12c0 Designated bridge has priority 32768, address 0008.a35e.12c0 Designated port is 9, path cost 0 Timers: message age 0, forward delay 0, hold 0 BPDU: sent 1, received 0

한빛미디어㈜ - 17 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VLAN (1)– 스위치에 연결된 하나의 네트워크를 여러 개의 논리적

네트워크로 분할하는 기술

한빛미디어㈜ - 18 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VLAN (2)

– VLAN 을 사용하면 네트워크의 추가 , 이동 , 변경에 대한 관리를 효율적으로 할 수 있음

– VLAN 사용 시 관리가 더 쉬워지는 것은 아니므로 주의해야 한다 .

[ 그림 ] VLAN(2)

한빛미디어㈜ - 19 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• 트렁킹– 스위치에서 목수의 VLAN 트래픽이 하나의 링크를 통해

이동할 수 있게 만들어진 것

한빛미디어㈜ - 20 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• 트렁킹– 인캡슐레이션 방법 (ISL & 802.1q)

• ISL : 시스코에서 독자적으로 만든 트렁킹 프로토콜• 802.1q : IEEE 의 표준화된 VLAN 트렁킹 프로토콜 VLAN 의 정보가 본래의 이더넷 프레임 안에 추가됨

한빛미디어㈜ - 21 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• ISL 과 802.1q 의 비교

인캡슐레이션 정의 VLAN 별 STP 네이티브 VLAN802.1q IEEE 802.1s 동작

ISL 시스코 PVST+ 개념없음

한빛미디어㈜ - 22 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VTP– 시스코 스위치간의 VLAN 설정과 관련한 데이터를

주고받기 위해서 사용하는 프로토콜

– 시스코 스위치 VTP 의 3 가지 모드• 서버 (Server) 모드 : 기본 값• 클라이언트 (Client) 모드 • 트렌스페어런트 (Transparent) 모드

기 능 서버 모드 클라이언트 모드

트렌스페어런트 모드

VLAN 설정 가능 불가능 가능개별 스위치의 VLAN 정보 저장 저장 불가능 저장

VTP 메시지의 처리방법 사용 사용 무시스위치간의 VLAN 정보 동기화 동기화 동기화 하지 않음

한빛미디어㈜ - 23 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VTP Pruning– 스위치는 모든 브로캐스트 트래픽을 모든 포트로

보내는데 , 필요한 포트만 받도록 , 나머지 포트의 브로드캐스트를 막아주는 기능

한빛미디어㈜ - 24 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VLAN 의 설정 (1)– VLAN Database 모드나 Global Configuration

모드에서 VLAN ID 와 이름을 설정

[ 그림 ] VLAN 의 설정 (1)

한빛미디어㈜ - 25 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VLAN 의 설정 (2)

① VLAN 을 설정하기 위한 VLAN Database 모드로 들어간다 .

② VTP 도메인 이름이 SCHOOL 인 VTP 도메인을 설정한다 .

③ VTP 패스워드를 c1sc0 으로 설정한다 (VTP 패스워드는 설정하지 않아도 된다 . 단 설정할 경우 모든 스위치에 동일하게 설정해줘야 한다 . VTP 는 기본적으로 Server 모드이므로 추가적인 설정은 필요 없다 ).

④ VLAN 100 을 설정하고 , 이름을 teacher 로 설정한다 .

⑤ VLAN 200 을 설정하고 , 이름을 student 로 설정한다 .

⑥ VLAN Database 모드에서 빠져나온다 .

한빛미디어㈜ - 26 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

• VLAN 의 설정 (3)

⑦ Interface Conguration 모드로 들어간다 .

⑧, ⑨, ⑩ 인터페이스 fa0/2 에 VLAN 100 을 설정한다 .

⑪, ⑫, ⑬ 인터페이스 fa0/3 에 VLAN 200 을 설정한다 .

⑭, ⑮, ⑯ 인터페이스 fa0/4 에 VLAN 200 을 설정한다 .

⑰, ⑱, ⑲ 인터페이스 fa0/0 에 트렁크 포트로 연결한다 .

VLAN 의 개념과 시스코 스위치의 설정

한빛미디어㈜ - 27 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VLAN 의 설정 (4)switch_A#vlan databaseswitch_A(vlan)# vtp domain SCHOOLswitch_A(vlan)# vtp pasword c1sc0switch_A(vlan)# vlan 100 name teacherswitch_A(vlan)# vlan 200 name studentswitch_A(vlan)# exitswitch_A# configure terminal switch_A(config)# interface fa0/2switch_A(config-if)# switchport mode accessswitch_A(config-if)# switchport access vlan 100switch_A(config-if)# interface fa0/3switch_A(config-if)# switchport mode accessswitch_A(config-if)# switchport access vlan 200switch_A(config-if)# interface fa0/4switch_A(config-if)# switchport mode accessswitch_A(config-if)# switchport access vlan 200switch_A(config-if)# interface fa0/0switch_A(config-if)# switchport mode trunkswitch_A(config-if)# exit

한빛미디어㈜ - 28 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VLAN 설정 확인 (1)– Show vlan {brief|id}

switch#show vlanVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/

9, Fa0/10, Fa0/11, Fa0/12300 TEST active Fa0/1, Fa0/21002 fddi-default active 1003 trcrf-default active 1004 fddinet-default active 1005 trbrf-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 1002 1003300 enet 100300 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 1 10031003 trcrf 101003 4472 1005 3276 - - srb 1 10021004 fdnet 101004 1500 - - 1 ibm - 0 0 1005 trbrf 101005 4472 - - 15 ibm - 0 0

한빛미디어㈜ - 29 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

• VLAN 설정 확인 (2)– Show vlan brief

switch#show vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/

9, Fa0/10, Fa0/11, Fa0/12 300 TEST active Fa0/1, Fa0/2 1002 fddi-default active 1003 trcrf-default active 1004 fddinet-default active 1005 trbrf-default active switch# switch#show vlan 300 VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 300 VLAN0300 active Fa0/1, Fa0/2

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 300 enet 100300 1500 - - - - - 0 0

한빛미디어㈜ - 30 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 의 개념과 시스코 스위치의 설정

switch#show vtp status VTP Version : 2Configuration Revision : 18Maximum VLANs supported locally : 68Number of existing VLANs : 18VTP Operating Mode : ServerVTP Domain Name : corpVTP Pruning Mode : DisabledVTP V2 Mode : EnabledVTP Traps Generation : DisabledMD5 digest : 0xBD 0x4D 0x95 0xAA 0xA7 0x6B 0xE6 0x4D Configuration last modified by 211.63.143.120 at 3-1-93 04:49:00

• VLAN 설정 확인 (3)– show vtp status

한빛미디어㈜ - 31 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 간의 라우팅 설정

• VLAN 과 라우팅 (1)– VLAN 이 나누어져 있을 경우 호스트 A 와 B 는 서로

통신할 수 없는데 , 이들이 통신하기 위해서는 라우팅이 꼭 필요함

[ 그림 ] VLAN 간의 라우팅

한빛미디어㈜ - 32 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 간의 라우팅 설정

• VLAN 과 라우팅 (2)– VLAN 구간의 라우팅 설정

SWITCH#SWITCH#vlan databaseSWITCH(vlan)#vlan database SWITCH(vlan)#vlan 100SWITCH(vlan)#vlan 200SWITCH(vlan)#vtp mode server SWITCH(vlan)#vtp domain ciscoSWITCH(vlan)#exit! 스위치에 VLAN 100, 200 을 설정한다 .

SWITCH# SWITCH#conf t Enter configuration commands, one per line. End with CNTL/Z. SWITCH(config)#interface fa0/1 SWITCH(config-if)#switchport mode access SWITCH(config-if)#switchport access vlan 100

한빛미디어㈜ - 33 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 간의 라우팅 설정

• VLAN 과 라우팅 (3)

SWITCH(config)#interface fa0/2 SWITCH(config-if)#switchport mode access SWITCH(config-if)#switchport access vlan 100 SWITCH(config)#interface fa0/3 SWITCH(config-if)#switchport mode access SWITCH(config-if)#switchport access vlan 200 SWITCH(config)#interface fa0/4 SWITCH(config-if)#switchport mode access SWITCH(config-if)#switchport access vlan 200 SWITCH(config)#interface fa0/0 SWITCH(config-if)#switchport mode trunk

! 스위치에 fa0/1, fa0/2 에 VLAN 100, fa0/3, fa0/4 VLAN 200, fa0/0 을 트렁킹 포트로 설정한다 .

한빛미디어㈜ - 34 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

VLAN 간의 라우팅 설정

• VLAN 과 라우팅 (4)ROUTER# ROUTER#conf t Enter configuration commands, one per line. End with CNTL/Z. ROUTER(config)#interface fa0/0 ROUTER(config-if)#no shut ROUTER(config-if)#exit ! 스위치에 메인인터페이스를 no shut 상태로 설정한다 .

ROUTER(config)#interface fa0/0.10 ROUTER(config-subif)#encapsulation dot1Q 100ROUTER(config-subif)#ip address 10.0.0.1 255.255.255.0ROUTER(config-subif)#interface fa0/0.20ROUTER(config-subif)#encapsulation dot1Q 200ROUTER(config-subif)#ip address 11.0.0.1 255.255.255.0ROUTER(config-subif)#exit

! 서브인터페이스와 encapsulation 방법과 IP 주소를 설정한다 . (dot1q 는 IEEE 802.3q 를 말한다 )

한빛미디어㈜ - 35 -

IT COOKBOOKIT COOKBOOK

ehanbit.net

Thank you

ehanbit.net