From owner-freebsd-jail@freebsd.org Sun Dec 13 18:00:16 2015 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E36D3A43F25 for ; Sun, 13 Dec 2015 18:00:16 +0000 (UTC) (envelope-from marcel.plouf@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 870971A5F; Sun, 13 Dec 2015 18:00:16 +0000 (UTC) (envelope-from marcel.plouf@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id p66so34031686wmp.1; Sun, 13 Dec 2015 10:00:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=BSWHdAD16AR9HV0dG8hYM2ckZmA1sYh0Av+sJiL4MZA=; b=nCUuxaVAta2I7KF70Dbzdw4pBJUXyzaD+6qWBJEYM2XBZA2dvZZiCP99sHDBXbkygC Q9Q9TLsFCtCh7T5WUtpJdmcDR+d0Pq0CwLHOl2kyYGd5M06/25ZLZEKk2XbkKcIv6LOp IjJX3RXjTWK9hvu8N3XKJ8vuFS9FJ+Tf31ojpbYFHADXDPSlUROoGMSWKPXcTh8ibg2i hje11Cfuf/YWDt9+RUs2hhNNWS4WdcvXvPiM+ksnHfcdc7YzEV6NEZoEqmztFHoQvQeD 09Te3TcynyL7sBveQfnKL7AnMnHa+mLQrMT7NPYZ6jG0TR6x4jWuqWr1l4pxNyBaNb+d TwDw== X-Received: by 10.28.96.193 with SMTP id u184mr18634714wmb.64.1450029615050; Sun, 13 Dec 2015 10:00:15 -0800 (PST) Received: from [192.168.1.244] (85-171-136-71.rev.numericable.fr. [85.171.136.71]) by smtp.gmail.com with ESMTPSA id q4sm26147414wja.6.2015.12.13.10.00.13 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Dec 2015 10:00:13 -0800 (PST) Subject: Re: Configuring network without ezjail To: James Gritton , freebsd-jail@freebsd.org References: <566B67F7.1090404@gmail.com> <566B5CB6.8050009@erdgeist.org> <566B7D7E.2070507@gmail.com> <566D0DA8.8060502@gmail.com> <2c9d05b19812c983e0da5bd0513fab4f@gritton.org> From: marcel Message-ID: <566DC037.5010100@gmail.com> Date: Sun, 13 Dec 2015 19:00:07 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <2c9d05b19812c983e0da5bd0513fab4f@gritton.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 18:00:17 -0000 On 13/12/2015 06:07, James Gritton wrote: > On 2015-12-12 23:18, marcel wrote: >> On 12/12/2015 18:10, James Gritton wrote: >>> On 2015-12-11 18:50, marcel wrote: >>>> No I don't get to have an IP address... Yet I have writed this in my >>>> host's rc.conf: >>>> >>>> jail_enable="YES" >>>> jail_list="thename" >>>> jail_guantanamo_rootdir="thepath" >>>> jail_guantanamo_hostname="thename" >>>> jail_guantanamo_ip="192.168.0.12" >>>> >>>> and I use the command: >>>> >>>> jail thepath thename 192.168.0.12 /bin/csh >>>> >>>> to connect to my jail... >>> >>> Is the jail even created? You show jail_name as "thename", but the >>> jail config variables are jail_quantanamo_*. So when you say >>> "thename" do you really mean quantanamo? Because if you don't, then >>> the jail won't get configured at startup. >>> >>> The command you're using to connect to the jail is actually a command >>> that creates a jail. That's probably not what you want, as that jail >>> is likely to disappear again after you exit from it. You should be >>> using jexec(8), assuming your jail has been properly created in the >>> first place. >>> >>> Now to the IP address: is your entire box behind some gateway, where >>> it uses a 192.168 address? If it isn't, you'll need more than to just >>> declare such an address - you'll need a jail with vnet, which is >>> rather more complex. But if it is, then the question becomes: is >>> 192.168.0.12 the host address, i.e. are you creating a jail that >>> shares the host address? If you are it should work, but most jails >>> aren't done this way. >>> >>> Specifying a jail's IP address only tell which of the host's existing >>> addresses to use. If that address isn't already set up, it won't be >>> used - unless you tell it to. If you're still using the rc.conf-based >>> jail specification, you can set jail_interface (or >>> jail_quantanamo_interface) to the name of the network interface where >>> the host's main IP address lives (e.g. "em0" or somesuch). Such a >>> config line is likely all you need. >>> >>> - Jamie >> Yes, the jail is created with the make installworld, make distribution, >> jail -c , etc method and I launch it with jail -c guantanamo and connect >> to it with jexec id shell. >> >> Yes, sorry I have badly explained so jail_name="thename", thename is >> guantanamo. >> >> My host is behind a router that provide me an internet access yes and >> yes 192.168.0.12 is my host ip so yes my jail share the host address. >> jls command show me this address but ifconfig command (in my jail) show >> me no address... >> >> I've read that in my case I've just need of jail_enable="YES" in my >> rc.conf... I will add with most of jail_guantanamo* variable and test... > > If 192.168.0.12 is your host IP, try creating the jail without IP > address restrictions. I don't think you can do that with with the old > rc.conf-based specification, but with a jail.conf file (or from a > command line), you just add "ip4=inherit" and don't mention an > ip4.address at all. That will create a jail that has access to all of > the host IP addresses. > > - Jamie I was trying what you said but the remote machine where the jail is on has gone to shutdown (I don't know why...) and I have to do some kilometers to turn on and I haven't the time for the moment so subject is closed for the moment... Thanks a lot for your help, I will try again the next time...