From owner-freebsd-jail@freebsd.org Wed Dec 14 20:30:20 2016 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 ED7BAC77224 for ; Wed, 14 Dec 2016 20:30:20 +0000 (UTC) (envelope-from trashcan@ellael.org) Received: from mx1.enfer-du-nord.net (mx1.enfer-du-nord.net [IPv6:2001:41d0:1008:bcb:1:1:0:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC619E4C for ; Wed, 14 Dec 2016 20:30:20 +0000 (UTC) (envelope-from trashcan@ellael.org) Received: from [IPv6:2003:8c:2e04:5401:2d94:6496:ed77:a6cf] (p2003008C2E0454012D946496ED77A6CF.dip0.t-ipconnect.de [IPv6:2003:8c:2e04:5401:2d94:6496:ed77:a6cf]) by mx1.enfer-du-nord.net (Postfix) with ESMTPSA id 3tf7VV46dMzjyp for ; Wed, 14 Dec 2016 21:30:10 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: multiple interfaces for jail.conf(1) and jail_set(2) From: Michael Grimm In-Reply-To: <0ED7F403-F14E-4A72-8E54-AF74AAE15061@blackskyresearch.net> Date: Wed, 14 Dec 2016 21:30:09 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <45822529-2096-4B32-8515-F5875BEF7101@ellael.org> References: <0ED7F403-F14E-4A72-8E54-AF74AAE15061@blackskyresearch.net> To: freebsd-jail@FreeBSD.org X-Virus-Scanned: clamav-milter 0.99.2 at mail X-Virus-Status: Clean X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2016 20:30:21 -0000 Isaac (.ike) Levy wrote: > Can I specify multiple IP interfaces and assign IP=E2=80=99s to them = using jail.conf? Not sure if I understand your question correctly, but I do define the = following in my jail.conf for VNET jails: # # host dependent global settings # $ip6prefixLOCAL =3D "fd00:dead:beef:1234"; # # global jail settings # host.hostname =3D "${name}"; path =3D "/usr/home/jails/${name}"; mount.fstab =3D "/etc/fstab.${name}"; exec.consolelog =3D "/var/log/jail_${name}_console.log"; vnet =3D "new"; vnet.interface =3D "epair${jailID}b"; exec.clean; mount.devfs; persist; # # network settings to apply/destroy during start/stop of every jail # exec.prestart =3D "sleep 2"; exec.prestart +=3D "/sbin/ifconfig epair${jailID} create up"; exec.prestart +=3D "/sbin/ifconfig bridge0 addm = epair${jailID}a"; exec.start =3D "/sbin/sysctl net.inet6.ip6.dad_count=3D0"; exec.start +=3D "/sbin/ifconfig lo0 127.0.0.1 up"; exec.start +=3D "/sbin/ifconfig epair${jailID}b inet = ${ip4_addr}"; exec.start +=3D "/sbin/ifconfig epair${jailID}b inet6 = ${ip6_addr}"; exec.start +=3D "/sbin/route add default -gateway = 10.1.1.254"; exec.start +=3D "/sbin/route add -inet6 default -gateway = ${ip6prefixLOCAL}::254"; exec.stop =3D "/sbin/route del default"; exec.stop +=3D "/sbin/route del -inet6 default"; exec.stop +=3D "/bin/sh /etc/rc.shutdown"; exec.poststop =3D "/sbin/ifconfig epair${jailID}a destroy"; # # individual jail settings # dns { $jailID =3D 1; $ip4_addr =3D 10.1.1.1; $ip4_addr_2 =3D 10.1.1.2; $ip6_addr =3D ${ip6prefixLOCAL}::1/64; $ip6_addr_2 =3D ${ip6prefixLOCAL}::2/64; exec.start +=3D "/sbin/ifconfig epair${jailID}b inet = ${ip4_addr_2} alias"; exec.start +=3D "/sbin/ifconfig epair${jailID}b inet6 = ${ip6_addr_2} alias"; exec.start +=3D "/bin/sh /etc/rc"; } etc. Again, not sure if I do understand your issue correctly, but the shown = examples of exec.start, exec.stop, etc. are quite versatile to use. I do start/stop my jails by "service jail start/stop". Hope that helps, Michael