All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Oğuz Yarımtepe" <comp.ogz@gmail.com>
To: netfilter@vger.kernel.org
Subject: prerouting and route
Date: Sat, 29 Sep 2007 23:23:12 +0300	[thread overview]
Message-ID: <200709292323.12968.comp.ogz@gmail.com> (raw)

Hi,

I gave some points that i couldnt visualize. 
First question is related with the route command. Lets say i defined a local 
route as,

route add 10.2.0.0 netmask 255.255.255.0 gw 10.2.0.1 dev eth1

and while i am configuring iptables i wrote some rules:

# delete all existing rules
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X

# set default policies
iptables -P INPUT DROP
iptables -P FORWARD DROP

iptables -t nat -A PREROUTING -i eth0 -p ALL -d 10.2.0.0/24 -j DNAT --to 
10.2.0.1

At this point i ask myself whether i need this rule, because i had already 
defined a route while configuring interfaces. So is there a relation between 
route definitions and prerouting, is it unnecessary to define a local route 
and try to the same thing with iptables?

Second, i have a rule as,

iptables -t nat -A PREROUTING -i eth1 -p ALL  -j DNAT --to 192.168.1.4

192.168.1.4 is the ip of eth0 which is plugged to a gateway with the ip 
192.168.1.3. If i send a package from eth1 to lets say 192.168.1.10, its 
destination address is replaced with 192.168.1.4. After this point, will it 
continue to 192.168.1.3? If yes how?

Thanx.
 
-- 
Oğuz Yarımtepe
http://www.yarimtepe.com/en

             reply	other threads:[~2007-09-29 20:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-29 20:23 Oğuz Yarımtepe [this message]
2007-10-02 11:29 ` prerouting and route Pascal Hambourg

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=200709292323.12968.comp.ogz@gmail.com \
    --to=comp.ogz@gmail.com \
    --cc=netfilter@vger.kernel.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.