All of lore.kernel.org
 help / color / mirror / Atom feed
* newbie: forward rule to itself
@ 2010-10-27 19:02 Mauricio Tavares
  2010-10-27 19:17 ` Jan Engelhardt
  2010-10-28  8:01 ` Pascal Hambourg
  0 siblings, 2 replies; 6+ messages in thread
From: Mauricio Tavares @ 2010-10-27 19:02 UTC (permalink / raw)
  To: netfilter

	Let's say I have server1 with two ports, eth0 and eth0, and server2 
whose eth0 port is connected to server1's eth1. And let's say the subnet 
between them is 192.168.1.0/24 while the one server1's eth0 is connected 
to is 192.168.4.0/24.

I have the following rules to forward port 6969 coming on eth0 on 
server1 to port 6969 on server2's eth0:

iptables -A PREROUTING -t nat -p tcp --dport 6969 -j DNAT --to 
192.168.1.server2:6969
iptables -A INPUT -d 192.168.4.server1 -p tcp -m tcp -m state --state 
NEW --dport 6969 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Any machine in 192.168.4.0/24 seems to be able to get to server2 by 
using 192.168.1.server1:6969. But, if I try to connect to 
192.168.1.server1:6969 on server1 itself, I will not be forwarded to 
server2. What am I missing here?

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

end of thread, other threads:[~2010-10-28  8:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 19:02 newbie: forward rule to itself Mauricio Tavares
2010-10-27 19:17 ` Jan Engelhardt
2010-10-27 19:47   ` Mauricio Tavares
2010-10-27 20:00     ` Jan Engelhardt
2010-10-27 21:03       ` Mauricio Tavares
2010-10-28  8:01 ` Pascal Hambourg

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.