缃戠粶宸ュ叿

鍚勭缃戠粶宸ュ叿

ping

鍩轰簬ICMP鐨勫崗璁紑鍙戠殑


ip棣栭儴


ip棣栭儴


ip棣栭儴


ip棣栭儴


ip棣栭儴


绫诲瀷type | 浠g爜code | 鏍¢獙鍜 |


鏍囪瘑绗 | 搴忓垪鍙 |


鍙夋暟鎹
– 绫诲瀷锛 鍗矷CMP鐨勭被鍨嬶紝鍏朵腑ping鐨勮姹傜被鍨嬩负0锛屽簲绛斾负8.
– 浠g爜锛 杩涗竴姝ュ垝鍒唅cmp鐨勭被鍨嬶紝鐢ㄦ潵鏌ユ壘浜х敓閿欒鐨勫師鍥犮
– 鏍¢獙鍜岋細 鐢ㄤ簬妫鏌ラ敊璇殑鏁版嵁銆
– 鏍囪瘑绗︼細 閫氳繃鏍囪瘑绗︽潵纭鏄皝鍙戦佺殑鎺у埗鍗忚锛屽彲浠ユ槸杩涚▼id銆
– 搴忓垪鍙凤細 鍞竴纭畾鐨勪竴涓姤鏂囷紝鍓嶉潰ping鎵ц鍚庢樉绀虹殑icmp_seq灏辨槸杩欎釜鍊笺

褰撴垜浠彂璧穚ing鍛戒护锛宲ing绋嬪簭瀹為檯涓婁細缁勮鎴愬鍥剧殑涓涓猧p鎶ユ枃锛屾姤鏂囩殑鐩殑鍦板潃涓簆ing鐨勭洰鏍囧湴鍧
锛屾簮鍦板潃灏辨槸鍙戦乸ing鍛戒护鏃剁殑涓绘満鍦板潃锛屽悓鏃舵寜鐓cmp鎶ユ枃鏍煎紡澶╀笂鏁版嵁锛屽湪鍙夋暟鎹笂鍙互濉笂鍙戦佹椂鐨勬椂闂存埑銆

ip鎶ユ枃閫氳繃arp鍗忚锛屾簮鍦板潃鍜岀洰鐨勫湴鍧琚炕璇戞垚mac鍦板潃锛岀粡杩囨暟鎹摼璺眰鍚庯紝鎶ユ枃琚紶杈撳嚭鍘伙紝褰撴姤鏂囧埌杈剧洰鐨勫湴鍧涔嬪悗锛岀洰鐨勫湴鍧鎵鍦ㄧ殑涓绘満涔熸寜鐓cmp鍗忚杩涜搴旂瓟锛屼箣鎵浠ュ彨鍋氬崗璁紝鏄洜涓哄弻鏂归兘浼氶伒瀹堣繖涓姤鏂囨牸寮忥紝骞朵笖涔熶細鎸夌収鏍煎紡杩涜鍙戦-搴旂瓟銆

搴旂瓟鏁版嵁鍒拌揪婧愬湴鍧涔嬪悗锛宲ing鍛戒护鍙互閫氳繃鍐嶆瑙f瀽icmp鎶ユ枃锛屽姣斿簭鍒楀彿锛岃绠楁椂闂存埑绛夋潵瀹屾垚姣忎釜鍙戦-搴旂瓟鐨勬樉绀猴紝鏈缁堟樉绀虹殑鏍煎紡灏卞儚鍓嶉潰鐨勪緥瀛愪腑灞曠ず鐨勪竴鏍枫

ifconfig

inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
inet6 addr: fe80::54:adff:feea:602e/64 Scope:Link

杩欓噷鏄剧ず鐨勬槸缃戝崱鐨刬pv4鍜宨pv6鍦板潃锛屽叾涓璱pv4杩樻樉绀轰簡璇ョ綉缁滅殑瀛愮綉鎺╃爜浠ュ強骞挎挱鍦板潃銆

