在HP-UX上使用nettl抓包

來源:互聯網
上載者:User

HP-UX 自己提供了抓包工具,nettl 。在tcpdump不能用的時候它(比如tcpdump在HP-UX上就不能抓迴環上的包)就派上用場了。總結一下nettl的主要用法,備查。 開始抓包: # nettl -tn all -e all -maxtrace 99999 -f /tmp/tixiang # nettl -tn loopback -e ns_ls_tcp -maxtrace 99999 -f /tmp/tixiang # nettl -tn pduin pduout -e ns_ls_loopback -tm 100000 -f /tmp/local # nettl -tn pduin pduout -e ns_ls_loopback -m 56 -tm 100000 -f /tmp/local # nettl -tn pduin -e ns_ls_loopback -m 56 -tm 100000 -f /tmp/local -m size 限制每個包的大小。我們不一定對所有的包都感興趣,在只對包頭幹興趣的時候這個選項就非常有效。 FDB協議使用的包頭為16個位元組,再加上IP頭的20個位元組,TCP頭的20個位元組,也就是我們只需要總共56個位元組就能確定一個包的基本資料了。 -e subsytem 要抓包的類型,可以使用 nettl -status 來擷取。 ns_ls_loopback ns_ls_ip ns_ls_tcp ns_ls_udp ns_ls_icmp -tm maxsize 每個檔案的最大大小,如果超過此大小,會使用下一個抓包檔案。單位:KB。有效值:100~99999 抓包的輸出檔案為 /tmp/tixiang.xxxx,使用 ls -l /tmp/tixiang.* 來檢查 說明: 在 ns_ls_loopback 上抓包如果指定了pduin 和 pduout 每個包會抓到2份,因為一進一出就是兩份。 如果指定 -tn all -e all 一個包也會抓到多份,因為一個包可能屬於不同的 subsystem,比如一個tcp包既屬於tcp,也屬於ip等。 抓的包可以使用wireshark來開啟並進行分析。也可以使用HP-UX內建的netfmt來分析。 查看狀態及-entity可用的資訊: # nettl -status 停止抓包: # nettl -tf -e all 對包的分析 我們可以使用netfmt來查看捕獲的包: netfmt -N -l -f /tmp/nettl_t* | more 可以過濾我們感興趣的包,使用 -c 來傳入過濾檔案 netfmt -N -l -c filter -f /tmp/nettl_t* | more filter 為過濾檔案,檔案內容的類似如下: filter tcp_sport 1234 filter tcp_dport 1234 每一行為一個過濾條件,行與行之間是或的關係。 使用行模式來顯示(這種模式下不會看到包的具體資料) netfmt -N -n -l -1 -f /tmp/nettl_t* | more 在每行的顯示前加上時間戳記 netfmt -T -n -l -1 -f /tmp/nettl_t* | more

參考:

http://www.compute-aid.com/nettl.html http://docs.hp.com/en/B2355-60105/nettl.1M.html http://docs.hp.com/en/B2355-60105/netfmt.1M.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.