From: Pandu Poluan <pandu@poluan.info>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] HA-Proxy or iptables?
Date: Thu, 29 Aug 2013 21:14:25 +0700 [thread overview]
Message-ID: <CAA2qdGU3rc8gMgXF_g3KQSsvyEdUupZwJtY36rns=hGFTXoScQ@mail.gmail.com> (raw)
In-Reply-To: <521F427D.5060901@thegeezer.net>
[-- Attachment #1: Type: text/plain, Size: 2647 bytes --]
On Aug 29, 2013 7:46 PM, "thegeezer" <thegeezer@thegeezer.net> wrote:
>
> On 08/29/2013 01:12 PM, Randy Barlow wrote:
> > Honestly, I think the best solution is to switch the company to using
domain names to access these resources. This makes it much easier to
silently introduce things like load balancers later on if you ever need to
scale. It's also much easier to communicate to new users how to find this
resource. Once you migrate to IPv6 it becomes a very long address to tell
people as well.
> >
> > To answer your specific question, I would just do it with iptables if
you must continue accessing it by IP address. I will point out that the
service on the new IP address now has doubled its chances of going out of
service, because it depends on both machines running, even though the first
has nothing to do with it. Also, doing this with firewall rules isn't very
nice from a systems management perspective for the future, as it's not very
obvious what's going on with some server rewriting packets for another one.
If someone sees that in two years, are they going to know what to do? What
if they want to take server 1 down, and forget that it also disrupts 2?
Using DNS is much cleaner for these reasons.
> With iptables this could be tricky if everything is in the same LAN
> subnet, you will need to ensure you have both DNAT and SNAT otherwise
> you will have:
> PC ---> serverA:3000 ---DNAT----> serverB
> serverB ---replies---> PC
> PC ignores packet "i wasn't talking to you, i was talking to serverA"
>
I do have some experience with double NAT-ting, but thanks for the reminder
anyways :-)
> Also bear in mind that from serverB's perspective, all connections on
> port 3000 will appear to come from serverA. I know that a VT based
> terminal server can set up users based on their originating IP, which
> would previously have been a good detector of which terminal they are
> connecting from.
>
Luckily, to the best of my knowledge, the apps do not make such
distinction, so I can get away with such sleight of hand...
> Rather than using iptables on serverA, you may like to consider EBtables
> or IPtables on a server that sits in front of both serverA and serverB.
> this would act as a bridge, and rewrite packets for serverA on port 3000
> to go to serverB on port 3000
> or
> it could act as a router for NAT (iptables) if you change the ip subnet
> of serverA and serverB, and make the NAT box have the original IP of
serverA
> this would allow connections by IP to be tracked
>
Interesting... I'll consider that. Although not strictly needed, tracking
by IP will certainly be helpful.
Thank you for the tip!
[-- Attachment #2: Type: text/html, Size: 3108 bytes --]
next prev parent reply other threads:[~2013-08-29 14:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 12:12 [gentoo-user] HA-Proxy or iptables? Randy Barlow
2013-08-29 12:45 ` thegeezer
2013-08-29 14:14 ` Pandu Poluan [this message]
2013-08-29 14:11 ` Pandu Poluan
-- strict thread matches above, loose matches on Subject: below --
2013-08-29 7:54 Pandu Poluan
2013-08-30 15:54 ` Kerin Millar
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='CAA2qdGU3rc8gMgXF_g3KQSsvyEdUupZwJtY36rns=hGFTXoScQ@mail.gmail.com' \
--to=pandu@poluan.info \
--cc=gentoo-user@lists.gentoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox