シスコのルータでトラぶったので、原因究明のメモ書き (シスコのコマンドONLY編)

ルータの調子が非常にわるくなり、原因究明をしたときのメモ書きです。

CPU使用状況を見る

show processes cpu history

で、下記のようにグラフが見れる。
CPUが完全に振り切っており、正直ひどい状況。

11111
999999990000099999999999999999999999999999999999999999999999
999999990000099999999999999999999999999999999999999999999999
100 ************************************************************
90 ************************************************************
80 ************************************************************
70 ************************************************************
60 ************************************************************
50 ************************************************************
40 ************************************************************
30 ************************************************************
20 ************************************************************
10 ************************************************************
0....5....1....1....2....2....3....3....4....4....5....5....6
0 5 0 5 0 5 0 5 0 5 0
CPU% per second (last 60 seconds)

1 1 111 111 1111 111 1111 1111 1 1 1 1 11 11 11 11 1
099099000990009900009900090000900009090909099009009009009990
099099000990009900009900090000900009090909099009009009009990
100 ############################################################
90 ############################################################
80 ############################################################
70 ############################################################
60 ############################################################
50 ############################################################
40 ############################################################
30 ############################################################
20 ############################################################
10 ############################################################
0....5....1....1....2....2....3....3....4....4....5....5....6
0 5 0 5 0 5 0 5 0 5 0
CPU% per minute (last 60 minutes)
* = maximum CPU% # = average CPU%

11111111111111111111111
000000000000000000000006111111111111111111111111111111111111111211111111
000000000000000000000002457467353754644569354946643267466543156777855548
100 ###################**#*
90 ######################*
80 ######################*
70 #######################
60 #######################*
50 #######################*
40 #######################*
30 #######################* *
20 ######################## ** ** * ** * *** * * ** ** *** ********* *
10 ########################************************************************
0....5....1....1....2....2....3....3....4....4....5....5....6....6....7..
0 5 0 5 0 5 0 5 0 5 0 5 0
CPU% per hour (last 72 hours)
* = maximum CPU% # = average CPU%


インターフェース使用状況を見る

show interface

で、インターフェースの状況を確認する。
インターフェースが死んでいるとかではなく、がんがんパケットが飛びまくりでハングっている状況が見えてくる。

GigabitEthernet0 is up, line protocol is up
 Hardware is PQII_PRO_UEC, address is XXXXX
 Description: $ES_WAN$$FW_OUTSIDE$
 MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec,
  reliability 255/255, txload 1/255, rxload 1/255
 Encapsulation ARPA, loopback not set
 Keepalive set (10 sec)
 Full-duplex, 1000Mb/s, media type is RJ45
 output flow-control is unsupported, input flow-control is unsupported
 ARP type: ARPA, ARP Timeout 04:00:00
 Last input 4w3d, output 00:00:00, output hang never
 Last clearing of "show interface" counters never
 Input queue: 0/75/319/0 (size/max/drops/flushes); Total output drops: 0
 Queueing strategy: fifo
 Output queue: 0/40 (size/max)
 5 minute input rate 2377000 bits/sec, 680 packets/sec
 5 minute output rate 5742000 bits/sec, 1828 packets/sec
  252510487 packets input, 3386169169 bytes, 0 no buffer
  Received 0 broadcasts, 13 runts, 0 giants, 23 throttles
  18 input errors, 0 CRC, 0 frame, 17 overrun, 1 ignored
  0 watchdog, 0 multicast, 0 pause input
  0 input packets with dribble condition detected
  300310044 packets output, 2164398300 bytes, 0 underruns
  0 output errors, 0 collisions, 3 interface resets
  0 unknown protocol drops
  0 babbles, 0 late collision, 0 deferred
  0 lost carrier, 0 no carrier, 0 pause output
  0 output buffer failures, 0 output buffers swapped out


パケットの送受信状況を見る

誰がパケットを飛ばしているのか犯人を捜す。
そのために、NetFlowを有効にする。

Cisco1812J(config)#ip flow-export source FastEthernet1
Cisco1812J(config)#ip flow-export version 5
Cisco1812J(config)#ip flow-export destination [監視ツールサーバのIP] 9996


あと、監視するインターフェース(vlan?)にNetFlowを仕掛ける。

Cisco1812J(config)#int vlan 1
Cisco1812J(config-if)#ip route-cache flow
Cisco1812J(config-if)#ip flow ingress
Cisco1812J(config-if)#ip flow egress


これで、どのようなパケットがどこから飛んでいるか見れるようになる。
ってことで確認。


show ip cache flow


どんな種類のプロトコルが飛んでいるかとか、トラフィックを垂れ流しにしているIPとかを見ることができる。
で、下記のような情報を確認し、やらかしていたマシンを殺してとりあえず、問題解決しました。

IP packet size distribution (19678699 total packets):
1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .095 .033 .002 .002 .001 .000 .000 .000 .024 .025 .435 .068 .044 .006

512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.034 .006 .007 .015 .193 .000 .000 .000 .000 .000 .000

IP Flow Switching Cache, 278544 bytes
28 active, 4068 inactive, 179141 added
3421816 ager polls, 0 flow alloc failures
Active flows timeout in 30 minutes
Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 34056 bytes
28 active, 996 inactive, 166192 added, 166192 added to flow
0 alloc failures, 0 force free
1 chunk, 1 chunk added
last clearing of statistics never
Protocol Total Flows Packets Bytes Packets Active(Sec) Idle(Sec)

                • Flows /Sec /Flow /Pkt /Sec /Flow /Flow

TCP-WWW 40144 0.5 103 892 58.6 2.1 6.5
TCP-SMTP 2 0.0 1 44 0.0 0.0 8.6
TCP-X 68 0.0 1 40 0.0 0.0 8.5
TCP-other 71925 1.0 43 716 44.1 5.9 11.4
UDP-DNS 22440 0.3 1 74 0.3 0.2 15.5
UDP-NTP 2471 0.0 1 76 0.0 0.0 15.4
UDP-Frag 20 0.0 2 450 0.0 0.0 15.4
UDP-other 39870 0.5 309 380 173.3 2.5 15.4
ICMP 2173 0.0 11 118 0.3 24.8 15.3
Total: 179113 2.5 109 541 276.8 3.8 11.8

SrcIf SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Pkts
Vl1 XX.XX.XX.222 Vl1 XX.XX.YY.10 06 E226 0386 28
Di0 70.37.64.202 Vl1 YY.YY.YY.YY 06 01BB C26B 3
Di0 70.37.64.202 Vl1 YY.YY.YY.YY 06 01BB C29D 112
Di0 202.232.2.39 Local YY.YY.YY.YY 11 0035 C005 1
Vl1 XX.XX.XX.222 Vl1 XX.XX.YY.200 11 0089 0089 2

SrcIf SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Pkts
Vl1 XX.XX.XX.12 Di0 65.52.178.73 06 C2BD 0D3D 1
Vl1 XX.XX.XX.222 Vl1 10.10.70.200 11 0089 0089 2
Vl1 XX.XX.XX.29 Null 255.255.255.255 11 445C 445C 2
Vl1 XX.XX.XX.45 Di0 70.37.127.110 06 DDA9 01BB 2