閫氬父鏉ヨ锛岃繖绉嶈绉颁负骞挎挱(broadcast)鐨勬妧鏈紝鏄敤udp鏉ュ疄鐜扮殑銆

netstat lsof

netstat -alepn 鏌ョ湅褰撳墠鎵鏈夎繛鎺ヨ鎯
tcp 0 0 127.0.0.1:2379 127.0.0.1:52464 ESTABLISHED 0 27710 3496/etcd
浠h〃鐨勬槸 鏈湴127.0.0.1鐨勭鍙52464杩炰笂127.0.0.1鐨勭鍙2379锛岀姸鎬佷负established锛屾湰鍦拌繘绋嬩负etcd锛岃繘绋嬩负3496
鍙濂楁帴瀛楃瓫鏌
netstat Socket -x -alepn
unix 3 [ ] STREAM CONNECTED 23209 1400/dockerd /var/run/docker.sock
lsof /var/run/docker.sock
鏌ョ湅鍒板簳鏄皝鎵撳紑浜嗚繖涓枃浠讹紝姣斿鐢ㄦ潵鏌ョ湅绔彛鍗犵敤

tcpdump

tcpdump鍦ㄥ紑鍚姄鍖呯殑鏃跺欙紝浼氳嚜鍔ㄥ垱寤轰竴涓被鍨嬩负AF_PACKET鐨勭綉缁滃鎺ュ彛锛屽苟鍚戠郴缁熷唴鏍告敞鍐屻傚綋缃戝崱鎺ユ敹鍒颁竴涓綉缁滄姤鏂囦箣鍚庯紝瀹冧細閬嶅巻绯荤粺涓墍鏈夊凡缁忚娉ㄥ唽鐨勭綉缁滃崗璁紝鍖呮嫭鍏朵腑宸茬粡娉ㄥ唽浜嗗緱AF_PACKET鐨勭綉缁滃崗璁傜郴缁熷唴鏍告帴涓嬫潵灏变細灏嗙綉鍗℃敹鍒扮殑鎶ユ枃鍙戦佺粰璇ュ崗璁殑鍥炶皟鍑芥暟杩涜涓娆″鐞嗭紝鍥炶皟鍑芥暟鍙互鎶婃帴鍙楀埌鐨勬姤鏂囧鍒朵竴浠斤紝鍋囪鏄嚜宸辨帴鏀跺埌鐨勬姤鏂囷紝鐒跺悗浜ょ粰tcpdump绋嬪簭锛岃繘琛屽悇绉嶆潯浠剁殑杩囨护鍜屽垽鏂紝鍐嶅鎶ユ枃杩涜瑙f瀽澶勭悊銆
– [S]:SYN,琛ㄧず寮濮嬭繛鎺
– [.]:娌℃湁鏍囪锛屼竴鑸槸纭
– [P]: PSH,琛ㄧず鏁版嵁鎺ㄩ
– [F]锛氳〃绀烘帹閫佺粨鏉
– [R]: 琛ㄧず閲嶆柊杩炴帴

鎴戜滑鍙互鐪嬪埌鏈鍚庣殑鍑犱釜鏁版嵁,浠栦滑浠h〃鐨勫惈涔夊涓:
– seq: 鍖呭簭鍙,灏辨槸tcp鐨勭‘璁ゅ垎缁
– cksum: 鏍¢獙鐮
– win: 婊戝姩绐楀彛澶у皬
– length: 鎵胯浇鐨勬暟鎹(payload)闀垮害length,濡傛灉娌℃湁鏁版嵁鍒欎负0
tcpdump杩樺彲浠ュ姣忎竴鏉cp鏁版嵁鏄剧ず锛屽tcp鎶ユ枃鎺掓煡寰堟湁甯姪銆

All posts

Other pages

鍙戣〃璇勮

鐢靛瓙閭欢鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢*鏍囨敞