From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: : Redirect in intranet using DNAT?
Date: Sun, 16 Nov 2003 12:14:51 +0000 [thread overview]
Message-ID: <200311161214.hAGCEsj21388@agate.rockstone.co.uk> (raw)
In-Reply-To: <200311161301.40525.m_feldmann@t-online.de>
On Sunday 16 November 2003 12:01 pm, Michael Feldmann wrote:
> Am Sonntag, 16. November 2003 12:22 schrieb Antony Stone:
> >
> > I would suggest two better solutions to your requirement are:
> >
> > 1. Use DNS and access the server/s by name instead of IP - then you can
> > make both names resolve to the same address, or different addresses, or
> > change the addresses, as you shuffle your network around, and client
> > machines don't need to know any different.
> >
> > 2. Add the old address to the new server, so one machine has both
> > 192.168.0.1 and 192.168.0.5 on eth0 and will respond to requests sent to
> > either address.
>
> If I see this correctly, would solution No 1 not imply that all client
> machines use names instead of IPs? I am not too sure about that.
Yes they would, and I personally think that is the better way to do things,
because it allows you to move services from one machine to another very
easily without disrupting your network configuration.
> So, I think I will stick no No 2. However, as there are several services on
> Server 192.168.0.1, which I cannot move all at once to 192.168.0.5, I guess
> I will have to add _both_ addresses to _both_ servers and enable/disable
> the resp. services in such a way that only one client answers. Could this
> be a possible solution?
No way! This would really screw up your network. Never put one IP address
on more than one machine at the same time.
You need to understand how IP, TCP and HTTP work together.
When a client sends an HTTP request to a server, a packet is sent from the
client's IP address to the server's IP address - if that address doesn't
exist, the connection fails. Once the packet arrives at the server's IP
address, it attempts to connect to a service running on TCP port 80 - if that
service is not responding, the connection fails. Once the connection has
been made to TCP port 80, the web server looks at the HTTP request and
decides whether it can fulfil it - if the request is for something the server
can't answer, the connection fails.
At no point in any of the above steps is there a "if that didn't work, try
something else instead" option.
Basically, if you are moving your web server (but not other services) from
one machine to another on your network, you should change the address the
clients connect to for that service so they find the new machine. I believe
the easiest way to do this is for the clients to use server names, and you
just make one change in DNS. If you don't want to use DNS, then change the
server IP address on each client that needs to connect to it.
Antony.
--
I love deadlines. I love the whooshing noise they make as they go by.
- Douglas Noel Adams
prev parent reply other threads:[~2003-11-16 12:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-16 10:43 Redirect in intranet using DNAT? Michael Feldmann
2003-11-16 11:22 ` Antony Stone
[not found] ` <200311161301.40525.m_feldmann@t-online.de>
2003-11-16 12:14 ` Antony Stone [this message]
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=200311161214.hAGCEsj21388@agate.rockstone.co.uk \
--to=antony@soft-solutions.co.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox