Linux Netfilter discussions
 help / color / mirror / Atom feed
* Port Forwarding .
@ 2008-07-07 21:49 Charles Romestant
  2008-07-07 22:10 ` Grant Taylor
  0 siblings, 1 reply; 14+ messages in thread
From: Charles Romestant @ 2008-07-07 21:49 UTC (permalink / raw)
  To: <netfilter@vger.kernel.org>

Hello to all, I write here after having tried to find the solution to
this for about 3 days and still no luck.

Let me explain the setup

                                                         eth0           eth1
10.0.1.200                                  10.0.1.192   10.0.10.2
                                       10.0.10.1
        |______________________________|__________________________________|
     A                                                             B
                                                                C

so 3 boxes, A B and C

on C there is a web server, running on port 80, I want to be able to
access it through B from A.

So basically the ruleset should be on B if its port 80, forward to port 80 on C.

have tried these :

iptables -t nat -A PREROUTING -p tcp -d 10.0.1.200 --dport 80 -j DNAT
--to 10.0.10.1:80
iptables -t nat -A POSTROUTING -d 10.0.10.1 -j MASQUERADE


no luck, using iptables -t nat -nvL i saw that the first rule did
match since the number of packets went up, but i still can t see the
web server.


I also tried this :
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT
--to-destination 10.0.10.1:80
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT


did not work.

Any helo would be appreciated, thank you in advance,

Charles.

BTW : a little more bg info, this is a box in which i m implementing a
Single Packet authentication sistem, so the INPUT table s default
policy is drop, also i have a usercreated table called SPA which is
called upon as the first rule of INPUT.

for the sake of the forwarding experiment i flushed all tables and put
the policy on accept, but bear in mind that i will need to use that
type of restrictive ruleset.

thank you.
-- 
Charz

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

end of thread, other threads:[~2008-07-08 20:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-07 21:49 Port Forwarding Charles Romestant
2008-07-07 22:10 ` Grant Taylor
2008-07-07 22:32   ` Charles Romestant
2008-07-07 22:33     ` Charles Romestant
2008-07-07 23:10       ` Charles Romestant
2008-07-07 23:58         ` Charles Romestant
2008-07-08  2:23           ` Grant Taylor
2008-07-08 19:20             ` Charles Romestant
2008-07-08 19:37               ` Grant Taylor
2008-07-08 19:40                 ` Charles Romestant
2008-07-08 19:50                   ` Grant Taylor
2008-07-08 19:54                     ` Charles Romestant
2008-07-08 20:11                       ` Charles Romestant
2008-07-08 20:21                         ` Grant Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox