鍩轰簬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鎶ユ枃锛屽姣斿簭鍒楀彿锛岃绠楁椂闂存埑绛夋潵瀹屾垚姣忎釜鍙戦-搴旂瓟鐨勬樉绀猴紝鏈缁堟樉绀虹殑鏍煎紡灏卞儚鍓嶉潰鐨勪緥瀛愪腑灞曠ず鐨勪竴鏍枫
Link encap:Ethernet HWaddr 02:54:ad:ea:60:2e
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 -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 -i eth0
tcpdump src host hostname
tcpdump 'tcp and port 80 and src host 192.168.1.25'
tcpdump 'tcp and port 80 and tcp[13:1]&2 != 0'
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鎶ユ枃鎺掓煡寰堟湁甯姪銆
鍙戣〃鍥炲