• Felix Fietkau's avatar
    tc: add support for connmark action · b8d5c9a7
    Felix Fietkau authored
    Add ability to add the netfilter connmark support.
    
    Typical usage:
    ...lets tag outgoing icmp with mark 0x10..
    iptables -tmangle -A PREROUTING -p icmp -j CONNMARK --set-mark 0x10
    ..add on ingress of $ETH an extractor for connmark...
    tc filter add dev $ETH parent ffff: prio 4 protocol ip \
    u32 match ip protocol 1 0xff \
    flowid 1:1 \
    action connmark continue
    ...if the connmark was 0x11, we police to a ridic rate of 10Kbps
    tc filter add dev $ETH parent ffff: prio 5 protocol ip \
    handle 0x11 fw flowid 1:1 \
    action police rate 10kbit burst 10k
    
    Other ways to use the connmark is to supply the zone, index and
    branching choice. Refer to help.
    Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
    Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
    b8d5c9a7
m_connmark.c 3.58 KB