All of lore.kernel.org
 help / color / mirror / Atom feed
* Send local traffic to a different server.
@ 2004-06-23 14:08 Brett Simpson
  2004-06-23 13:33 ` Antony Stone
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Brett Simpson @ 2004-06-23 14:08 UTC (permalink / raw)
  To: netfilter

I've tried a number of different PREROUTING and POSTROUTING rules and can't seem to make this work.

I have a system with a single nic (eth0). While I'm on the system via a shell I would like to connect to 127.0.0.1:6000 and get seemlessly translated to 207.156.7.15:80.

I tried the following without success:

iptables -t nat -A PREROUTING  -p tcp -d 127.0.0.1   -i lo --dport 6000 -j DNAT--to-destination 207.156.7.15:80
iptables -t nat -A POSTROUTING -p tcp -d 207.156.7.15 -o eth0 --dport 80 -j SNAT --to-source 127.0.0.1



^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: Send local traffic to a different server.
@ 2004-06-23 15:26 Aldo Lagana
  2004-06-24  8:46 ` Antony Stone
  0 siblings, 1 reply; 15+ messages in thread
From: Aldo Lagana @ 2004-06-23 15:26 UTC (permalink / raw)
  To: simpsonb, netfilter

am i wrong or can you not send traffic to another server simply with netfilter/iptables rules?  Does not that require iproute2?  In other words don't all of the rules assume that the NAT addresses are bound to local interfaces? 

aldo

-----Original Message-----
From: Brett Simpson [mailto:simpsonb@hillsboroughcounty.org]
Sent: Wednesday, June 23, 2004 11:12 AM
To: netfilter@lists.netfilter.org
Subject: Re: Send local traffic to a different server.


On Wed, 2004-06-23 at 10:00, Antony Stone wrote:
> On Wednesday 23 June 2004 3:33 pm, Brett Simpson wrote:
> 
> > On Wed, 2004-06-23 at 09:33, Antony Stone wrote:
> > > On Wednesday 23 June 2004 3:08 pm, Brett Simpson wrote:
> > > > I've tried a number of different PREROUTING and POSTROUTING rules and
> > > > can't seem to make this work.
> > > >
> > > > I have a system with a single nic (eth0). While I'm on the system via a
> > > > shell I would like to connect to 127.0.0.1:6000 and get seemlessly
> > > > translated to 207.156.7.15:80.
> > > >
> My rule will send packets to 207.156.7.15 with a source address of 127.0.0.1
> 
> Not surprisingly, you don't get anything back...
> 
> Try:
> 
> iptables -A OUTPUT -t nat -p tcp --dport 6000 -d 127.0.0.1 -j DNAT --to 
> 207.156.7.15:80
> iptables -A POSTROUTING -t nat -p tcp --dport 80 -d 207.156.7.15 -s 127.0.0.1 
> -j SNAT --to a.b.c.d
> 
> Where a.b.c.d is the routable address of your machine, to which reply packets 
> can successfully return.

Still no go. My machine is 172.27.228.145. I'm using lynx for the
browser on my machine.

iptables -A OUTPUT -t nat -p tcp --dport 6000 -d 127.0.0.1 -j DNAT --to
207.156.7.15:80
iptables -A POSTROUTING -t nat -p tcp --dport 80 -d 207.156.7.15 -s
127.0.0.1 -j SNAT --to 172.27.228.145

Thanks,
Brett






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

end of thread, other threads:[~2004-06-24 18:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-23 14:08 Send local traffic to a different server Brett Simpson
2004-06-23 13:33 ` Antony Stone
2004-06-23 14:33   ` Brett Simpson
2004-06-23 14:00     ` Antony Stone
2004-06-23 15:12       ` Brett Simpson
2004-06-23 14:24         ` Antony Stone
2004-06-23 16:41           ` Brett Simpson
2004-06-24 18:27           ` Brett Simpson
2004-06-23 14:20 ` John A. Sullivan III
2004-06-23 14:58 ` Antony Stone
2004-06-23 16:34   ` Brett Simpson
2004-06-23 15:39 ` B. McAninch
2004-06-23 16:53   ` Brett Simpson
  -- strict thread matches above, loose matches on Subject: below --
2004-06-23 15:26 Aldo Lagana
2004-06-24  8:46 ` Antony Stone

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.