This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NAT/MASQ translated src port

Hope some expert out there can give me some insight on this...

I have 3 nic
eth0 - lan
eth1 - private leased line to another branch (ip 10.8.0.2, gw 10.8.0.1)
eth2 - internet (ip x.x.x.x, gw y.y.y.y - default gw)

all internet is masq, and is working fine. the connection through eth1 private leased line is accessing another set of ip on the other side with ip such as 147.a.a.a. so i created a routing for this, and also a masq on this interface. packet are routed and masq to src ip 10.8.0.2. there is a checkpoint firewall on the other side protecting the range 147.a.a.a.

now my problem is this: most of the time, connection to 147.a.a.a is ok, but some connection will be drop by the checkpoint. checkpoint log reveal a syn packet was received on and existing connection. a little sniffing show that masq done by Astaro was a bit odd. src ip was translated correctly to 10.8.0.2, but src port start at 1029 -> around 4000. seems to me Astaro did not perform the src port translation and its still using client src port, which causes the crash of src port as detected by checkpoint. from what i understand linux masq default uses port > 61000. anyone know whether the masq port range is configurable?  


This thread was automatically locked due to age.
  • I'm not a Checkpoint guru, but it sounds like your Checkpoint is enforcing a tight window for packet sequencing. If a packet arrives out of sequence, and the window for out of sequence packets is tight, Checkpoint does not reassemble the SYN packet in its proper place and sees it as an intruder packet (sure you don't have a man in the middle?). You could confirm this by looking at the sequence numbers in a raw network dump (a higher level dump may sort them back in order and you may miss the out of sequence nature of the packets). Why the packets are so out of sequence I will defer to someone else's opinion. Maybe you can widen Checkpoint's tolerance for out of sequence packets?

    I'm not following about the port mappings causing a "crash", though; sounds like Astaro is doing what it should there -leave the port to what you picked as a client...
       
  • Thanks for the reply

    From my understanding of NAT/masq, each outgoing connection from client in LAN eg

    SRC-192.168.0.3.1029 -> DST-202.87.92.2.25

    should be translated by masq to

    SRC-InternetIP.61001 (masq port) -> DST-202.87.92.2.25

    From my sniffing, it seems like Astaro is not masq the src port, it just simply use back 1029. This is bad because the masq 

    port will not be unique. If another client happen to use port 1029 and init a connection with syn packet, the checkpoint will 

    the connection (including the existing one).

    We had setup a new checkpoint over here for testing and have no issue with the remote checkpoint. It might be a checkpoint to 

    checkpoint friendliness but I wonder why...

    In order to confirm this, I need to know what range Astaro use for masq(linux default to >61000, just not sure about Astaro). 

    Hope someone could give me an idea.