netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: R Keith Beal <r@CMSS.com>
To: netfilter@vger.kernel.org
Subject: Ingress filter issue with pedit
Date: Tue, 11 Jul 2023 14:28:24 -0700	[thread overview]
Message-ID: <c363df6b-38cd-c55a-c5ec-0152ac6cac37@CMSS.com> (raw)

Netfilter Users,

I am trying to prioritize traffic from specific IP addresses by using an 
ingress filter to set the TOS filed with a pedit action.
In my simple test, I try to set the TOS to 15.
The commands I use are as follows...

sudo tc qdisc add dev wlan0 handle ffff: ingress
sudo tc filter add dev wlan0 protocol ip parent ffff: u32 match ip src 
10.0.1.99/32 action pedit ex munge ip dsfield set $((15 << 2)) retain 
0xfc action pass

This results in all traffic from the IP being dropped.

I deleted the ingress qdisc and re-added it then added a filter with 
just the pass action.
The packets go through.

sudo tc filter add dev wlan0 protocol ip parent ffff: u32 match ip src 
10.0.1.99/32 action pass
pi@GW-13:~ $ tc -p -s -d filter show dev wlan0 parent ffff:
filter protocol ip pref 49152 u32 chain 0
filter protocol ip pref 49152 u32 chain 0 fh 800: ht divisor 1
filter protocol ip pref 49152 u32 chain 0 fh 800::800 order 2048 key ht 
800 bkt 0 terminal flowid ??? not_in_hw
   match IP src 10.0.1.99/32
         action order 1: gact action pass
          random type none pass val 0
          index 1 ref 1 bind 1 installed 6 sec firstused 6 sec
         Action statistics:
         Sent 2710836 bytes 1917 pkt (dropped 0, overlimits 0 requeues 0)
         backlog 0b 0p requeues 0

This seems to indicate the problem is with the pedit action.
Or am I missing something?

hanks in advance,
Keith

-- 
*R Keith Beal*
Distinguished Engineer
CMSS
949 932-0359
603 391-2847 Cell
r.keith.beal Skype
www.linkedin.com/in/rkeithbeal <http://www.linkedin.com/in/rkeithbeal>

                 reply	other threads:[~2023-07-11 21:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=c363df6b-38cd-c55a-c5ec-0152ac6cac37@CMSS.com \
    --to=r@cmss.com \
    --cc=netfilter@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).