All of lore.kernel.org
 help / color / mirror / Atom feed
* How are ct helper to be configured with NFT ?
@ 2014-11-26 18:08 leroy christophe
  2014-12-05  7:27 ` leroy christophe
  0 siblings, 1 reply; 10+ messages in thread
From: leroy christophe @ 2014-11-26 18:08 UTC (permalink / raw)
  To: netfilter, Pablo Neira Ayuso

I need to do something equivalent to

     iptables -t raw -A OUTPUT -p udp -d 192.168.2.1 --dport tftp -j CT 
--helper tftp


I tried the following

nft add rule filter output ct helper "tftp" udp dport tftp

But it looks like it doesn't work, I still get.

[ 1113.706274] nf_conntrack: automatic helper assignment is deprecated 
and it will be removed soon. Use the iptables CT target to attach 
helpers instead.

What is the correct syntaxe for that ?

Christophe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2014-11-26 18:08 How are ct helper to be configured with NFT ? leroy christophe
@ 2014-12-05  7:27 ` leroy christophe
  2014-12-05 10:38   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 10+ messages in thread
From: leroy christophe @ 2014-12-05  7:27 UTC (permalink / raw)
  To: netfilter, Pablo Neira Ayuso

Hi,

I still get the warning from the kernel

# tftp -g server -r test.c
[ 1359.853269] nf_conntrack: automatic helper assignment is deprecated 
and it will be removed soon. Use the iptables CT target to attach 
helpers instead.
test.c               100% 
|************************************************************************| 
804   0:00:00 ETA

# nft list ruleset
table ip filter {
         chain output {
                  type filter hook output priority 0;
                  udp dport tftp ct helper "tftp"
         }

         chain input {
                  type filter hook input priority 0;
                  oifname "lo" accept
                  ct state { established, related} accept
                  ct state new tcp dport ssh accept
                  ip protocol icmp accept
                  drop
         }

         chain forward {
                  type filter hook forward priority 0;
                  drop
         }
}

Can you help ?

Thanks
Christophe

Le 26/11/2014 19:08, leroy christophe a écrit :
> I need to do something equivalent to
>
>     iptables -t raw -A OUTPUT -p udp -d 192.168.2.1 --dport tftp -j CT 
> --helper tftp
>
>
> I tried the following
>
> nft add rule filter output ct helper "tftp" udp dport tftp
>
> But it looks like it doesn't work, I still get.
>
> [ 1113.706274] nf_conntrack: automatic helper assignment is deprecated 
> and it will be removed soon. Use the iptables CT target to attach 
> helpers instead.
>
> What is the correct syntaxe for that ?
>
> Christophe


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2014-12-05  7:27 ` leroy christophe
@ 2014-12-05 10:38   ` Pablo Neira Ayuso
  2015-02-25 12:16     ` leroy christophe
  0 siblings, 1 reply; 10+ messages in thread
From: Pablo Neira Ayuso @ 2014-12-05 10:38 UTC (permalink / raw)
  To: leroy christophe; +Cc: netfilter

On Fri, Dec 05, 2014 at 08:27:11AM +0100, leroy christophe wrote:
> Hi,
> 
> I still get the warning from the kernel
> 
> # tftp -g server -r test.c
> [ 1359.853269] nf_conntrack: automatic helper assignment is
> deprecated and it will be removed soon. Use the iptables CT target
> to attach helpers instead.

This is related to nf_conntrack. Read this:

https://home.regit.org/netfilter-en/secure-use-of-helpers/


> test.c               100% |************************************************************************|
> 804   0:00:00 ETA
> 
> # nft list ruleset
> table ip filter {
>         chain output {
>                  type filter hook output priority 0;
>                  udp dport tftp ct helper "tftp"

The right syntax is:

        udp dport tftp ct helper set "tftp"
                                 ^^^

your rule above does something different:

1) udp dport tftp

and

2) the ct helper is "tftp"

However, userspace supports this but unfortunately the kernel code is
still missing.  So you'll have to wait for this feature or
(temporarily) rely on the automagic helper assignment (from that
message, I understand you already do).

>         }
> 
>         chain input {
>                  type filter hook input priority 0;
>                  oifname "lo" accept
>                  ct state { established, related} accept

I think I already mentioned that ct state are flags.

# nft describe ct state
ct expression, datatype ct_state (conntrack state) (basetype bitmask, integer), 32 bits

pre-defined symbolic constants:
        invalid                         0x00000001
        new                             0x00000008
        established                     0x00000002
        related                         0x00000004
        untracked                       0x00000040

so you can express that as command separated values, ie.

        ct state established,related accept

This only works if the basetype is a bitmask.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2014-12-05 10:38   ` Pablo Neira Ayuso
@ 2015-02-25 12:16     ` leroy christophe
  2015-02-25 15:58       ` Jason Sipula
  0 siblings, 1 reply; 10+ messages in thread
