Ram Chandar wrote:

On Sunday 16 November 2003 12:37, Amadeus wrote:
For NATing on the EXT_IFACE, NAT is the last piece of code
that a packet encounter and it is here the magic occur viz. SNATing.

So ipf doesn't see the SNATed packets at all. It sees them only before
they get SNATed for outgoing and after they get SNATed for incoming packets

This is my perception. Corrections welcome.

In other words, source addresses are changed when packets are about to get out, while destination addresses are changed when the packet just got in.


So, with a map rule, requests get natted at output, while responses get natted back at input. The situation is reversed with a rdr rule.

Note that you can change both the source address and the destination address of a single packet by mixing map and rdr!!




I want to allow the firewall to access port 80.
I want to block the LAN from accessing port 80 (use the firewall's cache on
port 3128 instead, which DOES need access to port 80).
How can I accomplish this through ipnat and ipf?


put in ipnat.conf

rdr INT_IFACE 0/32 -> FIREWALL_IP port 3128 tcp

and configure the cache for interception caching/transparent proxying

but make sure squid has been built with ipf support, otherwise it should be recompiled.


Alternatively, he can "force" users to explicitly use the FW as a proxy, and then just drop packets sent to port 80 from the LAN.
while it adds work on internal browsers, it may save some bits:
- browsers can reuse their connection with the proxy instead of starting a new one
- If so, ther'll be less states in ipf.
Of course, this is meaningless if the traffic level is not too high:)


Finally, let me remind that it is generally recommended to install the proxy on an internal box instead of the FW.

cheers,
mouss



Reply via email to