From owner-freebsd-net@FreeBSD.ORG Mon Nov 11 06:47:28 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A5C3D1F7 for ; Mon, 11 Nov 2013 06:47:28 +0000 (UTC) (envelope-from jilingshu@gmail.com) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6387D2DCA for ; Mon, 11 Nov 2013 06:47:28 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id w4so3802611qcr.26 for ; Sun, 10 Nov 2013 22:47:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/FnZ+BERgQ3S1GWPYilmxwwVo3cMg/ZO+x7CluRiqzE=; b=z6FVDmUWwDuh1KsLVpBrKqli/CIh4M++1ELqNKw4nUWhodkQ26rqDpIOaE/J5eP1wK ZJlJOHL8kzb8cC/214vxCC+mRNhy4z+f0xnTvEsQ0ozM4534MURjz94I4bkiKAVMHyoo 7UEgpzlCtTsIbx8oyCXBb6MjnlPIXfzhtcPqIz9U5OKag+MFek9PWWjGGu9CiM13sm5/ L3FsDzlJ16IT+7Tsn1ASvrogNHj+ieS2pX7RfQLkpwMkXeciXCAT2pBYEPtEQ+0X0yDR Mp6mjj5uxRzids7LJaGjAiZeMLLFE4dfbdGmeW4YUgVGWezupXRJeeUSFem1mno+/V0R V9Sw== X-Received: by 10.224.120.199 with SMTP id e7mr10546322qar.34.1384152447477; Sun, 10 Nov 2013 22:47:27 -0800 (PST) Received: from [172.16.99.106] (stjhnf0148w-142162175108.dhcp-dynamic.fibreop.nl.bellaliant.net. [142.162.175.108]) by mx.google.com with ESMTPSA id a9sm48366024qed.6.2013.11.10.22.47.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 10 Nov 2013 22:47:27 -0800 (PST) Message-ID: <52807D7E.8@Gmail.com> Date: Mon, 11 Nov 2013 03:17:26 -0330 From: Bear User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Rozhuk.IM@gmail.com Subject: Re: ng_patch and 802.11Q References: <527C799D.8020208@Gmail.com> <20131108215210.GH7577@FreeBSD.org> <527DDFEA.9050001@Gmail.com> <527e4926.aa1d700a.02d7.fffff457@mx.google.com> <527E8D3E.4050907@Gmail.com> <527f6464.453c700a.3a17.25b0@mx.google.com> <52803997.2030306@Gmail.com> <52807c14.4665cc0a.3adf.3033@mx.google.com> In-Reply-To: <52807c14.4665cc0a.3adf.3033@mx.google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: Mon, 11 Nov 2013 06:47:28 -0000 On 2013/11/11 上午 03:11, rozhuk.im@gmail.com wrote: >> > .lower - packets from/to network adapter > .upper - packets from/to >> OS Yes. But if I try to capture on upper: >> > nghook -a em0:upper >> I just got nothing... > You MAST forward packets lower<->upper by some netgraph nodes. > If not - OS became unavailable trough this adapter. > See ng_vlan examples. > >> > http://www.freebsd.org/cgi/query-pr.cgi?pr=161908 >> This link is excellent! Seems it has not been merged to kernel yet? > It requires to update manual pages, but my English... %) > > >> On 11/10/2013 7:17 AM, rozhuk.im@gmail.com wrote: >>> http://www.freebsd.org/cgi/query-pr.cgi?pr=161908 >>> >>> >>>> -----Original Message----- >>>> From: Bear [mailto:jilingshu@gmail.com] >>>> Sent: Saturday, November 09, 2013 11:30 PM >>>> To: Rozhuk.IM@gmail.com; 'Gleb Smirnoff' >>>> Cc: freebsd-net@freebsd.org >>>> Subject: Re: ng_patch and 802.11Q >>>> >>>> Hi Gleb, >>>> I read the script you given but still no clue :-( >>>> >>>> On 2013/11/9 11:09 AM, rozhuk.im@gmail.com wrote: >>>>> >>>> >> http://www.netlab.linkpc.net/download/software/FreeBSD/mcastbridge/mc >>>> as >>>> tbr2. >>>>> sh >>>>> http://www.netlab.linkpc.net/forum/index.php?topic=796.0 >>>>> >>>>> >>>>>> It seems a good idea... Do you have some example working on >>>> ng_ether? >>>>>> The manpage of ng_ether seems no example... >>>>>> >>>>>> On 11/8/2013 6:22 PM, Gleb Smirnoff wrote: >>>>>>> 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 >>>>>>> B> 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 >>>>>>> B> simplex.remote.net >>>>>>> B> >>>>>>> B> It seems ng_patch can only modify IP header. However, the >>>>>>> B> position of VLAN header is before IP header and after Ethernet >>>>>>> B> header. How can I 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. >>>>>>> >>>>> >>>>> >>>>> >>>>> >>> >>> > >