All of lore.kernel.org
 help / color / mirror / Atom feed
* Redirecting packets based on source+destination ip's
@ 2006-04-09  4:34 clan
  2006-04-10 14:04 ` Aleksander
  0 siblings, 1 reply; 2+ messages in thread
From: clan @ 2006-04-09  4:34 UTC (permalink / raw)
  To: netfilter

I have been trying to find a way with iptables to redirect a packet
created on a server to be sent to 1.1.1.1 instead of 2.2.2.2 but only if
the packet is coming from 3.3.3.3.

With the help of linuxquestions.org I have gotten to the point of using
DNAT where the packet redirects, but the determining factor is destination
address.  Not source.  Since this is a shared server(each user has a
different ip) it would be nice to only redirect certain ip's, but leave
the others alone.

In case I didn't make it understandable what I want to do here is what I
am trying to accomplish, I rent a server for running a battlefield 2
server.  This is of course shared, so there are other battlefield
instances running next to mine albeit on different ip's.  I want to run a
stats program that requires redirecting bf2web.gamespy.com to
212.77.171.103 so that when my server sends out stats they go to ABR
instead of EA.  The usual way of doing this is with a hosts file, but that
effects all ip's on the server, and causes some pretty big problems with
the other servers on the machine.

Here is what the guy at linuxquestions.org gave me to work with
iptables -t nat -A PREROUTING -t nat -p tcp -d 1.1.1.1 --dport 80 -j DNAT
--to 2.2.2.2

To make it work I had to change PREROUTING to OUTPUT.  So is there a way
for that to only effect certain source ip's?

Thank you so much,  Fourthbean



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-10 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-09  4:34 Redirecting packets based on source+destination ip's clan
2006-04-10 14:04 ` Aleksander

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.