Skip to contentSkip to conversation

tc and iptables --set-mark question

LARTC Joerg Hartmann 3 participants 3 messages Jul 3, 2003 – Jul 8, 2003

lore
Share & tools
lore
#0 lore raw

Hello,

if i mark packets on my firewall with "iptables" and "--set-mark" (lets say .. with --set-mark 0x12 ..) can someone tell me, WHERE in the resulting ip packet this data is stored ?
From the examples i have seen, it seems to me that the mark can be as big as one Byte - is this correct ?

The next question is - is it possible to clear the statistical counters of "tc -s class .." back to zero ?

thanks and regards
Joerg

Signature · 5 lines
Jörg Hartmann		Tel: +49 391 40 00 125
[email protected]
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#1 lore raw
Quoted 5 lines · Joerg Hartmann

Hello,

if i mark packets on my firewall with "iptables" and "--set-mark" (lets say .. with --set-mark 0x12 ..) can someone tell me, WHERE in the resulting ip packet this data is stored ?

It's stored in kernel memory. If the packet leaves the box, the mark is gone;

Quoted 2 lines

From the examples i have seen, it seems to me that the mark can be as big as one Byte - is this correct ?

1 byte = 2^8 = 256. I think it can be bigger.

Quoted 2 lines

The next question is - is it possible to clear the statistical counters of "tc -s class .." back to zero ?

No.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Joerg Hartmann
Quoted 4 lines · Stef Coene
Quoted 2 lines

From the examples i have seen, it seems to me that the mark can be as big as one Byte - is this correct ?

1 byte = 2^8 = 256. I think it can be bigger.

You are correct. If I understand correctly the code in:
/usr/src/linux-2.5.73/include/linux/netfilter_ipv4/ipt_mark.h

marks are "unsigned longs", so at least 2^32 of them should be available.

Hope this helps.

Signature · 5 lines
Jose Luis Domingo Lopez
Linux Registered User #189436     Debian Linux Sid (Linux 2.5.73)
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/