* Forwarding to another ip:port based on source
@ 2005-10-24 6:29 Tony Spencer
2005-10-25 10:07 ` Jörg Harmuth
0 siblings, 1 reply; 2+ messages in thread
From: Tony Spencer @ 2005-10-24 6:29 UTC (permalink / raw)
To: netfilter
Hi
Is it possible to have an IPTables rule that will forward any packets on a
given port to another ip address and port based on where the packet came
from?
For example if I have a server on IP 192.168.0.1 and any requests into that
server on port 80 from a source IP of 192.168.1.10 and want to force those
packets to our squid server 192.168.0.11 on port 3128. But only for the IP
192.168.1.10, all other requests to the server on port 80 should stay local?
Thanks
Tony
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Forwarding to another ip:port based on source
2005-10-24 6:29 Forwarding to another ip:port based on source Tony Spencer
@ 2005-10-25 10:07 ` Jörg Harmuth
0 siblings, 0 replies; 2+ messages in thread
From: Jörg Harmuth @ 2005-10-25 10:07 UTC (permalink / raw)
To: netfilter
Tony Spencer wrote:
> Hi
>
> Is it possible to have an IPTables rule that will forward any packets on a
> given port to another ip address and port based on where the packet came
> from?
Yes
> For example if I have a server on IP 192.168.0.1 and any requests into that
> server on port 80 from a source IP of 192.168.1.10 and want to force those
> packets to our squid server 192.168.0.11 on port 3128. But only for the IP
> 192.168.1.10, all other requests to the server on port 80 should stay local?
Use -s option like this:
-t nat -A PREROUTING -p tcp --dort 80 -s 192.168.1.10 \
-j DNAT --to 192.168.0.11:3128
Probably you will have to SNAT too. Watch with tcpdump.
HTH,
Joerg
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-10-25 10:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-24 6:29 Forwarding to another ip:port based on source Tony Spencer
2005-10-25 10:07 ` Jörg Harmuth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.