Cisco L2, L3 스위치 패스워드 리커버리 및 공장초기화

IT
작성자
Ethan
작성일
2023-05-26 22:31
조회
152

---- 시스코스위치 패스워드 리커버리, 공장초기화방법 ----

: 스위치의 로그인계정 패스워드나 enable패스워드를 잊어버릴때가 있습니다. ㅠㅜ
패스워드 초기화하는 과정입니다.
 
1. 스위치콘솔로 접속합니다.
2. 장비를 전원off 합니다.
3. 앞쪽 MODE 버튼을 누른체로 켭니다.

아래화면이 나올때까지 계속 누르고 있습니다.

Using driver version 1 for media type 1
Base ethernet MAC Address: 54:78:1a:9e
Xmodem file system is available.

The password-recovery mechanism is enabled.

The system has been interrupted prior to initializing the
flash filesystem.  The following commands will initialize
the flash filesystem, and finish loading the operating
system software:

flash_init
boot

switch:

4. flash를 초기화 시킵니다.

switch: flash_init    <-- 명령어실행
Initializing Flash...
mifs[2]: 0 files, 1 directories
mifs[2]: Total bytes     :    3870720
mifs[2]: Bytes used      :       1024
mifs[2]: Bytes available :    3869696
mifs[2]: mifs fsck took 0 seconds.
mifs[3]: 544 files, 19 directories
mifs[3]: Total bytes     :   27998208
mifs[3]: Bytes used      :   12161024
mifs[3]: Bytes available :   15837184
mifs[3]: mifs fsck took 8 seconds.
...done Initializing Flash.


switch: ?    <-- 물음표를 치면 여러명령어가 보임
? -- Present list of available commands
boot -- Load and boot an executable image
cat -- Concatenate (type) file(s)
copy -- Copy a file
delete -- Delete file(s)
dir -- List files in directories
flash_init -- Initialize flash filesystem(s)
format -- Format a filesystem
fsck -- Check filesystem consistency
help -- Present list of available commands
memory -- Present memory heap utilization information
mkdir -- Create dir(s)
more -- Concatenate (display) file(s)
rename -- Rename a file
reset -- Reset the system
rmdir -- Delete empty dir(s)
set -- Set or display environment variables
set_bs -- Set attributes on a boot sector filesystem
set_param -- Set system parameters in flash
sleep -- Pause (sleep) for a specified number of seconds
type -- Concatenate (type) file(s)
-- MORE --
unset -- Unset one or more environment variables
version -- Display boot loader version

5. config파일을 확인해봅니다.
 
switch: dir flash:
Directory of flash:/

2  -rwx  1400      <date>               config.text.renamed
3  -rwx  616       <date>               vlan.dat
4  -rwx  3066      <date>               config.text
5  drwx  512       <date>               c2960-lanlitek9-mz.122-55.SE5
561  -rwx  5         <date>               private-config.text.renamed
562  -rwx  3096      <date>               multiple-fs
563  -rwx  1920      <date>               private-config.text

6. config파일을 임시로 변경하고 다시 확인해봅니다.

switch: rename flash:config.text flash:config.backup
 
switch: dir flash:
Directory of flash:/

2  -rwx  1400      <date>               config.text.renamed
3  -rwx  616       <date>               vlan.dat
4  -rwx  3066      <date>               config.backup    <-- 변경됨
5  drwx  512       <date>               c2960-lanlitek9-mz.122-55.SE5
561  -rwx  5         <date>               private-config.text.renamed
562  -rwx  3096      <date>               multiple-fs
563  -rwx  1920      <date>               private-config.text

7.  리부팅시켜 패스워드를 초기화 시킵니다.

switch: boot
Loading "flash:/c2960-lanlitek9-mz.122-55.SE5/c2960-lanlitek9-mz.122-55.SE5.bin"...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@~
 
8. enable모드로 들어가서 파일명을 다시 원상복구합니다.
 
Would you like to enter the initial configuration dialog? [yes/no]: no
Switch>en
Switch#
Switch#show flash

Directory of flash:/

2  -rwx        1400   Mar 1 1993 00:03:57 +00:00  config.text.renamed
3  -rwx         616   Dec 1 1993 10:08:30 +00:00  vlan.dat
563  -rwx        1048   Mar 1 1993 00:01:03 +00:00  multiple-fs
4  -rwx        3066   Dec 1 1993 10:23:24 +00:00  config.backup
5  drwx         512   Mar 1 1993 00:11:16 +00:00  c2960-lanlitek9-mz.122-55.SE5
561  -rwx           5   Mar 1 1993 00:03:57 +00:00  private-config.text.renamed

27998208 bytes total (15842304 bytes free)

Switch#rename flash:config.backup flash:config.text   <-- 다시 config파일명을 원상복구
Destination filename [config.text]?    <-- 여기선 그냥 엔터누름
Switch#show flash

Directory of flash:/

