From: Mariusz Kruk <kruk@rdc.pl>
To: netfilter@lists.netfilter.org
Subject: Re: interface vs ip
Date: Tue, 27 Sep 2005 13:43:35 +0200 [thread overview]
Message-ID: <43393067.1010000@rdc.pl> (raw)
In-Reply-To: <BAY102-F8E3F9B17E34FC090707EEAE8A0@phx.gbl>
P theodorou napisa³(a):
> Im new to this therefore i need to clarify the followings
>
> 1)can i send or recieve packets from interface to ip and vise versa
>
> or only to interfaces and only to ips
>
> 2)
>
> I want to let icmp packets from 192.168.0.1(eth1) to 192.168.1.1(eth2)
>
> is it safer to declare
>
> iptables -A INPUT -i eth1 -o eth2 -J ACCEPT
>
> or
> iptables -A INPUT -s 192.168.0.1 -d 192.168.1.1
It depends on what you really want to do. If you want to control the
flow on the level of physical interfaces, you use -i and -o. If you want
to control on the level of IP addresses, you use -s and -d. But that you
already know. You can also combine both forms to, for example, filter
out traffic which comes from a physical interface, but from IP's not
belonging to this network. Or other similar things.
Anyway, it's up to you to decide which form is apropriate for what you
want to achieve.
Remember tho, that you can use -s and -d in any table/chain (correct me
if I'm wrong) regardless of whether it makes sense or not (already
NATted or not yet and so on), but physical interfaces are limited to
those tables/chains they make sense in. So you cannot use input
interface in POSTROUTING because netfilter simply doesn't know which
interface the packet came from.
next prev parent reply other threads:[~2005-09-27 11:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-27 11:32 interface vs ip P theodorou
2005-09-27 11:43 ` Mariusz Kruk [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-09-27 12:36 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=43393067.1010000@rdc.pl \
--to=kruk@rdc.pl \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox