netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: How to set the filtering rules for drop the packets
       [not found] <35e52a86.138f1.14583b52f31.Coremail.mstian88@163.com>
@ 2014-04-21 11:49 ` Ben Hutchings
  2014-04-22  4:56   ` mstian88
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2014-04-21 11:49 UTC (permalink / raw)
  To: mstian88; +Cc: bwh, netdev

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

On Mon, 2014-04-21 at 17:54 +0800, mstian88 wrote:
> Dear Ben Hutchings.
> 
> 
> I want to discard the packets (srcport==80  or dstport==80),  how can
> i do?
>
> eg.
> I set the rule for discard the packets that src port is 80:
> ethtool -U eth0 flow-type tcp4 src-port 80 action -1    Success
> 
> 
> then set the rule for discard the packets that dst port is 80:
> ethtool -U eth0 flow-type tcp4 dst-port 80 action -1    Failed
> the error info is :
> rmgr: Cannot insert RX class rule: Invalid argument

The sets of fields you can filter by vary greatly between different
drivers and network controllers.  It looks like the driver for eth0 just
doesn't support filtering by dst-port only.

Ben.


-- 
Ben Hutchings
Knowledge is power.  France is bacon.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re:Re: How to set the filtering rules for drop the packets
  2014-04-21 11:49 ` How to set the filtering rules for drop the packets Ben Hutchings
@ 2014-04-22  4:56   ` mstian88
  2014-04-22 18:05     ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: mstian88 @ 2014-04-22  4:56 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: bwh, netdev

thanks for your reply , 

 my NIC is intel X540-T1, when i set dst-port filter first ,suceess, but then set src-port filter failed。

That is to say the filter rule src-port and dis-port can't set together。

There are any other ways to filter the packets that srcport is 80 or dstport is 80?
                                              
                                                                                                                 monney
At 2014-04-21 19:49:04,"Ben Hutchings" <ben@decadent.org.uk> wrote:
>On Mon, 2014-04-21 at 17:54 +0800, mstian88 wrote:
>> Dear Ben Hutchings.
>> 
>> 
>> I want to discard the packets (srcport==80  or dstport==80),  how can
>> i do?
>>
>> eg.
>> I set the rule for discard the packets that src port is 80:
>> ethtool -U eth0 flow-type tcp4 src-port 80 action -1    Success
>> 
>> 
>> then set the rule for discard the packets that dst port is 80:
>> ethtool -U eth0 flow-type tcp4 dst-port 80 action -1    Failed
>> the error info is :
>> rmgr: Cannot insert RX class rule: Invalid argument
>
>The sets of fields you can filter by vary greatly between different
>drivers and network controllers.  It looks like the driver for eth0 just
>doesn't support filtering by dst-port only.
>
>Ben.
>
>
>-- 
>Ben Hutchings
>Knowledge is power.  France is bacon.

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

* Re: Re:Re: How to set the filtering rules for drop the packets
  2014-04-22  4:56   ` mstian88
@ 2014-04-22 18:05     ` Ben Hutchings
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2014-04-22 18:05 UTC (permalink / raw)
  To: mstian88; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

On Tue, 2014-04-22 at 12:56 +0800, mstian88 wrote:
> thanks for your reply , 
> 
>  my NIC is intel X540-T1, when i set dst-port filter first ,suceess,
> but then set src-port filter failed。
> 
> That is to say the filter rule src-port and dis-port can't set
> together。

So you can insert either filter individually, but not both?  How odd.
You could ask the ixgbe maintainers whether this is a real hardware
limitation or a bug.

> There are any other ways to filter the packets that srcport is 80 or
> dstport is 80?

You can do it in software with netfilter/iptables.

Ben.

-- 
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

end of thread, other threads:[~2014-04-22 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <35e52a86.138f1.14583b52f31.Coremail.mstian88@163.com>
2014-04-21 11:49 ` How to set the filtering rules for drop the packets Ben Hutchings
2014-04-22  4:56   ` mstian88
2014-04-22 18:05     ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).