From: leroy christophe @ 2015-02-25 12:16 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter


Le 05/12/2014 11:38, Pablo Neira Ayuso a écrit :
> On Fri, Dec 05, 2014 at 08:27:11AM +0100, leroy christophe wrote:
>> test.c               100% |************************************************************************|
>> 804   0:00:00 ETA
>>
>> # nft list ruleset
>> table ip filter {
>>          chain output {
>>                   type filter hook output priority 0;
>>                   udp dport tftp ct helper "tftp"
> The right syntax is:
>
>          udp dport tftp ct helper set "tftp"
>                                   ^^^
>
> your rule above does something different:
>
> 1) udp dport tftp
>
> and
>
> 2) the ct helper is "tftp"
>
> However, userspace supports this but unfortunately the kernel code is
> still missing.  So you'll have to wait for this feature or
> (temporarily) rely on the automagic helper assignment (from that
> message, I understand you already do).
Any idea of when the kernel support will be added ?

Christophe


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2015-02-25 12:16     ` leroy christophe
@ 2015-02-25 15:58       ` Jason Sipula
  2015-10-12 18:06         ` christophe leroy
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Sipula @ 2015-02-25 15:58 UTC (permalink / raw)
  To: leroy christophe; +Cc: Pablo Neira Ayuso, netfilter

my understanding was 3.13 had the core of nftables merged

On Wed, Feb 25, 2015 at 4:16 AM, leroy christophe
<christophe.leroy@c-s.fr> wrote:
>
> Le 05/12/2014 11:38, Pablo Neira Ayuso a écrit :
>>
>> On Fri, Dec 05, 2014 at 08:27:11AM +0100, leroy christophe wrote:
>>>
>>> test.c               100%
>>> |************************************************************************|
>>> 804   0:00:00 ETA
>>>
>>> # nft list ruleset
>>> table ip filter {
>>>          chain output {
>>>                   type filter hook output priority 0;
>>>                   udp dport tftp ct helper "tftp"
>>
>> The right syntax is:
>>
>>          udp dport tftp ct helper set "tftp"
>>                                   ^^^
>>
>> your rule above does something different:
>>
>> 1) udp dport tftp
>>
>> and
>>
>> 2) the ct helper is "tftp"
>>
>> However, userspace supports this but unfortunately the kernel code is
>> still missing.  So you'll have to wait for this feature or
>> (temporarily) rely on the automagic helper assignment (from that
>> message, I understand you already do).
>
> Any idea of when the kernel support will be added ?
>
> Christophe
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2015-02-25 15:58       ` Jason Sipula
@ 2015-10-12 18:06         ` christophe leroy
  2015-10-12 18:11           ` Jason Sipula
  2015-10-12 18:21           ` Pablo Neira Ayuso
  0 siblings, 2 replies; 10+ messages in thread
From: christophe leroy @ 2015-10-12 18:06 UTC (permalink / raw)
  To: Jason Sipula; +Cc: Pablo Neira Ayuso, netfilter


Le 25/02/2015 16:58, Jason Sipula a écrit :
> my understanding was 3.13 had the core of nftables merged
Yes but according to Pablo, "userspace supports this but unfortunately 
the kernel code is still missing".
Hence my question.

As of today, what is the status of nftables regarding the support of ct 
helper ?
If it is not in yet, how can I help getting it in ?

Christophe

>
> On Wed, Feb 25, 2015 at 4:16 AM, leroy christophe
> <christophe.leroy@c-s.fr> wrote:
>> Le 05/12/2014 11:38, Pablo Neira Ayuso a écrit :
>>> On Fri, Dec 05, 2014 at 08:27:11AM +0100, leroy christophe wrote:
>>>> test.c               100%
>>>> |************************************************************************|
>>>> 804   0:00:00 ETA
>>>>
>>>> # nft list ruleset
>>>> table ip filter {
>>>>           chain output {
>>>>                    type filter hook output priority 0;
>>>>                    udp dport tftp ct helper "tftp"
>>> The right syntax is:
>>>
>>>           udp dport tftp ct helper set "tftp"
>>>                                    ^^^
>>>
>>> your rule above does something different:
>>>
>>> 1) udp dport tftp
>>>
>>> and
>>>
>>> 2) the ct helper is "tftp"
>>>
>>> However, userspace supports this but unfortunately the kernel code is
>>> still missing.  So you'll have to wait for this feature or
>>> (temporarily) rely on the automagic helper assignment (from that
>>> message, I understand you already do).
>> Any idea of when the kernel support will be added ?
>>
>> Christophe
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netfilter" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2015-10-12 18:06         ` christophe leroy
@ 2015-10-12 18:11           ` Jason Sipula
  2015-10-13  5:49             ` Christophe Leroy
  2015-10-12 18:21           ` Pablo Neira Ayuso
  1 sibling, 1 reply; 10+ messages in thread
From: Jason Sipula @ 2015-10-12 18:11 UTC (permalink / raw)
  To: christophe leroy; +Cc: Pablo Neira Ayuso, netfilter

Maybe we're talking about different things? I had read in some places
that linux kernel version 3.13 had the core of nftables merged.

https://wiki.archlinux.org/index.php/Nftables

I do not know anything about ct helper, however.

On Mon, Oct 12, 2015 at 11:06 AM, christophe leroy
<christophe.leroy@c-s.fr> wrote:
>
> Le 25/02/2015 16:58, Jason Sipula a écrit :
>>
>> my understanding was 3.13 had the core of nftables merged
>
> Yes but according to Pablo, "userspace supports this but unfortunately the
> kernel code is still missing".
> Hence my question.
>
> As of today, what is the status of nftables regarding the support of ct
> helper ?
> If it is not in yet, how can I help getting it in ?
>
> Christophe
>
>
>>
>> On Wed, Feb 25, 2015 at 4:16 AM, leroy christophe
>> <christophe.leroy@c-s.fr> wrote:
>>>
>>> Le 05/12/2014 11:38, Pablo Neira Ayuso a écrit :
>>>>
>>>> On Fri, Dec 05, 2014 at 08:27:11AM +0100, leroy christophe wrote:
>>>>>
>>>>> test.c               100%
>>>>>
>>>>> |************************************************************************|
>>>>> 804   0:00:00 ETA
>>>>>
>>>>> # nft list ruleset
>>>>> table ip filter {
>>>>>           chain output {
>>>>>                    type filter hook output priority 0;
>>>>>                    udp dport tftp ct helper "tftp"
>>>>
>>>> The right syntax is:
>>>>
>>>>           udp dport tftp ct helper set "tftp"
>>>>                                    ^^^
>>>>
>>>> your rule above does something different:
>>>>
>>>> 1) udp dport tftp
>>>>
>>>> and
>>>>
>>>> 2) the ct helper is "tftp"
>>>>
>>>> However, userspace supports this but unfortunately the kernel code is
>>>> still missing.  So you'll have to wait for this feature or
>>>> (temporarily) rely on the automagic helper assignment (from that
>>>> message, I understand you already do).
>>>
>>> Any idea of when the kernel support will be added ?
>>>
>>> Christophe
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe netfilter" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> https://www.avast.com/antivirus
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2015-10-12 18:06         ` christophe leroy
  2015-10-12 18:11           ` Jason Sipula
@ 2015-10-12 18:21           ` Pablo Neira Ayuso
  2016-03-02 18:14             ` christophe leroy
  1 sibling, 1 reply; 10+ messages in thread
From: Pablo Neira Ayuso @ 2015-10-12 18:21 UTC (permalink / raw)
  To: christophe leroy; +Cc: Jason Sipula, netfilter

On Mon, Oct 12, 2015 at 08:06:38PM +0200, christophe leroy wrote:
> 
> Le 25/02/2015 16:58, Jason Sipula a écrit :
> >my understanding was 3.13 had the core of nftables merged
> Yes but according to Pablo, "userspace supports this but unfortunately the
> kernel code is still missing".
> Hence my question.
> 
> As of today, what is the status of nftables regarding the support of ct
> helper ?
> If it is not in yet, how can I help getting it in ?

I'd appreciate of you can send me patches that we can discuss on
netfilter-devel@vger.kernel.org.

I think it only requires extra little code for the nft_meta expression
from the kernel.

Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2015-10-12 18:11           ` Jason Sipula
@ 2015-10-13  5:49             ` Christophe Leroy
  0 siblings, 0 replies; 10+ messages in thread
From: Christophe Leroy @ 2015-10-13  5:49 UTC (permalink / raw)
  To: Jason Sipula; +Cc: Pablo Neira Ayuso, netfilter



Le 12/10/2015 20:11, Jason Sipula a écrit :
> Maybe we're talking about different things? I had read in some places
> that linux kernel version 3.13 had the core of nftables merged.
>
> https://wiki.archlinux.org/index.php/Nftables
>
> I do not know anything about ct helper, however.

"ct helper" stands for conntrack helper. It is some part of netfilter 
that helps conntrack
to track complex streams like FTP or TFTP streams where the conntrack 
needs to identify and keep
track of the data stream associated to the signalling stream

Christophe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How are ct helper to be configured with NFT ?
  2015-10-12 18:21           ` Pablo Neira Ayuso
