From owner-freebsd-jail@freebsd.org Sun May 29 14:51:50 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 9A85EB532F2 for ; Sun, 29 May 2016 14:51:50 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "www.gritton.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 79B2D1DBC; Sun, 29 May 2016 14:51:50 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) by gritton.org (8.15.2/8.15.2) with ESMTPS id u4TETk9E018006 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 29 May 2016 08:29:46 -0600 (MDT) (envelope-from jamie@freebsd.org) Received: (from www@localhost) by gritton.org (8.15.2/8.15.2/Submit) id u4TETjR1018005; Sun, 29 May 2016 08:29:45 -0600 (MDT) (envelope-from jamie@freebsd.org) X-Authentication-Warning: gritton.org: www set sender to jamie@freebsd.org using -f To: freebsd-jail@freebsd.org Subject: Re: [Bug 208001] After turning off the jail does not remove network routes X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 29 May 2016 08:29:45 -0600 From: James Gritton In-Reply-To: <8a575b8b-e9e9-d79c-0b31-708e7bbd35fd@freebsd.org> References: <8a575b8b-e9e9-d79c-0b31-708e7bbd35fd@freebsd.org> Message-ID: <22f599502bd9a932ae41ddb5e70164fa@gritton.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.1.2 X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2016 14:51:50 -0000 On 2016-05-28 19:56, Allan Jude wrote: > On 2016-05-28 20:30, bugzilla-noreply@freebsd.org wrote: >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208001 >> >> --- Comment #5 from Jamie Gritton --- >> Yes, of course there are cases where something besides a /32 is >> appropriate - >> that is why jail(8) allows that. However, as I mentioned it did >> appear that >> you had violated the specification that an alias should be on a >> non-conflicting >> netmask. >> >> The fact remains that I am unable to reproduce your problem. Perhaps >> I could >> if I had your entire configuration - all jails, all other network >> setup. >> >> jail(8) simply calls ifconfig(8) with "alias" to add IP addresses, and >> with >> "-alias" to remove them - see the output of "jail -vc" and "jail -vr". >> The >> jail will not be removed if the "ifconfig ... -alias" command fails, >> which >> implies that the command is succeeding. Unless of course there >> actually is a >> bug in the way jail(8) is running this program. My guess is the >> command is >> succeeding, but isn't removing some arp entry because the alias when >> incorrectly specified when it was created. >> >> If it's clear (from "jail -v") that the correct ifconfig commands are >> being >> run, then this might be considered an ifconfig bug. If the correct >> commands >> aren't being run, then it could be a jail bug. >> > > > I think that is actually the problem > > ifconfig -alias > only accepts the IP address, not with the CIDR. > > #ifconfig lo0 alias 10.0.0.1/24 > #ifconfig lo0 -alias 10.0.0.1/24 > ifconfig: 10.0.0.1/24: bad value > > you want to do just: > #ifconfig lo0 -alias 10.0.0.1 > > So jail(8) needs to strip the /24 off when passing it to ifconfig > -alias Actually is doesn't. While your "-alias" command doesn't work, the one that jail uses does: #ifconfig lo0 inet 10.0.0.1/24 -alias At first I thought it was the "inet" that did it. But further exploration suggests there's something magic about moving the "-alias" to the end. It doesn't make sense, and if I had first tried it with the "[-]alias" tag earlier on the command line I probably would have ended up working out the netmask myself. Serendipity. - Jamie