All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edmundo Carmona <eantoranz@gmail.com>
To: netfilter@lists.netfilter.org
Subject: Re: Plz i need help.... or i ll be fired :(
Date: Tue, 27 Sep 2005 11:46:47 -0400	[thread overview]
Message-ID: <65aa6af905092708464042072d@mail.gmail.com> (raw)
In-Reply-To: <20050927154321.68035.qmail@web54710.mail.yahoo.com>

Are you gonna use the inner machine to "serve" the internet? say...
have a web server?

Use the rules I said before... plus these:

iptables -t nat -A PREROUTING -p tcp --dport 80 -d my-public-address
-j DNAT --to-destination the-inner-web-server

iptables -A FORWARD -i eth1 -o eth0 -p tcp --dport 80 -j ACCEPT

On 9/27/05, Alaios <alaios@yahoo.com> wrote:
> Hmm... i dont want to make the web work.... just to
> make my simple task to work
>
> --- Edmundo Carmona <eantoranz@gmail.com> wrote:
>
> > I would recommend to start over.
> >
> > Do this. On the "router" box do this:
> >
> > iptables -F
> > iptables -t nat -F
> >
> > iptables -P FORWARD DROP
> > iptables -P INPUT DROP
> >
> > iptables -A FORWARD -i eth0 -j ACCEPT
> > iptables -A FORWARD -m conntrack --ctstate
> > ESTABLISHED,RELATED -j ACCEPT
> >
> > iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
> >
> > echo 1 > /proc/sys/net/ipv4/ip_forward
> >
> > That should allow the "inner" machine to use the web
> > without a problem.
> >
> > On 9/27/05, Alaios <alaios@yahoo.com> wrote:
> > > Thx for your quick reply..... i have just tested
> > but
> > > it didnt work... I think that i cant explain what
> > i
> > > need or i am doing sth wrong..
> > > i have enabled the packets loging
> > > so executing dmesg prints the following
> > > IN=eth1 OUT= MAC=(the mac addresses)
> > > As u can see the OUT is null which means thats
> > perhaps
> > > the problem... What do u have in mind?
> > >
> > > --- "John A. Sullivan III"
> > > <jsullivan@opensourcedevel.com> wrote:
> > >
> > > > On Tue, 2005-09-27 at 11:14 -0400, John A.
> > Sullivan
> > > > III wrote:
> > > > > On Tue, 2005-09-27 at 07:57 -0700, Alaios
> > wrote:
> > > > > > Hi plz take a look at the following example
> > > > > >
> > > > > > The laptop has 2 ethernet interfaces
> > > > > > To eth1 comes traffic from src
> > 143.233.222.253
> > > > > > The eth0 has ip address 10.2.4.2 and it is
> > > > connected
> > > > > > back to back with eth1 of other pc with ip
> > > > address
> > > > > > 10.2.4.1
> > > > > > I want to forward the traffic with src
> > > > 143.233.222.253
> > > > > > to the 10.2.4.1 pc and if it works i will
> > redo
> > > > this
> > > > > > for a second pc so as to l send the traffic
> > to a
> > > > third
> > > > > > on.
> > > > > > Can u help me plz?
> > > > > >
> > > > > > I have tried this one
> > > > > > iptables -t nat -A PREROUTING -i eth1 -s
> > > > > > 143.233.222.253 -j DNAT --to-destination
> > > > 10.2.4.1
> > > > > > i have also set the
> > > > > > /proc/sys/net/ipv4/ip_forward to 1
> > > > > > but still i cant see any trafiic to eth0
> > > > interface (ip
> > > > > > 10.2.4.2)
> > > > > >
> > > > > >
> > > > > > I have also tested this one
> > > > > > iptables -t nat -A PREROUTING -p tcp -d
> > > > 143.233.222.77
> > > > > > (laptop eth1 card) --dport 22453 (i have
> > cheched
> > > > dst
> > > > > > port with tcpdump) 00 -j DNAT
> > --to-destination
> > > > > > 10.2.4.1
> > > > > > this still doesnt work
> > > > > > Every time i try to apply a new rule i use
> > first
> > > > > > the iptables -F
> > > > > > iptables -t nat -F command
> > > > > <snip>
> > > > >
> > > > > I'm a little confused about what you are
> > doing.  I
> > > > would normally refer
> > > > > you to Oskar Andreasson's excellent tutorial
> > at
> > > > >
> > > >
> > >
> >
> http://iptables-tutorial.frozentux.net/iptables-tutorial.html
> > > > or the
> > > > > training slides on the ISCS web site
> > > > (http://iscs.sourceforge.net) but,
> > > > > since it appears that you have an emergency,
> > here
> > > > goes:
> > > > >
> > > > > First, if the source is 143.233.222.253, you
> > would
> > > > not want to DNAT it.
> > > > > DNAT changes the destination.  Thus, your
> > second
> > > > attempt is the correct
> > > > > one.  You might want to lock the destination
> > port
> > > > - it's not likely to
> > > > > be a problem but, if it ever is, it will be
> > one of
> > > > those really hard to
> > > > > diagnose, sporadic problems:
> > > > > -j DNAT --to-destination 10.2.4.1:22453
> > > > >
> > > > > Second, this only takes care of the
> > addressing.
> > > > You must still allow
> > > > > the traffic in the FORWARD chain of the filter
> > > > table, e.g.,
> > > > >
> > > > > iptables -A FORWARD -d 10.2.4.1 -p 6 --dport
> > 22453
> > > > -j ACCEPT
> > > > >
> > > > > Hope this helps - John
> > > >
> > > > Oh, yes, you wanted to restrict the source
> > address.
> > > > Add that to your
> > > > filter table rule:
> > > > iptables -A FORWARD -s 143.233.222.253 -d
> > 10.2.4.1
> > > > -p 6 --dport 22453 -j
> > > > ACCEPT
> > > > --
> > > > John A. Sullivan III
> > > > Open Source Development Corporation
> > > > +1 207-985-7880
> > > > jsullivan@opensourcedevel.com
> > > >
> > > > If you would like to participate in the
> > development
> > > > of an open source
> > > > enterprise class network security management
> > system,
> > > > please visit
> > > > http://iscs.sourceforge.net
> > > >
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> > >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>


       reply	other threads:[~2005-09-27 15:46 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <65aa6af905092708427ab4dbb1@mail.gmail.com>
     [not found] ` <20050927154321.68035.qmail@web54710.mail.yahoo.com>
2005-09-27 15:46   ` Edmundo Carmona [this message]
2005-09-28 11:51 Plz i need help.... or i ll be fired :( Derick Anderson
  -- strict thread matches above, loose matches on Subject: below --
2005-09-27 21:04 Derick Anderson
2005-09-27 22:29 ` Nick Taylor
2005-09-27 23:32   ` Edmundo Carmona
2005-09-28  0:06     ` Seferovic Edvin
     [not found] <20050927154040.23330.qmail@web54709.mail.yahoo.com>
2005-09-27 16:19 ` John A. Sullivan III
2005-09-27 16:35   ` Alaios
2005-09-27 16:42     ` Edmundo Carmona
2005-09-27 16:52       ` Alaios
2005-09-27 16:59         ` Edmundo Carmona
2005-09-27 17:08           ` Edmundo Carmona
2005-09-27 17:15             ` John A. Sullivan III
2005-09-27 17:10         ` John A. Sullivan III
2005-09-27 17:14           ` Edmundo Carmona
     [not found]             ` <20050927202213.70086.qmail@web54701.mail.yahoo.com>
2005-09-27 20:46               ` Edmundo Carmona
2005-09-27 20:55                 ` John A. Sullivan III
2005-09-27 20:24           ` Alaios
2005-09-27 20:54             ` John A. Sullivan III
2005-09-27 14:57 Alaios
2005-09-27 15:03 ` Sp0oKeR
2005-09-27 15:14 ` John A. Sullivan III
2005-09-27 15:20   ` Alaios
2005-09-27 15:36     ` John A. Sullivan III
2005-09-27 15:22   ` John A. Sullivan III
2005-09-27 15:30     ` Alaios
2005-09-27 15:38       ` John A. Sullivan III
2005-09-27 15:18 ` Jörg Harmuth
2005-09-27 15:34   ` Alaios
2005-09-27 15:58     ` John A. Sullivan III
2005-09-27 15:38   ` Alaios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65aa6af905092708464042072d@mail.gmail.com \
    --to=eantoranz@gmail.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.