From: Michael Gundlach Subject: Urgent question: changing src|dst IP w/ ipq fails Date: Tue, 18 Feb 2003 16:23:20 -0500 Sender: netfilter-devel-admin@lists.netfilter.org Message-ID: <20030218162320.A25778@cs.uga.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: To: netfilter-devel@lists.netfilter.org Content-Disposition: inline Errors-To: netfilter-devel-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: netfilter-devel.vger.kernel.org Hi all, I had a neat idea a few days ago and am rushing under a deadline (tomorrow morning, Feb 19) to get it working. Any help would be greatly appreciated. I have a machine A sending packets to machine C, and machine B is a linux bridge running ipq between them on the network. B is catching all packets between A and C, looking at them, and reinjecting them. This works just fine, and A and C can talk happily together without knowing that the bridge B is between them. Now I wish to modify the source or destination addresses of these packets before reinjecting them. Modifying the source or destination *port* and reinjecting the packet works fine - the destination computer (running tcpdump) sees a packet from the source, using the new source or destination port that ipq put in. However, modifying the source or destination *IP* does not work. When IPQ changes a A->D packet to be A->C, C never gets the packet. When IPQ changes a A->C packet to be D->C, C will *eventually* (after 20+ seconds) get a packet claiming to come from D. Running tcpdump on the bridge B, I see a TCP SYN packet come in from A->C, and 20 seconds later or so a TCP SYN packet D->C (the reinjected packet); but only, say, 2 out of 3 of the A->C packets get successfully retransmitted as D->C. Any idea what I am doing wrong? I am recalculating IP and TCP checksums OK, I know that. A colleague thinks perhaps I have to set up a new route in the kernel-level code when I modify the destination IP, but I don't think so - since ipq is a user-level interface. Also, that wouldn't solve the source-IP-modification problem. I am using a version of netfilter 1.6a that is patched to work with a bridging kernel. Thanks in advance - and *please* post back soon :) Even if it's past the morning of Feb 19th, I still need to figure this out. Michael Gundlach