From owner-freebsd-questions@freebsd.org Sat Apr 1 21:44:02 2017 Return-Path: Delivered-To: freebsd-questions@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 8B329D2882E for ; Sat, 1 Apr 2017 21:44:02 +0000 (UTC) (envelope-from byrnejb@harte-lyne.ca) Received: from inet08.hamilton.harte-lyne.ca (inet08.hamilton.harte-lyne.ca [216.185.71.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "inet08.hamilton.harte-lyne.ca", Issuer "CA_HLL_ISSUER_2016" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FEEB96F for ; Sat, 1 Apr 2017 21:44:01 +0000 (UTC) (envelope-from byrnejb@harte-lyne.ca) Received: from localhost (localhost [127.0.0.1]) by inet08.hamilton.harte-lyne.ca (Postfix) with ESMTP id 29BAA623A8 for ; Sat, 1 Apr 2017 17:43:54 -0400 (EDT) X-Virus-Scanned: amavisd-new at harte-lyne.ca Received: from inet08.hamilton.harte-lyne.ca ([127.0.0.1]) by localhost (inet08.hamilton.harte-lyne.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZXWqdbb1zn5x for ; Sat, 1 Apr 2017 17:43:42 -0400 (EDT) Received: from webmail.harte-lyne.ca (inet04.hamilton.harte-lyne.ca [216.185.71.24]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by inet08.hamilton.harte-lyne.ca (Postfix) with ESMTPSA id AF7946237E for ; Sat, 1 Apr 2017 17:43:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=harte-lyne.ca; s=dkim_hll; t=1491083022; bh=5oECL/1Im0aVTR8g5p7STugHketIu/0QdI1JtKlbMiQ=; h=Date:Subject:From:To:Reply-To; b=yhqq6Wnyr9CEjp7BwUMSpTTVQwk4v66adqiKWxGiQcHrJGTsroOl9aWsrVyQHvQsN 7b1GCvUtvSlWNpgf05kNLbyRPFjnGe/cpkf2vaD8Q0Yv1t/hMHfuqpnv1EMs2ghMBg htlG6xPVf51IDmVWzdcJfmU3vmIp8QWBDspVe1J3EWay2UlL5RhvLhuZ7kxdKEJcW4 m+NsNfVTrQQ863JW8mogYCr6Zl9ne5QyTXFEsriIwcwDOVgXqD3WCGvNQENfFkDMvH FPzYitkgtJyzj8dm1riYphB4AqwGUherStUFZntOI59VZmf+PKZTDEN5Ud5PPdcjO4 RkF/dylyI6mNQ== Received: from 216.185.71.44 (SquirrelMail authenticated user byrnejb_hll) by webmail.harte-lyne.ca with HTTP; Sat, 1 Apr 2017 17:43:42 -0400 Message-ID: <115d4cb1df2a32f979091b29f7aa2e0f.squirrel@webmail.harte-lyne.ca> Date: Sat, 1 Apr 2017 17:43:42 -0400 Subject: Multiple Jails on a single host From: "James B. Byrne" To: freebsd-questions@freebsd.org Reply-To: byrnejb@harte-lyne.ca User-Agent: SquirrelMail/1.4.22-4.el6 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 21:44:02 -0000 I have a FreeBSD host on which I wish to have two jails. I have set-up the first using ezjail and the relevant information for it follows: /etc/rc.conf ### Jailed Services jail_enable="YES" # Set to NO to disable starting of any jails ezjail_enable="YES" # Enable ezjail jail manager jail_list="hlldns02" # Space separated list of jail names cloned_interfaces="lo1" ipv4_addrs_lo1="192.168.209.33/32" /usr/local/etc/ezjail/hlldns02 export jail_hlldns02_hostname="hlldns02" export jail_hlldns02_ip="lo1|127.0.1.1,em0|192.168.209.33" ' This jail has sshd configured and enabled. With the jail started I can reach it with "ssh 192.168.209.33 -t -Y 'bash || sh'". It passes over the host's firewall without problem. However when I add the following additional configuration in /etc/rc.conf to handle the second jail then I can no longer connect to the first jail. Instead I receive this error: ssh: connect to host 192.168.209.33 port 22: No route to host If I try to ping it I get this: ping 192.168.209.33 PING 192.168.209.33 (192.168.209.33) 56(84) bytes of data. >From 192.168.209.2:icmp_seq=2 Redirect Host(New nexthop: 192.168.209.33) >From 192.168.209.2:icmp_seq=3 Redirect Host(New nexthop: 192.168.209.33) >From 192.168.209.2:icmp_seq=4 Redirect Host(New nexthop: 192.168.209.33) >From 192.168.209.2:icmp_seq=4 Destination Host Unreachable This is the altered configuration: /etc/rc.conf cloned_interfaces="lo1" ipv4_addrs_lo1="192.168.209.33/32" cloned_interfaces="lo2" ipv4_addrs_lo2="192.168.209.18/32" /usr/local/etc/ezjail/hllmx18 export jail_hllmx18_hostname="hllmx18" export jail_hllmx18_ip="lo2|127.0.2.1,em0|192.168.209.18" If I remove the second set of lo cloning statements from rc.conf then the first jail starts and can be connected to but the second jail will not start at all. Obviously I am missing some critical piece of information respecting jails and it seems to involve the loopback interface. What entries should be in /etc/rc.conf to handle the two jails I have outlined above such that I can communicate to them directly? Thanks. -- *** e-Mail is NOT a SECURE channel *** Do NOT transmit sensitive data via e-Mail Do NOT open attachments nor follow links sent by e-Mail James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3