● running-config와 startup-config 구성 간의 차이를 출력,

*** (별) 로 시작하는 섹션은 Startup-config, --- (대시) 아래의 섹션은 Running-config

switch# sh run dif
*** Startup-config
--- Running-config
***************
*** 288,298 ****
  
  interface mgmt0
    vrf member management
  
  interface loopback0
!   ip address 1.1.1.1/24
  line console
  line vty
  

--- 287,297 ----
  
  interface mgmt0
    vrf member management
  
  interface loopback0
!   ip address 2.2.2.2/24
  line console
  line vty

 

● match 되는 행의 앞,뒤에 표시 할 행 수를 지정하여 running-config를 필터링하여 출력

N5k-UP# show running-config | grep prev 1 next 2 Firewall
interface Ethernet1/1
description Firewall – LAN
interface Ethernet1/2
--
interface Ethernet1/4
description Firewall - WAN
interface Ethernet1/5

 

● 한 번의 명령으로 여러개의 명령어 실행

NXOS-1# sh clo ; sh switchname ; sh license host-id
13:25:46.280 UTC Fri Feb 09 2024
Time source is NTP
NXOS-1 
License hostid: VDH=9BAZ0R47J6O
NXOS-1#

 

● 10진수 ↔ 16진수 변환

switch# hex 255
0xff
switch# dec 0xff
255

 

● 명령어 실행 지연

NXOS-1# sh clo ; sleep 5 ; sh clo
13:29:00.744 UTC Fri Feb 09 2024
Time source is NTP
13:29:05.761 UTC Fri Feb 09 2024
Time source is NTP

 

running-config 구성을 bootflash로 Redirect

NXOS-1# show running-config > backup_$(SWITCHNAME)_$(TIMESTAMP)
NXOS-1# 
NXOS-1# dir bootflash:
	.....
       4254    May 11 11:54:20 2024  backup_NXOS-1_2024-05-11-11.54.20

 

● configuration 스냅샷 및 rollback

NXOS-1# checkpoint ANNE
.Done
NXOS-1# sh checkpoint summary 
1) ANNE:
Created by admin
Created at Fri, 13:34:43 09 Feb 2024
Size is 22,658 bytes
User Checkpoint Summary
--------------------------------------------------------------------------------
Description: None

NXOS-1# 
NXOS-1# conf
Enter configuration commands, one per line. End with CNTL/Z.
NXOS-1(config)# host ANNE_TEST
ANNE_TEST(config)# end
NXOS-1# 
ANNE_TEST# sh diff rollback-patch checkpoint ANNE running-config 
Collecting Running-Config
Generating Rollback Patch
!!                                                                  
hostname ANNE_TEST

vdc ANNE_TEST id 1

ANNE_TEST#
ANNE_TEST#
ANNE_TEST# rollback running-config checkpoint ANNE 
ADVISORY: Rollback operation started...
Modifying running configuration from another VSH terminal in parallel
is not recommended, as this may lead to Rollback failure.

Collecting Running-Config
Generating Rollback patch for switch profile
Rollback Patch is Empty
Collecting Running-Config
Generating Rollback Patch
Executing Rollback Patch 
During CR operation,will retain L3 configuration
when vrf member change on interface
Generating Running-config for verification
Generating Rollback Patch

Rollback completed successfully.

NXOS-1# 
NXOS-1#

 

● CLI variables를 사용하여 TAC 정보를 압축된 .gz 파일로 특정 위치에 저장

NXOS-1# show cli variables
VSH Variable List (* = session vars)
-----------------
SWITCHNAME="NXOS-1"
TIMESTAMP="2024-02-11-11.16.29"
NXOS-1# 
NXOS-1# 
NXOS-1# tac-pac bootflash:$(SWITCHNAME)_$(TIMESTAMP)-show-tech-all.gz
Show tech detail can take more than 5 minutes to complete. Please Wait ...
2024 Feb 11 11:17:43 NXOS-1 %$ VDC-1 %$ %SECURITYD-2-FEATURE_ENABLE_DISABLE: User  has enabled the feature bash-shell
2024 Feb 11 11:17:44 NXOS-1 %$ VDC-1 %$ %SECURITYD-2-FEATURE_ENABLE_DISABLE: User  has disabled the feature bash-shell
NXOS-1# 
NXOS-1# 
NXOS-1# dir bootflash:
   .....
    6586243    Feb 11 11:19:46 2024  NXOS-1_2024-02-11-11.16.54-show-tech-all.gz
    7568071    Feb 11 12:46:32 2024  show_tech_out.gz
   .....
Usage for bootflash://sup-local
   .....
  copy bootflash://sup-local/backup.2024-03-07-11.48.22 tftp:1.1.1.1 vrf management

 

● 대소문자를 구분하지 않고 matching ( -i )

NXOS-2# sh int des | include -i test
Eth1/1        eth    10G     ## test-1 ##
Eth1/2        eth    10G     ## Test-2 ##


NXOS-2# sh int des | grep -i test
Eth1/1        eth    10G     ## test-1 ##
Eth1/2        eth    10G     ## Test-2 ##

 

● diff 인수를 사용하여 인터페이스 카운트 차이 확인

NXOS# show int eth1/10 | inc unicast | diff
2c2
< 175430277381 unicast packets 1264463 multicast packets 177 broadcast packets
---
> 175432920374 unicast packets 1264481 multicast packets 177 broadcast packets

 

● command history 확인

NXOS-1# show cli history config-mode 
 2  11:12:30     line con 
 3  11:12:33       ex 0
 4  11:12:34     exi
 5  11:12:38     no ip domain-lookup 
 6  11:12:47     host NXOS-1
 8  11:13:21     !CMD: PASSWORD statement not printed
26  11:24:24     feature bash-shell 
47  11:42:51     int eth1/1
48  11:42:59       des ## eth1/1 ##

 

● L3 설정을 유지한채 vrf member 설정

system vrf-member-change retain-l3-config

NXOS-1# ping 1.1.12.2 vr anNE count 20 interval 1
PING 1.1.12.2 (1.1.12.2): 56 data bytes
Request 0 timed out
64 bytes from 1.1.12.2: icmp_seq=1 ttl=254 time=3.158 ms
64 bytes from 1.1.12.2: icmp_seq=2 ttl=254 time=2.509 ms
Request 8 timed out
Request 9 timed out
64 bytes from 1.1.12.2: icmp_seq=10 ttl=254 time=3.811 ms
64 bytes from 1.1.12.2: icmp_seq=11 ttl=254 time=3.92 ms
^C
--- 1.1.12.2 ping statistics ---
14 packets transmitted, 11 packets received, 21.43% packet loss
round-trip min/avg/max = 2.197/3.478/4.87 ms

 

● CPU 사용량 2초 마다 출력

NXOS-1# show system internal processes cpu 2 | no-more

 

show running-config 후 --More-- 상태에서 ' / ' 입력하여 출력을 필터링한 다음 원하는 패턴을 검색

switch# show running-config 

............

/line
...skipping
line console
line vty

 

 

show interface brief | sort

 

● CRC count만 보는 명령어

show int | i is up|CRC

 

● 인터페이스에서 inpit error count만 보는 방법

show interface | section input error

show interface | include input_error

show interface | i up, line protocol is up|input error

show interface | inc FastEthernet|input error

show interface | inc line | CRC

+ Recent posts