I would like to know, is it possible to route port 80 traffic to an external machine with original src-address. I am talking about an external proxy / cache machine, mikrotik routing port 80 traffic with original src-address to an external machine.
Chupaka, are you referring to internal proxy servers (on the LAN) or to only external ones?
I don’t see how any http traffic would reach the external proxy server is masquerading is turned off. Unless I need a rule like andreacoppini mentioned. But I can only see this making a difference if it’s internal.
If your proxy server is not internal, then how will it be able to send the replies back to the internal clients?
the proxy server needs to have a route into your internal network. This can be done either by masquerading to the router’s public IP (but then all requests will be coming from that single IP) or by setting a route on the external proxy back to your internal network.
You could also do one-to-one NAT, although that would defeat the scope of having a masquerade rule in the first place
if you are using external proxy, you cannot send packets with original client’s IP address unless you are using public IP range. if you are using public IP range, you do not need masquerade =)
So if I was trying to automatically redirect port 80 traffic on my LAN to another internal proxy server, I would add this rule BEFORE my normal masquerade rule?
src-address=your internal LAN
dst-protocol=tcp
dst-port=80
action=accept
This would effectively ‘accept’ all traffic bound for port 80 and would then NOT change the source IP address and would then be redirected to my internal proxy by my second dst-nat rule?
When the proxy in turn redirects the request to the internet this traffic will be caught by the normal src-nat masquerade rule?