Skip to content

How to use u32 filters with clsact qdisc #1292

Answered by svinota
tsv1991 asked this question in Q&A
Discussion options

You must be logged in to vote

There was a wrong parent; the kernel expects there 0xfffffff2 in this case.

ip.tc("add-filter", "u32", dev_index,
    parent=0xfffffff2,  # <--- here was a wrong parent
    prio=2,
    protocol=protocols.ETH_P_IP,
    target=0x800,
    keys=[f"{dst_ip_hex}/{dst_mask_hex}+{offset}"],
    action=dict(kind="gact", action="ok")
)

Just for reference: https://github.com/iproute2/iproute2/blob/41710ace5e8fadff354f3dba67bf27ed3a3c5ae7/include/uapi/linux/pkt_sched.h#L80

There is a significant lack of user-friendliness in pyroute2 when it comes to traffic control management, so any contributions in this area are highly welcome.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tsv1991
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants