From: aoliva <aoliva@it.uc3m.es>
To: "Gáspár Lajos" <swifty@freemail.hu>
Cc: netfilter@lists.netfilter.org
Subject: Re: How to find the chain which calls the match
Date: Mon, 09 Oct 2006 18:53:12 +0200 [thread overview]
Message-ID: <452A7E78.40709@it.uc3m.es> (raw)
In-Reply-To: <452A719B.9080209@freemail.hu>
Thank you very much for the answer but I think this is not what I was
trying. I mean how to know which is the calling chain from inside the
code of the matching function.
Thank you very much for the help.
Regards
Antonio de la Oliva
Gáspár Lajos wrote:
> aoliva írta:
>> Sorry if you receives multiple copies,
>>
>> Hi all, I am writing a match for iptables and I would like it to have
>> a different behaviour when it is called from different chains (e.g.
>> different behaviour when called from INPUT than OUTPUT) anyone knows
>> how to check in the match which is the chain that is calling it?
>>
>> Thanks in advance.
>>
>> Antonio de la Oliva
>>
>
> I DO NOT THINK THAT IT IS A GOOD IDEA OF USING IPTABLES THIS WAY,
> but anyway try this:
>
> iptables -A INPUT -j MARK --set-mark 1
> iptables -A INPUT -j mychain
>
> iptables -A OUTPUT -j MARK --set-mark 2
> iptables -A OUTPUT -j mychain
>
> iptables -A FORWARD -j MARK --set-mark 3
> iptables -A FORWARD -j mychain
>
> iptables -A mybehaviour1 -j DROP
>
> iptables -A mychain -j mybehaviour1 -m mark --mark 1 //INPUT
> iptables -A mychain -j mybehaviour2 -m mark --mark 2 //OUTPUT
> iptables -A mychain -j mybehaviour3 -m mark --mark 3 //FORWARD
>
>
>
> Swifty
>
next prev parent reply other threads:[~2006-10-09 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-09 14:51 How to find out packet latency? Mohammad Farooq
2006-10-09 15:13 ` How to find the chain which calls the match aoliva
2006-10-09 15:20 ` aoliva
2006-10-09 15:58 ` Gáspár Lajos
2006-10-09 16:53 ` aoliva [this message]
2006-10-10 9:24 ` 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=452A7E78.40709@it.uc3m.es \
--to=aoliva@it.uc3m.es \
--cc=netfilter@lists.netfilter.org \
--cc=swifty@freemail.hu \
/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