夕口技術錄
專業上的小常識,備而用之~
Category Archives: CISCO
[switch][clear] – clear ip arp command
2009/12/15
Posted by 於 Clear 單 ip
C3550#clear ip arp 10.1.21.7Clear All ARP
C3550#clear arp-cache
指令search
C3550#clear ip arp ?
A.B.C.D IP address of dynamic ARP entry
inspection Clear State of ARP Inspection
poll IP ARP host polling
[Cisco] – cisco 4507r 端口鏡像配置方法
2009/06/10
Posted by 於 Router(config)#monitor session ?
SPAN session number
Router(config)#monitor session 1 ?
destination SPAN destination interface or VLAN
filter SPAN filter VLAN
source SPAN source interface or VLAN
Router(config)#monitor session 1 de
Router(config)#monitor session 1 destination ?
interface SPAN destination interface
Router(config)#monitor session 1 destination i
Router(config)#monitor session 1 destination interface ?
FastEthernet FastEthernet IEEE 802.3
Router(config)#monitor session 1 destination interface f
Router(config)#monitor session 1 destination interface fastEthernet ?
FastEthernet interface number
Router(config)#monitor session 1 destination interface fastEthernet 0/0 ?
, Specify another range of interfaces
– Specify a range of interfaces
Router(config)#monitor session 1 s
Router(config)#monitor session 1 source ?
interface SPAN source interface
vlan SPAN source VLAN
Router(config)#monitor session 1 source in
Router(config)#monitor session 1 source interface ?
FastEthernet FastEthernet IEEE 802.3
Port-channel Ethernet Channel of interfaces
Router(config)#monitor session 1 source interface fa
Router(config)#monitor session 1 source interface fastEthernet ?
FastEthernet interface number
Router(config)#monitor session 1 source interface fastEthernet 0/0 ?
, Specify another range of interfaces
– Specify a range of interfaces
both Monitor received and transmitted traffic
rx Monitor received traffic only
tx Monitor transmitted traffic only
Router(config)#monitor session 1 source interface fastEthernet 0/0 b
Router(config)#monitor session 1 source interface fastEthernet 0/0 both ?
Router(config)#monitor session 1 source interface fastEthernet 0/0 both
Router(config)#monitor session 1 de
Router(config)#monitor session 1 destination ?
interface SPAN destination interface
Router(config)#monitor session 1 destination in
Router(config)#monitor session 1 destination interface fa
Router(config)#monitor session 1 destination interface fastEthernet ?
FastEthernet interface number
Router(config)#monitor session 1 destination interface fastEthernet 0/1
Router(config)#do sh moni sess 1
Session 1
[snmpwalk][cisco] – search port flow
2009/04/07
Posted by 於 使用 snmpwalk + vlanitem 是否有設定 + cisco mib 就可以達到 search port 的功能
/usr/bin/snmpwalk -c public@1 10.1.1.200 -v1 1.3.6.1.2.1.17.4.3.1.1 -t 3 -r 1
/usr/bin/snmpwalk -c public@1 10.1.1.200 -v1 1.3.6.1.2.1.17.4.3.1.2 -t 3 -r 1
/usr/bin/snmpwalk -c public@1 10.1.1.200 -v1 1.3.6.1.2.1.17.1.4.1.2 -t 3 -r 1
/usr/bin/snmpwalk -c public@1 10.1.1.200 -v1 1.3.6.1.2.1.31.1.1.1.1 -t 3 -r 1
/usr/bin/snmpwalk -c public@1 10.1.1.200 -v1 1.3.6.1.2.1.2.2.1.2 -t 3 -r 1
[Linux][DMA] – DMA 關掉(disabled)、irq timeout
2009/01/14
Posted by 於 機器:HP ProLiant DL580 G5
作業系統:CentOS 5.0
光碟機hda是8X的DVD
Message:
Oct 19 05:48:29 mpix-server kernel: ide-cd: cmd 0x3 timed out
Oct 19 05:48:29 mpix-server kernel: hda: irq timeout: status=0xd0 { Busy }
Oct 19 05:48:29 mpix-server kernel: ide: failed opcode was: unknown
Oct 19 05:48:29 mpix-server kernel: hda: ATAPI reset complete
推斷問題點在於 hda 的 DMA 無法 support ,
所以才會一直顯示這個訊息,
因此建議在 BIOS 及 Linux 上把相關設定關掉
Linux :
# hdparm -d0 /dev/hda
———————————– hdparm 指令說明參考
如果你的硬碟是 IDE 介面的,那麼這個指令可以幫助你設定一些進階參數!
如果你是使用 SATA 介面的, 那麼這個指令就沒有多大用途了!
另外,目前的 Linux 系統都已經稍微最佳化過,
所以這個指令最多是用來測試效能啦!
而且建議你不要隨便調整硬碟參數,檔案系統容易出問題喔!
除非你真的知道你調整的資料是啥!
[root@www ~]# hdparm [-icdmXTt] 裝置名稱 選項與參數: -i :將核心偵測到的硬碟參數顯示出來! -c :設定 32-bit (32位元)存取模式。這個 32 位元存取模式指的是在硬碟在與 PCI 介面之間傳輸的模式,而硬碟本身是依舊以 16 位元模式在跑的! 預設的情況下,這個設定值都會被打開,建議直接使用 c1 即可! -d :設定是否啟用 dma 模式, -d1 為啟動, -d0 為取消; -m :設定同步讀取多個 sector 的模式。一般來說,設定此模式,可降低系統因為 讀取磁碟而損耗的效能~不過, WD 的硬碟則不怎麼建議設定此值~ 一般來說,設定為 16/32 是最佳化,不過,WD 硬碟建議值則是 4/8 。 這個值的最大值,可以利用 hdparm -i /dev/hda 輸出的 MaxMultSect 來設定喔!一般如果不曉得,設定 16 是合理的! -X :設定 UtraDMA 的模式,一般來說, UDMA 的模式值加 64 即為設定值。 並且,硬碟與主機板晶片必須要同步,所以,取最小的那個。一般來說: 33 MHz DMA mode 0~2 (X64~X66) 66 MHz DMA mode 3~4 (X67~X68) 100MHz DMA mode 5 (X69) 如果您的硬碟上面顯示的是 UATA 100 以上的,那麼設定 X69 也不錯! -T :測試暫存區 cache 的存取效能 -t :測試硬碟的實際存取效能 (較正確!) 範例一:取得我硬碟的最大同步存取 sector 值與目前的 UDMA 模式 [root@www ~]# hdparm -i /dev/hdc Model=IC35L040AVER07-0, FwRev=ER4OA41A, SerialNo=SX0SXL98406 <==硬碟的廠牌型號 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs } RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=40 BuffType=DualPortCache, BuffSize=1916kB, MaxMultSect=16, MultSect=16 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=80418240 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio1 pio2 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 <==有 * 為目前的值 AdvancedPM=yes: disabled (255) WriteCache=enabled Drive conforms to: ATA/ATAPI-5 T13 1321D revision 1: ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 # 這顆硬碟緩衝記憶體只有 2MB(BuffSize),但使用的是 udma5 !還可以。 範例二:由上個範例知道最大 16 位元/UDMA 為 mode 5,所以可以設定為: [root@www ~]# hdparm -d1 -c1 -X69 /dev/hdc 範例三:測試這顆硬碟的讀取效能 [root@www ~]# hdparm -Tt /dev/hdc /dev/hdc: Timing cached reads: 428 MB in 2.00 seconds = 213.50 MB/sec Timing buffered disk reads: 114 MB in 3.00 seconds = 38.00 MB/sec # 這部測試機沒有很好啦~這樣的速度.....差強人意~ |
如果你是使用 SATA 硬碟的話,這個指令唯一可以做的,就是最後面那個測試的功能而已囉! 雖然這樣的測試不是很準確,至少是一個可以比較的基準。在我的 cluster 機器上面測試的 SATA (/dev/sda) 與 RAID (/dev/sdb) 結果如下,可以提供給你參考看看。
[root@www ~]# hdparm -Tt /dev/sda /dev/sdb
/dev/sda:
Timing cached reads: 4152 MB in 2.00 seconds = 2075.28 MB/sec
Timing buffered disk reads: 304 MB in 3.01 seconds = 100.91 MB/sec
/dev/sdb:
Timing cached reads: 4072 MB in 2.00 seconds = 2036.31 MB/sec
Timing buffered disk reads: 278 MB in 3.00 seconds = 92.59 MB/sec
[PBR] – policy base routing
2008/03/12
Posted by 於 近來因 pc dns cache 的問題,
一直在想是否可以在 switch 端來獲得解決,
最後找到 PBR(policy base routing)的方式…
閱讀全文
近期迴響