All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: dnatting
@ 2005-07-11 19:09 Gary W. Smith
  2005-07-12  7:34 ` dnatting Payal Rathod
  0 siblings, 1 reply; 26+ messages in thread
From: Gary W. Smith @ 2005-07-11 19:09 UTC (permalink / raw)
  To: Payal Rathod, Netfilter ML

Payal, 

You need to add a second simple entry:

Look at the entries below.  I'm mapping an entire IP but this would be
simple to just to a single port.  The second POSTROUTING line is what
made everything work for my typical firewalls.

# Completed on Mon Jul 11 10:58:27 2005
# Generated by iptables-save v1.2.11 on Mon Jul 11 10:58:27 2005
*nat
:PREROUTING ACCEPT [2547:176804]
:POSTROUTING ACCEPT [633:40896]
:OUTPUT ACCEPT [40:4518]
-A PREROUTING -d 81.45.25.50 -j DNAT --to-destination 10.94.16.50 

-A POSTROUTING -s 10.94.16.50 -o eth0 -j SNAT --to-source 81.45.25.50 
-A POSTROUTING -s 10.94.16.50 -d 10.94.16.0/255.255.255.0 -j SNAT
--to-source 81.45.25.50 

-A POSTROUTING -o eth0 -p ! ipv6-crypt -j SNAT --to-source 81.45.25.50
-A OUTPUT -d 81.45.25.50 -j DNAT --to-destination 10.94.16.50 
COMMIT
# Completed on Mon Jul 11 10:58:27 2005


> -----Original Message-----
> From: netfilter-bounces@lists.netfilter.org [mailto:netfilter-
> bounces@lists.netfilter.org] On Behalf Of Payal Rathod
> Sent: Monday, July 11, 2005 8:19 AM
> To: Netfilter ML
> Subject: dnatting
> 
> Hi,
> I have a rule on my friend's broadband connection to redirect traffic
> from outside to an internal machine like,
> 
> iptables -A PREROUTING -d 1.2.3.4 -p tcp -m tcp --dport 80 -j DNAT  \
> --to-destination 192.168.10.10:80
> 
> But she complained that people from inside the network cannot do
> http://1.2.3.4 in their browser and see the site. Is she correct?
> What is wrong with my rule because I can see the site from outside?
> 
> Thanks in advance.
> With warm regards,
> -Payal
> 
> 



^ permalink raw reply	[flat|nested] 26+ messages in thread
* RE: dnatting
@ 2005-07-13 16:28 Gary W. Smith
  2005-07-13 16:40 ` dnatting Steven M Campbell
  0 siblings, 1 reply; 26+ messages in thread
From: Gary W. Smith @ 2005-07-13 16:28 UTC (permalink / raw)
  To: Steven M Campbell; +Cc: Netfilter ML

I still don't agree with your statement.  For people who have single
IP's that need simple DNAT/SNAT'ing for the scenario provided (which was
a single port mapped) your process would be overkill and just as
cumbersome as adding an additional rule to iptables.

Gary

> -----Original Message-----
> From: netfilter-bounces@lists.netfilter.org [mailto:netfilter-
> bounces@lists.netfilter.org] On Behalf Of Steven M Campbell
> Sent: Wednesday, July 13, 2005 7:50 AM
> Cc: Netfilter ML
> Subject: Re: dnatting

> FWIW from me I would not accept the answer 'it works so it must be
> okay', that's been the downfall of soooo very many computer projects I
> cannot even begin to count them (a particularily bad attitude for
> programmers).    We'll certainly not argue (and we aren't), it's your
> network and your rules.  My advice is use split DNS from the
experience
> that I used to do the sort of thing that you are doing here and I
found
> out that it was a bad idea and only created trouble later and I don't
> like trouble, especially if it can be pinned on me!
> 



^ permalink raw reply	[flat|nested] 26+ messages in thread
* RE: dnatting
@ 2005-07-12 23:19 Gary W. Smith
  2005-07-13 10:39 ` dnatting Jan Engelhardt
  2005-07-13 14:50 ` dnatting Steven M Campbell
  0 siblings, 2 replies; 26+ messages in thread
From: Gary W. Smith @ 2005-07-12 23:19 UTC (permalink / raw)
  To: Steven M Campbell, Netfilter ML

I agree with everything that has been said BUT I must also interject.  A
lot small business and many home users who get one or two IP's usually
don't have a second DNS floating around.  For larger organizations I
would definitely use the split DNS.  We do that at a couple locations
when we can.

As for this case, I think it's completely acceptable.  

Since this does indeed work I think it should be documented as a viable
solution (which I think it's in the fine print on one of the docs that I
read before).



> -----Original Message-----
> From: netfilter-bounces@lists.netfilter.org [mailto:netfilter-
> bounces@lists.netfilter.org] On Behalf Of Steven M Campbell
> Sent: Tuesday, July 12, 2005 2:03 PM
> To: Netfilter ML
> Subject: Re: dnatting
> 
> 
> So, having put a few of these negative forth allow me to suggest an
> alternative.  Split DNS, with split dns you will create a name, for
> example theserver.myplace.com and have a split view of it, that is,
> folks on the inside will get the inside address and folks on the
outside
> will get the outside address.  No special routing is then required and
> you can use the server internally without any of the above issues.   I
> totally agree with Jason in suggesting that you investigate your name
> server rather than doing this bi-directional NAT.
> 
> 



^ permalink raw reply	[flat|nested] 26+ messages in thread
* RE: dnatting
@ 2005-07-12 14:05 Gary W. Smith
  0 siblings, 0 replies; 26+ messages in thread
