From owner-freebsd-jail@freebsd.org Tue Oct 10 20:25:04 2017 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 BF252E3C0C6 for ; Tue, 10 Oct 2017 20:25:04 +0000 (UTC) (envelope-from srs0=q5lg=bj=sigsegv.be=kristof@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 744736B6EE for ; Tue, 10 Oct 2017 20:25:04 +0000 (UTC) (envelope-from srs0=q5lg=bj=sigsegv.be=kristof@codepro.be) Received: from [192.168.228.1] (ptr-8ripyygwistxihisxdg.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:a4bd:5d27:6ea9:2df4]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 472D6795D; Tue, 10 Oct 2017 22:25:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sigsegv.be; s=mail; t=1507667101; bh=4tNK1UmNAoMp8J6HWlzNJm+bCXAA7OZeNAX7irRfxug=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EFXuqc3a7gSXIDgfnB9qLWbrGJHzjUbZWBEaE+voSE5UYft8YtQ1x78ODYVYMbSWr fgFIZMmOon1IHcGBPkZvwF5JRFQva0GOgTXIHmOFEtK75VrFlu2gfoG2VJIwdt4zjZ +ANCl5EV+EBP7rTLQEJ8QjdQkpFf+8Y2+IQCMrN0= From: "Kristof Provost" To: "Goran =?utf-8?q?Meki=C4=87?=" Cc: freebsd-jail@freebsd.org Subject: Re: VNET jail and dhclient Date: Tue, 10 Oct 2017 22:24:59 +0200 Message-ID: <6D37D4AC-9DF4-4D55-8614-43CFC6BDD45E@sigsegv.be> In-Reply-To: <20171009072547.jauim6tlfennydf5@hal9000.meka.no-ip.org> References: <20171009072547.jauim6tlfennydf5@hal9000.meka.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_964E1972-21E6-42BF-A30E-F8611AF959C5_="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Mailer: MailMate (2.0BETAr6092) 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: Tue, 10 Oct 2017 20:25:04 -0000 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_964E1972-21E6-42BF-A30E-F8611AF959C5_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 9 Oct 2017, at 9:25, Goran Meki=C4=87 wrote: > Hello, > > TLDR: I can setup static IP or use dhcpcd to get address, but not dhcli= ent. > > Let me elaborate. I run 12-CURRENT on my laptop and use CBSD as jail ma= nager (I don't think it matters). > What version of CURRENT are you using? > # dhclient eth0 > chroot > exiting. > > This is what I found with truss: https://gist.github.com/anonymous/36a4= e2bf1760198971934ff609a7d0de#file-gistfile1-txt-L227-L228. Selected lines= are what I think is the problem. Offending line in the code is probably = https://svnweb.freebsd.org/base/head/sbin/dhclient/dhclient.c?revision=3D= 317915&view=3Dmarkup#l507. With that asumption, Oleg, CBSD author, notice= d that the following "patch" works: > Is there any chance you don=E2=80=99t have /var/empty in your jail? I do this to create a simple vnet jail: sudo jail -c name=3Dalcatraz persist vnet vnet.interface=3Depair0b (in the jail) dhclient epair0b And see: =E2=80=A6 fsync(0x9) =3D 0 (0x0) close(8) =3D 0 (0x0) socket(PF_ROUTE,SOCK_RAW,0) =3D 8 (0x8) shutdown(8,SHUT_WR) =3D 0 (0x0) cap_rights_limit(8,{ CAP_READ,CAP_EVENT }) =3D 0 (0x0) chroot("/var/empty") =3D 0 (0x0) chdir("/") =3D 0 (0x0) setgroups(0x1,0x800e2c1e4) =3D 0 (0x0) =E2=80=A6 I also see the DCHP request packets on the other end of the epair interfa= ce. Regards, Kristof --=_MailMate_964E1972-21E6-42BF-A30E-F8611AF959C5_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQJHBAEBCAAxFiEE4RTZ6pCe1GmPVxelfRWRxp768oYFAlndLJsTHGtyaXN0b2ZA c2lnc2Vndi5iZQAKCRB9FZHGnvryhlhhD/0QkBZGKUTgZtCgpnWTVD4A+p5mNEJP ctC11BminKUlw7AVggi5EoyAy/xCTyEyrJKXX3nsCzvsCf7rfc9XVhUK1dR0thrV FMj+L7kqZS8MdVJXhxaVgt4f3KQp7VduGS5BdI8M09RZ1RoV8PxvNSfQYPpvQYVW RyvHbDkMBC8Dewf7wmUPN2lr2T4h6aeeAR2aaHi0UaY8LRcgVVVLSBkh49z7jXqt Ve5Bs/bsyqxoSqutsB/xMOtoSnPYAVQWyHIkGPiaRl1JuujwwXXT1M1wExD9v68w 4DnxV17PTmwPpyIwpuzSDCmDSnu0tLPY8FVYJlPbBVZ91qmcoT/vhWeHk4VzDd5D et1IImObVVksYXBhQJBphUrz7seYzGXKlVQU8AKqoleh8J9LmLj5NmAJrPFWWPNK MSKUf8ADEAg6toxGrwc9Qq1QaKHx+hgF+LkAZI7AbhOkZt7W9c3Wl1JaOonP3Fy4 sBQ1VejHwcaFClKdDQn/vlwh1s8t5T4fYYW5Hirvl+W6q8sGvLWZTVo81Gdh3P+U T1A7XSiw+NC4A5yTqobHE5o8bhokgtDYrEuQ6mmXSw7o+2Q5XOW80gyQEyhdcU8l XQ/04H38i6zTf73lEyQ4bwNzBxR57qLSMtG+/0c7vfycO6ggZrnDTFzty3jOvdl2 JQ0vEDQLly0ubA== =XrZS -----END PGP SIGNATURE----- --=_MailMate_964E1972-21E6-42BF-A30E-F8611AF959C5_=--