From owner-freebsd-questions@FreeBSD.ORG Thu Sep 18 17:28:37 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3F773A4 for ; Thu, 18 Sep 2014 17:28:37 +0000 (UTC) Received: from webmail.dweimer.net (24-240-198-187.static.stls.mo.charter.com [24.240.198.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "webmail2.dweimer.local", Issuer "webmail2.dweimer.local" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 55DB99C2 for ; Thu, 18 Sep 2014 17:28:36 +0000 (UTC) Received: from www.dweimer.net (webmail [192.168.5.2]) by webmail.dweimer.net (8.14.7/8.14.7) with ESMTP id s8IHSXmc062353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Sep 2014 12:28:34 -0500 (CDT) (envelope-from dweimer@dweimer.net) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 18 Sep 2014 12:28:33 -0500 From: dweimer To: Fbsd8 Subject: Re: FreeBSD 10 Multiple IPs in a jail Organization: dweimer.net Reply-To: dweimer@dweimer.net Mail-Reply-To: dweimer@dweimer.net In-Reply-To: <541B120D.1000606@a1poweruser.com> References: <480aebf1080d12f717695748ef92b4d4@dweimer.net> <541B120D.1000606@a1poweruser.com> Message-ID: <2da1b5a5a27199828a8cf5595962262e@dweimer.net> X-Sender: dweimer@dweimer.net User-Agent: Roundcube Webmail/1.0.2 Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 17:28:37 -0000 On 09/18/2014 12:10 pm, Fbsd8 wrote: > dweimer wrote: >> I know that we can now do multiple IPs in a jail, and I have a >> configuration that works for it. >> >> jail.conf: >> testjail { >> jid = 100; >> host.hostname = testjail.local; >> ip4.addr = 'em0|10.20.190.190/24'; >> ip4.addr += 'em0|10.20.190.191/24'; >> path = /jails/devel/ROOT; >> allow.mount.devfs; >> mount.devfs; >> allow.sysvipc; >> exec.start = "/bin/sh /etc/rc"; >> exec.stop = "/bin/sh /etc/rc.shutdown"; >> exec.prestart = "/jails/devel/prestart.sh"; >> exec.poststop = "/jails/devel/poststop.sh"; >> exec.consolelog = "/jails/devel/console.log"; >> } >> >> This works great, my question is now that I have this figured out and >> I am done testing it, how can I apply it to a running jail without >> rebooting the jail? >> >> I tried using: >> jail -n testjail -m 'ip4.addr='em0|10.20.190.191/24' >> This replaces the IP on the jail. >> >> Then I tried using: >> jail -n testjail -m 'ip4.addr+='em0|10.20.190.191/24' >> I get an error "unknown parameter ip4.addr+" >> >> Am I stuck waiting until after hours to add the secondary IP when I >> can reboot the production jail? Or is there another way I haven't >> figured out yet to add the secondary IP to the running jail? >> > > How about > jail -n testjail -m > 'ip4.addr='em0|10.20.190.190/24,em0|10.20.190.191/24' That's the ticket, thanks. Just an FYI ran first time without errors but didn't add it to the jail. Then I tried "ifconfig em0 alias 10.20.190.191/24" on the host (10.20.190.190 was in the original jails configuration) and ran it a second time, and success, at least in my test environment, time to try and repeat on the production server. -- Thanks, Dean E. Weimer http://www.dweimer.net/