From owner-freebsd-net@FreeBSD.ORG Mon Dec 17 18:03:41 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7DD16A417 for ; Mon, 17 Dec 2007 18:03:41 +0000 (UTC) (envelope-from zec@icir.org) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id 27E5813C508 for ; Mon, 17 Dec 2007 18:03:41 +0000 (UTC) (envelope-from zec@icir.org) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id 525A29B64D; Mon, 17 Dec 2007 18:32:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.7 Received: from [192.168.200.112] (unknown [161.53.19.16]) by xaqua.tel.fer.hr (Postfix) with ESMTP id B133D9B648 for ; Mon, 17 Dec 2007 18:32:46 +0100 (CET) From: Marko Zec To: freebsd-net@freebsd.org Date: Mon, 17 Dec 2007 18:32:41 +0100 User-Agent: KMail/1.9.7 References: <20071217211545.3a28981a.zhouzhouyi@FreeBSD.org> In-Reply-To: <20071217211545.3a28981a.zhouzhouyi@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712171832.41370.zec@icir.org> Subject: Re: using netgraph to create a pair of pseudo ethernet interface X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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, 17 Dec 2007 18:03:41 -0000 On Monday 17 December 2007 14:15:45 zhouyi zhou wrote: > Dear All, > Any one know how to us netgraph to create a pair of pseudo > ethernet interface. The packet go out from one and in another. tpx32# ngctl mkpeer eiface ether ether tpx32# ngctl mkpeer eiface ether ether tpx32# ngctl l There are 3 total nodes: Name: ngctl1446 Type: socket ID: 00000006 Num hooks: 0 Name: ngeth1 Type: eiface ID: 00000005 Num hooks: 0 Name: ngeth0 Type: eiface ID: 00000003 Num hooks: 0 tpx32# ngctl connect ngeth0: ngeth1: ether ether tpx32# ngctl l There are 3 total nodes: Name: ngctl1448 Type: socket ID: 00000008 Num hooks: 0 Name: ngeth1 Type: eiface ID: 00000005 Num hooks: 1 Name: ngeth0 Type: eiface ID: 00000003 Num hooks: 1 tpx32#