From: "Bolivar Diaz Galarza" Date: Tue, 30 Jan 2007 23:21:52 +0000 Subject: [LARTC] Problems matching tos on port 554 Message-Id: <002501c744c5$6cfca050$82f793c9@www> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0912580048==" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. --===============0912580048== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0026_01C74493.22623050" This is a multi-part message in MIME format. ------=_NextPart_000_0026_01C74493.22623050 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi There, I am trying to match mac address and tos at the same time. It mostly works for all ports, but recently I discovered that it doesn't, for example it does not work on port 554. For each client I have two classes, one is the "good" traffic that I mark using iptables with the line, for example: /sbin/iptables -t mangle -A PREROUTING -p tcp --sport 554 -j TOS --set-tos 0x10 Later on, I use tc filter to send the packets marked with tos 0x10 to the proper class which will be 1:1192 in this case, and the rest of the traffic matching that clients MAC address continues to 1:2192: BAJADA="/sbin/tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match u16 0x0800 0xffff at -2" $BAJADA match u32 0x5bb517c8 0xffffffff at -12 match u16 0x0011 0xffff at -14 match ip tos 0x10 0xff flowid 1:1192 $BAJADA match u32 0x5bb517c8 0xffffffff at -12 match u16 0x0011 0xffff at -14 flowid 1:2192 I thought about marking the packets with iptables -j MARK --set-mark but I can't find a way of making this work and matching the MAC address at the same time. Any help will be greatly appreciated. Bolivar, ------=_NextPart_000_0026_01C74493.22623050 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi=20 There,
 
I am trying to match mac address and tos at the = same time. It=20 mostly works for all ports, but recently I discovered that it doesn't, = for=20 example it does not work on port 554.
 
For = each client I=20 have two classes, one is the "good" traffic that I mark using iptables = with the=20 line, for = example:
 
/sbin/iptables -t=20 mangle -A PREROUTING -p tcp --sport 554 -j TOS --set-tos=20 0x10
 
Later = on, I use tc=20 filter to send the packets marked with tos 0x10 to the proper class = which will=20 be 1:1192 in this case, and the rest of the traffic matching that = clients MAC=20 address continues to 1:2192:
 
BAJADA=3D"/sbin/tc=20 filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match u16 0x0800 = 0xffff at=20 -2"
$BAJADA match u32 0x5bb517c8 0xffffffff at -12 = match u16=20 0x0011 0xffff at -14 match ip tos 0x10 0xff flowid 1:1192
$BAJADA = match u32=20 0x5bb517c8 0xffffffff at -12 match u16 0x0011 0xffff at -14 flowid=20 1:2192
 
I = thought about marking the packets with iptables = -j MARK=20 --set-mark but I can't find a way of making this work and matching the = MAC=20 address at the same time.
 
Any = help will be=20 greatly appreciated.
 
Bolivar,
------=_NextPart_000_0026_01C74493.22623050-- --===============0912580048== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============0912580048==--