2  -rwx        1400   Mar 1 1993 00:03:57 +00:00  config.text.renamed
3  -rwx         616   Dec 1 1993 10:08:30 +00:00  vlan.dat
563  -rwx        1048   Mar 1 1993 00:01:03 +00:00  multiple-fs
4  -rwx        3066   Dec 1 1993 10:23:24 +00:00  config.text   <-- 이전이름으로 원상복구됨
5  drwx         512   Mar 1 1993 00:11:16 +00:00  c2960-lanlitek9-mz.122-55.SE5
561  -rwx           5   Mar 1 1993 00:03:57 +00:00  private-config.text.renamed

9. flash설정을 다시 running-config로 복사합니다.

Switch#copy flash:config.text system:running-config
Destination filename [running-config]?
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

10. 새로운 enable패스워드나 user패스워드를 변경하고 저장합니다.

​     저장후 리부팅한 후 정상적으로 붙는지 테스트해보면 끝.

Switch1#conf t
Switch1(config)#enable secret 12345
Switch1#wr 

@ config설정까지 공장초기화 하고싶으면 아래 명령어 후 리부팅합니다.

Switch1#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
Switch1#  reload
Proceed with reload? [confirm]

 
출처 : 나전노:) 나으전산관리노하우 님 blog
시스코스위치 패스워드리커버리 및 공장초기화방법 : 네이버 블로그 (naver.com)



witch>enable
switch# show running-config //config 설정 확인 -> 필요 config 백업
switch# erase startup-config //초기 설정파일 삭제
Erasing the nvram filesystem will remove all configuration files! Continue?[confirm] // Enter로 진행
[OK]
Erase of nvram : complete
switch# write erase //config 설정 초기화
Erasing the nvram filesystem will remove all configuration files! Continue?[confirm] // Enter로 진행
[OK]
Erase of nvram : complete
switch# reload //장비 명령어 재부팅
System configuration has been modified. Save?[yes/no] : no
Proceed with reload? [confirm] // Enter로 진행
Continue with configuration dialog? [yes/no] : no

VLAN 정보를 제외한 후 스위치 설정 초기화


출처: 프리윙즈 님 blog
https://freewings.tistory.com/3

 

전체 69
번호 제목 작성자 작성일 추천 조회
54
[ABKO 키보드 FAQ] 한/영 키가 변환되지 않습니다.
Ethan | 2023.05.26 | 추천 0 | 조회 152
Ethan 2023.05.26 0 152
53
Cisco L2, L3 스위치 패스워드 리커버리 및 공장초기화
Ethan | 2023.05.26 | 추천 0 | 조회 152
Ethan 2023.05.26 0 152
52
스타일러스 펜을 위한 필수 윈도우 앱 10선
Ethan | 2020.01.13 | 추천 0 | 조회 1167
Ethan 2020.01.13 0 1167
51
시스코 AP 기본 설정방법
Ethan | 2019.11.24 | 추천 0 | 조회 3067
Ethan 2019.11.24 0 3067
50
네트워크 정기점검 기본 명령어
Ethan | 2019.11.23 | 추천 1 | 조회 7589
Ethan 2019.11.23 1 7589
49
술, 정 피할 수 없다면… 안주 '똑똑하게' 고르자
Ethan | 2019.11.10 | 추천 0 | 조회 765
Ethan 2019.11.10 0 765
48
에어컨 속 세균 드글드글… 간단 청소법
Ethan | 2019.06.19 | 추천 0 | 조회 961
Ethan 2019.06.19 0 961
47
공유기 제조사별 접속주소 및 초기 아이디, 패스워드
Ethan | 2019.05.05 | 추천 0 | 조회 1037
Ethan 2019.05.05 0 1037
46
매일 마시는 커피, 毒 안 되게 하려면?
Ethan | 2017.10.15 | 추천 0 | 조회 769
Ethan 2017.10.15 0 769
45
고양이가 당신을 사랑한다는 증거 11
Ethan | 2017.07.30 | 추천 0 | 조회 660
Ethan 2017.07.30 0 660
44
복용 후 운전하면 안 되는 약
Ethan | 2017.06.13 | 추천 0 | 조회 724
Ethan 2017.06.13 0 724
43
치약에 물 묻히고 이 닦을까? 그냥 닦을까?
Ethan | 2017.06.13 | 추천 0 | 조회 712
Ethan 2017.06.13 0 712
42
굳고 퇴화한 뇌…말랑말랑, 생생하게 되돌려볼까 ②
Ethan | 2017.05.12 | 추천 0 | 조회 666
Ethan 2017.05.12 0 666
41
굳고 퇴화한 뇌…말랑말랑, 생생하게 되돌려볼까 ①
Ethan | 2017.05.12 | 추천 0 | 조회 619
Ethan 2017.05.12 0 619
40
피로회복제 성분 타우린, 음식으로 보충하려면?
Ethan | 2017.05.12 | 추천 0 | 조회 559
Ethan 2017.05.12 0 559