From: "John A. Sullivan III" <jsullivan@opensourcedevel.com>
To: Alaios <alaios@yahoo.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Plz i need help.... or i ll be fired :(
Date: Tue, 27 Sep 2005 11:36:22 -0400 [thread overview]
Message-ID: <1127835382.2652.23.camel@localhost> (raw)
In-Reply-To: <20050927152018.17772.qmail@web54709.mail.yahoo.com>
You are correct to DNAT. You are incorrect to attempt to DNAT based
upon source address. One DNATs the destination address. Of course, I
may have misunderstood what you are trying to do.
On Tue, 2005-09-27 at 08:20 -0700, Alaios wrote:
> Why do u say i should not use dnat? U also sais that
> my second example is correct.. havent u see that uses
> also dnat.. I think i should use dnat because i want
> to alter the ip packet so as to be forwarded to the
> other network.. Isn't that correct?
>
> --- "John A. Sullivan III"
> <jsullivan@opensourcedevel.com> 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
> > --
> > 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
>
--
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan@opensourcedevel.com
Financially sustainable open source development
http://www.opensourcedevel.com
next prev parent reply other threads:[~2005-09-27 15:36 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-27 14:57 Plz i need help.... or i ll be fired :( 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 [this message]
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
[not found] <65aa6af905092708427ab4dbb1@mail.gmail.com>
[not found] ` <20050927154321.68035.qmail@web54710.mail.yahoo.com>
2005-09-27 15:46 ` Edmundo Carmona
[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
-- 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
2005-09-28 11:51 Derick Anderson
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=1127835382.2652.23.camel@localhost \
--to=jsullivan@opensourcedevel.com \
--cc=alaios@yahoo.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.