From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 6 19:47:20 2014 Return-Path: Delivered-To: freebsd-hackers@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 ESMTPS id 18E3B9CC for ; Thu, 6 Mar 2014 19:47:20 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D752015B for ; Thu, 6 Mar 2014 19:47:19 +0000 (UTC) Received: from smarthost.fisglobal.com ([10.132.206.193]) by ltcfislmsgpa02.fnfis.com (8.14.5/8.14.5) with ESMTP id s26JlIBJ001131 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 6 Mar 2014 13:47:18 -0600 Received: from THEMADHATTER (10.242.181.54) by smarthost.fisglobal.com (10.132.206.193) with Microsoft SMTP Server id 14.3.174.1; Thu, 6 Mar 2014 13:47:16 -0600 From: Sender: Devin Teske To: "'Eugene Grosbein'" , "'Joe Nosay'" References: <53181410.1030107@freebsd.org> <5318B836.7040301@grosbein.net> In-Reply-To: <5318B836.7040301@grosbein.net> Subject: RE: How do I create a cloned interface when there is no static connection? Date: Thu, 6 Mar 2014 11:47:13 -0800 Message-ID: <19cd01cf3974$dffa5bf0$9fef13d0$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQGFkmzaIuYOdOXVuBBwiRydIe9+DQJc1pq+AktiUF0BR1iDyps4QQ5g Content-Language: en-us X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2014-03-06_06:2014-03-05,2014-03-06,1970-01-01 signatures=0 Cc: 'FreeBSD Hackers' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 19:47:20 -0000 > -----Original Message----- > From: Eugene Grosbein [mailto:eugen@grosbein.net] > Sent: Thursday, March 6, 2014 10:03 AM > To: Joe Nosay > Cc: FreeBSD Hackers > Subject: Re: How do I create a cloned interface when there is no static > connection? > > On 07.03.2014 00:39, Joe Nosay wrote: > > > I'll need a dummy interface inside of the that can be bridged to > > wlan0 outside of the jail. Normal jail with aliases. > > Try epair(4) and give one part of pair to jail and bridge another part with > wlan0. > Never tried bridging a wlan with netgraph, but I wonder if the method I use for bridging Ethernet with netgraph would work... Using the ngctl command to create an ng_bridge and then multiple ng_eiface devices that you can be shoved into the jail. kldload ng_ether kldload ng_bridge kldload ng_eiface ngctl + mkpeer {IFACE}: bridge lower link0 + connect {IFACE}: {IFACE}:lower upper link1 + name {IFACE}:lower {IFACE}bridge + quit ifconifg {IFACE} up ngctl + msg {IFACE}: setpromisc 1 + msg {IFACE}: setautosrc 0 + mkpeer {IFACE}:lower eiface link{N} ether + name {IFACE}bridge:link{N} + show -n {IFACE}bridge: Name: ngeth0 Type: eiface ID: XXXXXXXX Num hooks: N + name {IFACE}bridge:link{N} {NEWIFACE} ifconfig ngeth0 name {NEWNAME} ifconfig {NEWNAME} vnet {JID} Taking care to replace the following from above: {IFACE} - the name of the interface you want to bridge (eg, em0) {N} - link number (starts at 2; increments by-one for each new eiface) {NEWIFACE} - the name of the new eiface (ngethN) device to create {JID} - the jail ID of the jail you want to shove the interface into Of course, never tried this with WiFi. -- Devin _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.