Handling a protocol through SNAT
[Originally sent on netfilter-devel, I intended this to be more of a bug report but by the time I finished writing it it turned into a plea for help. So I guess it belongs here more than there]
I'm trying to get a protocol that doesn't deal well with NATS to work through an iptables Masq/SNAT. I've solved a number of small problems already in user-space but I think I'm stuck with two main problems that might require a kernel module.
The next hurdle I'm facing is that one part of the protocol involves the servers sending a packet to the client on a port the client is listening on. The client doesn't normally send anything from that port.
I've modified the client to send a packet from that port to each server on startup to tickle the SNAT. However that only seems to be working for the last server it contacts. It seems the SNAT is only looking at the local port not the remote ip address and port. I need to allow all the servers to reach the client.
This seems like a bug in iptables that it isn't considering every flow independently. Two remote ip addresses can contact the same port independently and should be treated as separate flows, not be bucketed together.
Barring fixing this in iptables, how can I create a manual rule to forward all packets coming in on the port the client is listening on to the client regardless of which server it's being sent from? The next step would be to make a module that did that automatically, but a manual rule would make me happy for now.
Signature · 1 line
greg