* Transitioning from one DNAT gateway to another
@ 2003-02-21 0:42 Joe Haynes
2003-02-21 5:08 ` Joe Haynes
2003-02-21 6:58 ` Joel Newkirk
0 siblings, 2 replies; 4+ messages in thread
From: Joe Haynes @ 2003-02-21 0:42 UTC (permalink / raw)
To: netfilter; +Cc: jhaynes
Hello to the list.
I apologize if this subject has been covered
elsewhere, but I have yet to locate instructions
on how to to this (redirections to appropriate
sites would be much appreciated).
Our network is currently attached to the internet via
a wavelan link (with a dedicated IP). We are transitioning
over to a T-1 line that has a new IP address.
What we would like to do is run a gateway off each single
external address and redirect specific ports to a single
internal server (we want to run both while we wait for
DNS updates).
Currently, we redirect port 80 on our external IP to an internal
webserver (also on port 80) using this line:
$IPT -t nat -A PREROUTING -i $INTERNET_DEV -d $INTERNET_IP -p tcp --dport
80 -d $INTERNET_IP -j DNAT --to 192.168.1.5
We'd like to do the same thing off the new gateway that's
linked to the T-1 line.
The problem I've run into is the responses that have come
through the new gateway end up getting sent back out
the old gateway.
Is there a way to redirect packets to the internal server using
PREROUTE and then change the source addresses using POSTROUTE so
the responses from the internal server come back through
the correct gateway?
Thank you,
Joe Haynes
Helena Montana
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Transitioning from one DNAT gateway to another
2003-02-21 0:42 Transitioning from one DNAT gateway to another Joe Haynes
@ 2003-02-21 5:08 ` Joe Haynes
2003-02-21 7:01 ` Joel Newkirk
2003-02-21 6:58 ` Joel Newkirk
1 sibling, 1 reply; 4+ messages in thread
From: Joe Haynes @ 2003-02-21 5:08 UTC (permalink / raw)
To: netfilter
I think I answered my own question. I was able to SNAT
on connections that were directed toward an internal
server using this command:
iptables -t nat -A POSTROUTING -o $DMZ_DEV -j SNAT --to $DMZ_IP
So, when a packet for port 80 comes into the firewall,
it is redirected toward a server in the DMZ. Then, SNAT
is used so the responses back from the web server come back
out through the current gateway instead of the gateway
used by the DMZ server.
I apologize for finding out on my own what should have been
obvious from the start.
-jph
Joe Haynes said:
> Hello to the list.
>
> I apologize if this subject has been covered
> elsewhere, but I have yet to locate instructions
> on how to to this (redirections to appropriate
> sites would be much appreciated).
>
> Our network is currently attached to the internet via
> a wavelan link (with a dedicated IP). We are transitioning
> over to a T-1 line that has a new IP address.
>
> What we would like to do is run a gateway off each single
> external address and redirect specific ports to a single
> internal server (we want to run both while we wait for
> DNS updates).
>
> Currently, we redirect port 80 on our external IP to an internal
> webserver (also on port 80) using this line:
> $IPT -t nat -A PREROUTING -i $INTERNET_DEV -d $INTERNET_IP -p tcp
> --dport 80 -d $INTERNET_IP -j DNAT --to 192.168.1.5
>
> We'd like to do the same thing off the new gateway that's
> linked to the T-1 line.
>
> The problem I've run into is the responses that have come
> through the new gateway end up getting sent back out
> the old gateway.
>
> Is there a way to redirect packets to the internal server using
> PREROUTE and then change the source addresses using POSTROUTE so
> the responses from the internal server come back through
> the correct gateway?
>
> Thank you,
>
> Joe Haynes
> Helena Montana
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Transitioning from one DNAT gateway to another
2003-02-21 0:42 Transitioning from one DNAT gateway to another Joe Haynes
2003-02-21 5:08 ` Joe Haynes
@ 2003-02-21 6:58 ` Joel Newkirk
1 sibling, 0 replies; 4+ messages in thread
From: Joel Newkirk @ 2003-02-21 6:58 UTC (permalink / raw)
To: netfilter; +Cc: jhaynes
On Thursday 20 February 2003 07:42 pm, Joe Haynes wrote:
> Hello to the list.
>
> I apologize if this subject has been covered
> elsewhere, but I have yet to locate instructions
> on how to to this (redirections to appropriate
> sites would be much appreciated).
>
> Our network is currently attached to the internet via
> a wavelan link (with a dedicated IP). We are transitioning
> over to a T-1 line that has a new IP address.
>
> What we would like to do is run a gateway off each single
> external address and redirect specific ports to a single
> internal server (we want to run both while we wait for
> DNS updates).
>
> Currently, we redirect port 80 on our external IP to an internal
> webserver (also on port 80) using this line:
> $IPT -t nat -A PREROUTING -i $INTERNET_DEV -d $INTERNET_IP -p tcp
> --dport 80 -d $INTERNET_IP -j DNAT --to 192.168.1.5
>
> We'd like to do the same thing off the new gateway that's
> linked to the T-1 line.
>
> The problem I've run into is the responses that have come
> through the new gateway end up getting sent back out
> the old gateway.
>
> Is there a way to redirect packets to the internal server using
> PREROUTE and then change the source addresses using POSTROUTE so
> the responses from the internal server come back through
> the correct gateway?
You should do this in routing. Read up at
http://lartc.org/howto/lartc.rpdb.multiple-links.html#AEN266 which is
the specific part of the Linux Advanced Routing and Traffic Control
howto that deals with "Split Access", where you have incoming requests
on two different links that have to be answered back out the same link.
Essentially you set up two default routes each in it's own table, and set
routing rules that route traffic with a particular source IP to use the
appropriate routing table. Traffic inbound gets DNATted to the server,
and when it returns gets unDNATted to present source IP matching the
original destination IP of the request, then routing takes over and
sends it out the appropriate link.
j
> Thank you,
>
> Joe Haynes
> Helena Montana
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Transitioning from one DNAT gateway to another
2003-02-21 5:08 ` Joe Haynes
@ 2003-02-21 7:01 ` Joel Newkirk
0 siblings, 0 replies; 4+ messages in thread
From: Joel Newkirk @ 2003-02-21 7:01 UTC (permalink / raw)
To: jhaynes, netfilter
Sorry, I missed that the gateways were yours, I was thinking that you
were referring to the gateways at the provider and that you had a
single-point connection locally to both.
j
On Friday 21 February 2003 12:08 am, Joe Haynes wrote:
> I think I answered my own question. I was able to SNAT
> on connections that were directed toward an internal
> server using this command:
>
> iptables -t nat -A POSTROUTING -o $DMZ_DEV -j SNAT --to $DMZ_IP
>
> So, when a packet for port 80 comes into the firewall,
> it is redirected toward a server in the DMZ. Then, SNAT
> is used so the responses back from the web server come back
> out through the current gateway instead of the gateway
> used by the DMZ server.
>
> I apologize for finding out on my own what should have been
> obvious from the start.
>
> -jph
>
> Joe Haynes said:
> > Hello to the list.
> >
> > I apologize if this subject has been covered
> > elsewhere, but I have yet to locate instructions
> > on how to to this (redirections to appropriate
> > sites would be much appreciated).
> >
> > Our network is currently attached to the internet via
> > a wavelan link (with a dedicated IP). We are transitioning
> > over to a T-1 line that has a new IP address.
> >
> > What we would like to do is run a gateway off each single
> > external address and redirect specific ports to a single
> > internal server (we want to run both while we wait for
> > DNS updates).
> >
> > Currently, we redirect port 80 on our external IP to an internal
> > webserver (also on port 80) using this line:
> > $IPT -t nat -A PREROUTING -i $INTERNET_DEV -d $INTERNET_IP -p tcp
> > --dport 80 -d $INTERNET_IP -j DNAT --to 192.168.1.5
> >
> > We'd like to do the same thing off the new gateway that's
> > linked to the T-1 line.
> >
> > The problem I've run into is the responses that have come
> > through the new gateway end up getting sent back out
> > the old gateway.
> >
> > Is there a way to redirect packets to the internal server using
> > PREROUTE and then change the source addresses using POSTROUTE so
> > the responses from the internal server come back through
> > the correct gateway?
> >
> > Thank you,
> >
> > Joe Haynes
> > Helena Montana
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-02-21 7:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-21 0:42 Transitioning from one DNAT gateway to another Joe Haynes
2003-02-21 5:08 ` Joe Haynes
2003-02-21 7:01 ` Joel Newkirk
2003-02-21 6:58 ` Joel Newkirk
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.