@ 2016-03-02 18:14             ` christophe leroy
  0 siblings, 0 replies; 10+ messages in thread
From: christophe leroy @ 2016-03-02 18:14 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Jason Sipula, netfilter



Le 12/10/2015 20:21, Pablo Neira Ayuso a écrit :
> On Mon, Oct 12, 2015 at 08:06:38PM +0200, christophe leroy wrote:
>> Le 25/02/2015 16:58, Jason Sipula a écrit :
>>> my understanding was 3.13 had the core of nftables merged
>> Yes but according to Pablo, "userspace supports this but unfortunately the
>> kernel code is still missing".
>> Hence my question.
>>
>> As of today, what is the status of nftables regarding the support of ct
>> helper ?
>> If it is not in yet, how can I help getting it in ?
> I'd appreciate of you can send me patches that we can discuss on
> netfilter-devel@vger.kernel.org.
>
> I think it only requires extra little code for the nft_meta expression
> from the kernel.
>
>
Isn't it is in nft_ct instead of nft_meta ?

I'm having difficulties to understand how it works.
nft_ct_set_init() is called when I add the rule in the table. So I 
believe I have to call nf_ct_helper_ext_add() from here, haven't I ?
But how do I get the name of the requested helper from that function ? I 
suppose once I get it I can do the same as  xt_ct_set_helper() does.

Otherwise, nft_ct_set_eval() is called when the helper is needed, but I 
suppose it is too late when that happens because the conntrack has 
already said that it has used automatic helper assignment.

Christophe

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-03-02 18:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-26 18:08 How are ct helper to be configured with NFT ? leroy christophe
2014-12-05  7:27 ` leroy christophe
2014-12-05 10:38   ` Pablo Neira Ayuso
2015-02-25 12:16     ` leroy christophe
2015-02-25 15:58       ` Jason Sipula
2015-10-12 18:06         ` christophe leroy
2015-10-12 18:11           ` Jason Sipula
2015-10-13  5:49             ` Christophe Leroy
2015-10-12 18:21           ` Pablo Neira Ayuso
2016-03-02 18:14             ` christophe leroy

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.