Networking Forums

Networking Forums > Computer Networking > Linux Networking > tcp checksum after port translation

Reply
Thread Tools Display Modes

tcp checksum after port translation

 
 
Giacomo
Guest
Posts: n/a

 
      09-14-2005, 06:31 PM
Good morning, i calculate tcp checksum after changing a destination port
(nat)

For example: A (192.168.0.2) sends ssh to 192.168.0.1 : 222 (B) and packets
are redirected to 192.168.0.1 : 22

After changing port, i recalculate checksum in prerouting on B.

B responds to A, sending response from port 22, so I change in postrouting
the source port to 222, the one
A expects from.

Then I recalculate checksum.
In post routing I printk the checksum recalculated by B: it is correct,
according to the checksum expected
by A (ethereal confirms that).

The fact is that A receives back always the same checksum different from the
right one.

Why do i read the correct checksum in B postrouting and then A receives a
bad value?
Has it to do with HW_CHECKSUM?? (and what is that?)

This happens to machine B (amd athlon, realtek 8139, via motherboard),
towards A
(intel P4, natsemi net card, intel chipset).

If I invert roles, it works!!
(P4 machine responds ok to this kind of redirect).

If I insert module iptable_nat, it works!!

Without, checksum seems to be set correctly in postrouting skb, but arrives
wrong and always the same (0x81a5).
Someone changes checksum after postrouting netfilter hook??

the packet flow is

PREROUTING ->(redirect) -> INPUT ->SSH-> OUTPUT->POSTROUTING (de-dport
translation)

If I redirect port and IP all works fine (PRE->FWD->POST)

Thanks for any idea of what's going wrong
GIacomo-


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables problem with port translation jblumenkrantz@gmail.com Linux Networking 2 10-31-2007 07:46 PM
Port Translation via iptables? d a v i d Linux Networking 1 04-19-2007 08:17 PM
port translation on same network gene bene Linux Networking 1 07-16-2004 10:26 PM
WIndows 2003 firewall port translation! KK Windows Networking 1 05-21-2004 08:24 PM
Port Address Translation Sherwin Windows Networking 8 01-06-2004 06:27 AM



1 2 3 4 5 6 7 8 9 10 11