From owner-freebsd-hackers@FreeBSD.ORG Mon May 26 20:13:40 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC3CE37B401 for ; Mon, 26 May 2003 20:13:40 -0700 (PDT) Received: from linus.csl.sony.co.jp (linus.csl.sony.co.jp [133.138.1.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91E7D43F93 for ; Mon, 26 May 2003 20:13:39 -0700 (PDT) (envelope-from kjc@csl.sony.co.jp) Received: from localhost (localhost [127.0.0.1]) by linus.csl.sony.co.jp (8.12.9/8.12.6) with ESMTP id h4R3Daxj015174; Tue, 27 May 2003 12:13:36 +0900 (JST) (envelope-from kjc@csl.sony.co.jp) Date: Tue, 27 May 2003 12:13:36 +0900 (JST) Message-Id: <20030527.121336.41645344.kjc@csl.sony.co.jp> To: ashish@symonds.net From: Kenjiro Cho In-Reply-To: <1116.203.192.199.30.1053958864.squirrel@secure.symonds.net> References: <1116.203.192.199.30.1053958864.squirrel@secure.symonds.net> X-Mailer: Mew version 2.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: changing the ToS in IP Header X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2003 03:13:41 -0000 Ashish Kulkarni wrote: > Is there any way in which I can manipulate the Type of Service (TOS) byte > in the IPv4 header? I need to set the TOS bits on all outgoing packets from > my box to the ISP to a particular pattern (0x02), as otherwise the ISP does > not forward packets. Tell your ISP not to use 0x02; it violates the standard. You may modify the upper 6 bits for an arbitrary value, though. The lower 2 bits of the (now deprecated) TOS field are officially assigned to ECN (RFC3168). 0x02, ECT(0), is used to indicate that the sender is ECN-capable. > I have been able to do this in Linux using the > iptables mangle table: > > http://www.tldp.org/LDP/nag2/x-087-2-firewall.tos.manipulation.html > > but am unable to find a similiar packet-mangling feature in the firewalls > running on FreeBSD...there are rules for matching on TOS pattern, but not > on TOS manipulation. Does anyone know of any tool which can do this? ALTQ supports diffserv and is capable of rewriting the upper 6 bits of the TOS field. http://www.csl.sony.co.jp/~kjc/software.html -Kenjiro