On Thu, 24 Oct 2002 17:13:13 +0200, Guido van Rooij wrote: >> bimap and not RDR as the host needs to make outbound connections from the >> DMZ as well as accept inbound as well. > >Outbound packets are entirely different. You almost never want to use bimap. > >Use a combination of rdr (for inbound connections) and map (for outbound >connections). > >> >> If I dont alias an interface, the host just throws the packet back out its >> default gateway as it does not know what to do with it. > >?? >rdr rewrites the destination before it hits the kernels IP stack. >The IP stack will just use noral routing tables. >So if you rewrite to an internal IP address, the packet will go to the inside.
The problem was that there's two external interfaces. We have int0=1.1.1.2/30 and int1=1.2.1.2/30 on the outside. We've /since/ added 1.3.1.1/32 on the outside, which is what we're trying to now map. The real problem seems to lie in that ipnat doesn't (and possibly shouldn't) keep state. The connection comes in int1, gets RDR'ed to the internal server, then when the internal server responds, it goes /out/ int0. So we initially had: client ----> int1 on firewall ----> internal ----> int0 on firewall ---> client Which we fixed by allocating another IP address to the host. But that still didn't fix the problem. We can RDR in, but the MAP out messes everything up: client (dport 80) ----> int1 on firewall (dport 80) ----> internal (dport 80/sport 80) ----> int0 on firewall (sport 48262) ----> client (sport 48262) So the resposne is actually /there/, it just has the wrong source port. A question here: is there a way to map, but not alter the source port? To solve this, I tried using bimap. This kept the mapping of the ports correct, but also disabled filtering? I had rules in there to disallow *all* access to and from *all* IP's involved in this scheme, yet all traffic was still went through. So the problem, in a nutshell, is this: the RDR works fine and redirects the inbound packets, but, as to spec, doesn't 'remember' where the packet came from. MAP will NAT the internal response to the correct external IP address, but it munges the source port of the response, thus causing the client to ignore it. Any suggestions?
