﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-梁宏舍（starofrainnight）-随笔分类-網路開發</title><link>http://www.cppblog.com/starofrainnight/category/6794.html</link><description>萬載星夜奮筆書，百世冷月淡然看</description><language>zh-cn</language><lastBuildDate>Wed, 21 May 2008 14:30:57 GMT</lastBuildDate><pubDate>Wed, 21 May 2008 14:30:57 GMT</pubDate><ttl>60</ttl><item><title>偽IP如何實現與客戶機進行TCP通訊？快崩潰了啊~</title><link>http://www.cppblog.com/starofrainnight/archive/2008/04/04/46268.html</link><dc:creator>starofrainnight</dc:creator><author>starofrainnight</author><pubDate>Fri, 04 Apr 2008 11:38:00 GMT</pubDate><guid>http://www.cppblog.com/starofrainnight/archive/2008/04/04/46268.html</guid><wfw:comment>http://www.cppblog.com/starofrainnight/comments/46268.html</wfw:comment><comments>http://www.cppblog.com/starofrainnight/archive/2008/04/04/46268.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/starofrainnight/comments/commentRss/46268.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/starofrainnight/services/trackbacks/46268.html</trackback:ping><description><![CDATA[----------- <br>* 軟件環境：<br><br>WinXP sp2<br><br>截取數據包的Ndis5.0驅動已經寫好。<br>在用戶層，能夠修改驅動發來的數據包的IP地址，客戶機也能接收到該數據包。<br><br>我這個軟件是用于模擬多客戶機與服務器連接實現數據傳輸的測試軟件。<br><br>----------- <br>* 硬件環境：<br><br>(33.33.33.33(假定是這個))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |------ 客戶機2 (192.168.1.105)<br>客戶機1 --- 路由 (192.168.1.1) ------|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |------ 發送機 (192.168.1.100) （偽裝 99.99.99.99）<br><br>現在需要發送機偽裝IP 99.99.99.99 與兩客戶機進行TCP通信<br><br>在客戶機2安裝的Ethereal 檢測到發送機發來的IP為 99.99.99.99 數據包，物理地址（MAC）也為發送機的物理地址。<br><br>但問題是，當客戶機2接收到第一次TCP握手包后，它返回的響應包雖然目的IP地址仍然是99.99.99.99，但物理地址卻是網關 192.168.1.1的物理地址！我再查看客戶機2的數據包，發現在它接收到發送機發送的握手包時，它先發送ARP數據包查詢了網關 （192.168.1.1）的物理地址再發到網關。也就是說，當客戶機發現接收的數據包IP與自己不在同一子域則自動把數據包發往網關，但現在問題是由于 發送的物理地址改變了，網關只能查詢正確的99.99.99.99的物理地址，那這時候，數據包也就不能再返回偽裝的發送機上了。于是TCP連接被逼中 斷。<br><br>而且，兩客戶機均開啟了防火牆，不能使用ICMP實現數據包路徑轉移。<br><br>請問各位，有何方法可以實現發送機與兩客戶機用偽IP通信？<br><br>我嘗試發送ARP包去修改客戶機2的ARP緩沖，但沒用，不同一子域的IP地址不會受到緩沖，結果IP包依然發往網關。<br><br><br><br><br><img src ="http://www.cppblog.com/starofrainnight/aggbug/46268.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/starofrainnight/" target="_blank">starofrainnight</a> 2008-04-04 19:38 <a href="http://www.cppblog.com/starofrainnight/archive/2008/04/04/46268.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>