From owner-freebsd-net@FreeBSD.ORG Fri Nov 8 21:52:13 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 903DC91D for ; Fri, 8 Nov 2013 21:52:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15FE422F4 for ; Fri, 8 Nov 2013 21:52:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rA8LqAoO031629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 Nov 2013 01:52:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rA8LqANf031628; Sat, 9 Nov 2013 01:52:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 9 Nov 2013 01:52:10 +0400 From: Gleb Smirnoff To: Bear Subject: Re: ng_patch and 802.11Q Message-ID: <20131108215210.GH7577@FreeBSD.org> References: <527C799D.8020208@Gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <527C799D.8020208@Gmail.com> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2013 21:52:13 -0000 On Fri, Nov 08, 2013 at 02:11:49AM -0330, Bear wrote: B> Hi all, B> I want to modify VLAN priority by ng_patch. After reading the manpage of B> ng_patch(http://www.freebsd.org/cgi/man.cgi?query=ng_patch) and the B> example it given: B> B> > /usr/sbin/ngctl -f- <<-SEQ B> > mkpeer ipfw: patch 200 in B> > name ipfw:200 ttl_add B> > msg ttl_add: setconfig { count=1 csum_flags=1 ops=[ \ B> > { mode=2 value=3 length=1 offset=8 } ] } B> > SEQ B> > /sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net B> B> It seems ng_patch can only modify IP header. However, the position of B> VLAN header is before IP header and after Ethernet header. How can I B> modify it? ipfw allows you to intercept packets at IP layer. Tp modify VLAN header, you need to capture them earlier. May be ng_ether(4) will help you. -- Totus tuus, Glebius.