From: Gary W. Smith @ 2005-07-12 14:05 UTC (permalink / raw)
  To: Payal Rathod; +Cc: Netfilter ML

Not sure.  Multiple people keep telling me this isn't necessary but I
found that if I don't use these entries then accesses from other local
machines on the same network become unreliable.  Adding the extra line
solves that problem.



> -----Original Message-----
> From: Payal Rathod [mailto:payal-netfilter@scriptkitchen.com]
> Sent: Tuesday, July 12, 2005 12:34 AM
> To: Gary W. Smith
> Cc: Netfilter ML
> Subject: Re: dnatting
> 
> On Mon, Jul 11, 2005 at 12:09:44PM -0700, Gary W. Smith wrote:
> > Payal,
> >
> > You need to add a second simple entry:
> [...]
> 
> Thanks this solved it. Thanks again.
> Now I am curious why Jason didn't suggest this.
> 
> With warm regards,
> -Payal
> 
> >
> > Look at the entries below.  I'm mapping an entire IP but this would
be
> > simple to just to a single port.  The second POSTROUTING line is
what
> > made everything work for my typical firewalls.
> >
> > # Completed on Mon Jul 11 10:58:27 2005
> > # Generated by iptables-save v1.2.11 on Mon Jul 11 10:58:27 2005
> > *nat
> > :PREROUTING ACCEPT [2547:176804]
> > :POSTROUTING ACCEPT [633:40896]
> > :OUTPUT ACCEPT [40:4518]
> > -A PREROUTING -d 81.45.25.50 -j DNAT --to-destination 10.94.16.50
> >
> > -A POSTROUTING -s 10.94.16.50 -o eth0 -j SNAT --to-source
81.45.25.50
> > -A POSTROUTING -s 10.94.16.50 -d 10.94.16.0/255.255.255.0 -j SNAT
> > --to-source 81.45.25.50
> >
> > -A POSTROUTING -o eth0 -p ! ipv6-crypt -j SNAT --to-source
81.45.25.50
> > -A OUTPUT -d 81.45.25.50 -j DNAT --to-destination 10.94.16.50
> > COMMIT
> > # Completed on Mon Jul 11 10:58:27 2005
> >
> >
> > > -----Original Message-----
> > > From: netfilter-bounces@lists.netfilter.org [mailto:netfilter-
> > > bounces@lists.netfilter.org] On Behalf Of Payal Rathod
> > > Sent: Monday, July 11, 2005 8:19 AM
> > > To: Netfilter ML
> > > Subject: dnatting
> > >
> > > Hi,
> > > I have a rule on my friend's broadband connection to redirect
traffic
> > > from outside to an internal machine like,
> > >
> > > iptables -A PREROUTING -d 1.2.3.4 -p tcp -m tcp --dport 80 -j DNAT
\
> > > --to-destination 192.168.10.10:80
> > >
> > > But she complained that people from inside the network cannot do
> > > http://1.2.3.4 in their browser and see the site. Is she correct?
> > > What is wrong with my rule because I can see the site from
outside?
> > >
> > > Thanks in advance.
> > > With warm regards,
> > > -Payal
> > >
> > >
> >


^ permalink raw reply	[flat|nested] 26+ messages in thread
* dnatting
@ 2005-07-11 15:18 Payal Rathod
  2005-07-11 15:20 ` dnatting Jan Engelhardt
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Payal Rathod @ 2005-07-11 15:18 UTC (permalink / raw)
  To: Netfilter ML

Hi,
I have a rule on my friend's broadband connection to redirect traffic 
from outside to an internal machine like,

iptables -A PREROUTING -d 1.2.3.4 -p tcp -m tcp --dport 80 -j DNAT  \
--to-destination 192.168.10.10:80

But she complained that people from inside the network cannot do
http://1.2.3.4 in their browser and see the site. Is she correct?
What is wrong with my rule because I can see the site from outside?

Thanks in advance.
With warm regards,
-Payal




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

end of thread, other threads:[~2005-07-14 15:49 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-11 19:09 dnatting Gary W. Smith
2005-07-12  7:34 ` dnatting Payal Rathod
2005-07-12 11:59   ` dnatting Jason Opperisano
2005-07-12 12:50     ` dnatting Payal Rathod
2005-07-12 21:03       ` dnatting Steven M Campbell
  -- strict thread matches above, loose matches on Subject: below --
2005-07-13 16:28 dnatting Gary W. Smith
2005-07-13 16:40 ` dnatting Steven M Campbell
2005-07-12 23:19 dnatting Gary W. Smith
2005-07-13 10:39 ` dnatting Jan Engelhardt
2005-07-13 21:19   ` dnatting R. DuFresne
2005-07-13 14:50 ` dnatting Steven M Campbell
2005-07-13 16:33   ` dnatting Donald Murray
2005-07-13 16:39     ` dnatting Steven M Campbell
2005-07-12 14:05 dnatting Gary W. Smith
2005-07-11 15:18 dnatting Payal Rathod
2005-07-11 15:20 ` dnatting Jan Engelhardt
2005-07-11 18:21   ` dnatting Payal Rathod
2005-07-11 18:38   ` dnatting /dev/rob0
2005-07-11 18:42     ` dnatting Jan Engelhardt
2005-07-11 15:24 ` dnatting Scott
2005-07-11 18:45 ` dnatting Jason Opperisano
2005-07-11 18:54   ` dnatting Jan Engelhardt
2005-07-13  3:21   ` dnatting Donald Murray
2005-07-13  4:48     ` dnatting Jason Opperisano
2005-07-14 15:42 ` dnatting curby .
2005-07-14 15:49   ` dnatting curby .

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.