All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viktor Kemmet <Viktor.Kemmet@t-online.de>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Marking
Date: Thu, 21 Mar 2002 21:06:42 +0000	[thread overview]
Message-ID: <marc-lartc-101674480200678@msgid-missing> (raw)
In-Reply-To: <marc-lartc-101665894626463@msgid-missing>


Ali badilli wrote:

> Hi everybody,
> 
> Does anybody know any tool, we can mark packets' ToS
> field?. I would like to mark packets in ingress router
> and classify them in core router based on their ToS
> field (DSCP in Diffserv). 
> 
> Thanks in advance
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - live college hoops coverage
> http://sports.yahoo.com/
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> 
> 

Have you tried iptables:
(see man-page for iptables)
iptables -A OUTPUT -t mangle -p tcp --sport telnet \
   -j TOS --set-tos Minimize-Delay



Or you can do it with tc:
(setting TOS according to destination port)

TC=tc
EGDEV="dev eth0"
#
#
############################################################
######################## Egress side ########################
# attach a dsmarker
#
$TC qdisc add $EGDEV handle 1:0 root dsmark indices 64 set_tc_index
#
# values of the DSCP to change depending on the class
#
#becomes EF
$TC class change $EGDEV classid 1:1 dsmark mask 0x3 \
        value 0xb8
#becomes AF11
$TC class change $EGDEV classid 1:2 dsmark mask 0x3 \
        value 0x28
#becomes AF21
$TC class change $EGDEV classid 1:3 dsmark mask 0x3 \
        value 0x48
#
#
# The class mapping
#
$TC filter add $EGDEV parent 1:0 protocol ip prio 4 u32 \
     match ip dport 5001 0xffff classid 1:1
$TC filter add $EGDEV parent 1:0 protocol ip prio 4 u32 \
     match ip dport 5002 0xffff classid 1:2
$TC filter add $EGDEV parent 1:0 protocol ip prio 4 u32 \
     match ip dport 5003 0xffff  classid 1:3
#

echo "---- qdisc parameters Egress  ----------"
$TC qdisc ls $EGDEV
echo "---- Class parameters Egress  ----------"
$TC class ls $EGDEV
echo "---- filter parameters Egress ----------"
$TC filter ls $EGDEV parent 1:0



Just for testing, ping and mgen can set TOS field as well.

Regards
Viktor

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  reply	other threads:[~2002-03-21 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-20 21:14 [LARTC] Marking Ali badilli
2002-03-21 21:06 ` Viktor Kemmet [this message]
2003-01-27  4:50 ` [LARTC] marking Jay Wineinger
2003-01-27 18:17 ` Stef Coene
2003-01-28  3:55 ` Jay Wineinger
2003-01-28  9:52 ` Stef Coene
2003-01-28 19:56 ` Stef Coene
2003-01-28 21:47 ` Jay Wineinger
2003-01-29 17:33 ` Stef Coene

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=marc-lartc-101674480200678@msgid-missing \
    --to=viktor.kemmet@t-online.de \
    --cc=lartc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.