* Disabling conntrack on an interface
@ 2009-07-02 15:10 Terry Burton
2009-07-02 15:26 ` Thomas Jacob
0 siblings, 1 reply; 8+ messages in thread
From: Terry Burton @ 2009-07-02 15:10 UTC (permalink / raw)
To: netfilter
Hi,
Is it possible to disable connection tracking for a specific interface/bridge?
The particular scenario is that I have a secondary interface that
collecting the traffic from a SPAN/mirror port on a busy router. This
interface is enslaved into a bridge along with the virtual interfaces
of a some analyser virtual machines, using setageing=0 so that the
frames are forwarded to all VMs.
I would rather not have the traffic that originates from the capture
interface hitting the connection tracking code, if possible.
Warm regards,
Terry
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Disabling conntrack on an interface
2009-07-02 15:10 Disabling conntrack on an interface Terry Burton
@ 2009-07-02 15:26 ` Thomas Jacob
2009-07-02 16:06 ` Terry Burton
2009-07-02 23:46 ` Pascal Hambourg
0 siblings, 2 replies; 8+ messages in thread
From: Thomas Jacob @ 2009-07-02 15:26 UTC (permalink / raw)
To: Terry Burton; +Cc: netfilter
On Thu, 2009-07-02 at 16:10 +0100, Terry Burton wrote:
> Hi,
>
> Is it possible to disable connection tracking for a specific interface/bridge?
Check out:
NOTRACK
This target disables connection tracking for all packets matching
that rule.
It can only be used in the
raw table.
> The particular scenario is that I have a secondary interface that
> collecting the traffic from a SPAN/mirror port on a busy router. This
> interface is enslaved into a bridge along with the virtual interfaces
> of a some analyser virtual machines, using setageing=0 so that the
> frames are forwarded to all VMs.
>
> I would rather not have the traffic that originates from the capture
> interface hitting the connection tracking code, if possible.
Understandable, but does that actually happen for you?
I do not get any conntrack entries from mirrored ports when
I am port mirroring packets onto a Linux interface that is up
but has no configured addresses.
As long as these packets are not addressed to your machine the netfilter
code never gets to see them, AFAIK.
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Disabling conntrack on an interface
2009-07-02 15:26 ` Thomas Jacob
@ 2009-07-02 16:06 ` Terry Burton
2009-07-02 17:04 ` Thomas Jacob
2009-07-02 18:45 ` Pascal Hambourg
2009-07-02 23:46 ` Pascal Hambourg
1 sibling, 2 replies; 8+ messages in thread
From: Terry Burton @ 2009-07-02 16:06 UTC (permalink / raw)
To: Thomas Jacob; +Cc: netfilter
On Thu, Jul 2, 2009 at 4:26 PM, Thomas Jacob<jacob@internet24.de> wrote:
> On Thu, 2009-07-02 at 16:10 +0100, Terry Burton wrote:
>> Is it possible to disable connection tracking for a specific interface/bridge?
>
> Check out:
>
> NOTRACK
> This target disables connection tracking for all packets matching
> that rule.
>
> It can only be used in the
> raw table.
Hi Thomas,
Thanks, but my issue isn't with firewalling, rather that I'd like this
traffic to avoid the conntrack table altogether to avoid system load.
>> The particular scenario is that I have a secondary interface that
>> collecting the traffic from a SPAN/mirror port on a busy router. This
>> interface is enslaved into a bridge along with the virtual interfaces
>> of a some analyser virtual machines, using setageing=0 so that the
>> frames are forwarded to all VMs.
>>
>> I would rather not have the traffic that originates from the capture
>> interface hitting the connection tracking code, if possible.
>
> Understandable, but does that actually happen for you?
>
> I do not get any conntrack entries from mirrored ports when
> I am port mirroring packets onto a Linux interface that is up
> but has no configured addresses.
>
> As long as these packets are not addressed to your machine the netfilter
> code never gets to see them, AFAIK.
As soon as I bind the (unaddressed) interface into the bridge the
packets are conntracked.
Thanks,
Terry
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Disabling conntrack on an interface
2009-07-02 16:06 ` Terry Burton
@ 2009-07-02 17:04 ` Thomas Jacob
2009-07-02 17:16 ` Terry Burton
2009-07-02 18:45 ` Pascal Hambourg
1 sibling, 1 reply; 8+ messages in thread
From: Thomas Jacob @ 2009-07-02 17:04 UTC (permalink / raw)
To: Terry Burton; +Cc: netfilter
On Thu, 2009-07-02 at 17:06 +0100, Terry Burton wrote:
> Thanks, but my issue isn't with firewalling, rather that I'd like this
> traffic to avoid the conntrack table altogether to avoid system load.
Still it's a way to disable conntracking for just one interface, right?
The raw table is evaluated before the connection tracking code. In fact
being able to do stuff before the connection tracking code is called
is the raison d'être of the raw tables.
I.e. -A PREROUTING -i <MIRROR-INTERFACE> -j NOTRACK
If you want to disable conntracking altogether just unload
the conntracking/iptables modules.
> As soon as I bind the (unaddressed) interface into the bridge the
> packets are conntracked.
Oh yes, sorry, I didn't read you email correctly, you are bridging
packets thru your box so the conntrack code gets to see them. Don't
know if the above will still work under these circumstances, just
try it out.
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Disabling conntrack on an interface
2009-07-02 17:04 ` Thomas Jacob
@ 2009-07-02 17:16 ` Terry Burton
0 siblings, 0 replies; 8+ messages in thread
From: Terry Burton @ 2009-07-02 17:16 UTC (permalink / raw)
To: Thomas Jacob; +Cc: netfilter
On Thu, Jul 2, 2009 at 6:04 PM, Thomas Jacob<jacob@internet24.de> wrote:
> On Thu, 2009-07-02 at 17:06 +0100, Terry Burton wrote:
>> Thanks, but my issue isn't with firewalling, rather that I'd like this
>> traffic to avoid the conntrack table altogether to avoid system load.
>
> Still it's a way to disable conntracking for just one interface, right?
>
> The raw table is evaluated before the connection tracking code. In fact
> being able to do stuff before the connection tracking code is called
> is the raison d'être of the raw tables.
My bad - I hadn't taken the time to understand your reply an didn't
appreciate the relationship between connection tracking and the raw
table.
>> As soon as I bind the (unaddressed) interface into the bridge the
>> packets are conntracked.
>
> Oh yes, sorry, I didn't read you email correctly, you are bridging
> packets thru your box so the conntrack code gets to see them. Don't
> know if the above will still work under these circumstances, just
> try it out.
It works great when you use the bridge interface name:
iptables -t raw -A PREROUTING -i breth1 -j NOTRACK
Thank you very much for the rapid help!
All the best,
Terry
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Disabling conntrack on an interface
2009-07-02 16:06 ` Terry Burton
2009-07-02 17:04 ` Thomas Jacob
@ 2009-07-02 18:45 ` Pascal Hambourg
2009-07-02 21:35 ` Terry Burton
1 sibling, 1 reply; 8+ messages in thread
From: Pascal Hambourg @ 2009-07-02 18:45 UTC (permalink / raw)
To: netfilter
Hello,
Terry Burton a écrit :
>
> As soon as I bind the (unaddressed) interface into the bridge the
> packets are conntracked.
This is because by default bridged IPv4 traffic is passed to iptables.
So another method is to set /proc/sys/net/bridge/bridge-nf-call-iptables
to 0 to disable this.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Disabling conntrack on an interface
2009-07-02 18:45 ` Pascal Hambourg
@ 2009-07-02 21:35 ` Terry Burton
0 siblings, 0 replies; 8+ messages in thread
From: Terry Burton @ 2009-07-02 21:35 UTC (permalink / raw)
To: Pascal Hambourg; +Cc: netfilter
On Thu, Jul 2, 2009 at 7:45 PM, Pascal
Hambourg<pascal.mail@plouf.fr.eu.org> wrote:
> Terry Burton a écrit :
>> As soon as I bind the (unaddressed) interface into the bridge the
>> packets are conntracked.
>
> This is because by default bridged IPv4 traffic is passed to iptables. So
> another method is to set /proc/sys/net/bridge/bridge-nf-call-iptables to 0
> to disable this.
Hi Pascal,
I had discovered this method, but since this is a global (vs per
interface) conferable I chose to disregard this option.
Thanks!
Terry
P.S. Nice to find a mailing list that is backed by a responsive
community. Kudos.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Disabling conntrack on an interface
2009-07-02 15:26 ` Thomas Jacob
2009-07-02 16:06 ` Terry Burton
@ 2009-07-02 23:46 ` Pascal Hambourg
1 sibling, 0 replies; 8+ messages in thread
From: Pascal Hambourg @ 2009-07-02 23:46 UTC (permalink / raw)
To: netfilter
Thomas Jacob a écrit :
>
> I do not get any conntrack entries from mirrored ports when
> I am port mirroring packets onto a Linux interface that is up
> but has no configured addresses.
You could get some, under some conditions.
> As long as these packets are not addressed to your machine the netfilter
> code never gets to see them, AFAIK.
The netfilter code, including conntrack, sees IPv4 packets on an
interface as soon as it is bound to the IPv4 stack. An interface does
not need to have an IP address to be bound to the IPv4 stack. Before
kernel 2.6.21, it just required that the interface had had an address in
the past (even though it was later removed) ; "ifconfig <interface>
0.0.0.0" did the trick too. Since kernel 2.6.21, interfaces are
automatically bound to the IPv4 (and IPv6) stack when they are created.
However... if a packet is not addressed to the machine *and* the machine
does not know what to do with it (e.g. IP forwarding is disabled or
there is no route to the destination), the packet will be dropped at the
input routing stage after PREROUTING, thus the conntrack entry won't be
confirmed and will be deleted.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-07-02 23:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-02 15:10 Disabling conntrack on an interface Terry Burton
2009-07-02 15:26 ` Thomas Jacob
2009-07-02 16:06 ` Terry Burton
2009-07-02 17:04 ` Thomas Jacob
2009-07-02 17:16 ` Terry Burton
2009-07-02 18:45 ` Pascal Hambourg
2009-07-02 21:35 ` Terry Burton
2009-07-02 23:46 ` Pascal Hambourg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox