From: clan@dominationtime.com
To: netfilter@lists.netfilter.org
Subject: Redirecting packets based on source+destination ip's
Date: Sat, 8 Apr 2006 21:34:37 -0700 (PDT) [thread overview]
Message-ID: <4840.68.94.225.167.1144557277.squirrel@webmail.dominationtime.com> (raw)
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
next reply other threads:[~2006-04-09 4:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-09 4:34 clan [this message]
2006-04-10 14:04 ` Redirecting packets based on source+destination ip's Aleksander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4840.68.94.225.167.1144557277.squirrel@webmail.dominationtime.com \
--to=clan@dominationtime.com \
--cc=netfilter@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.