From owner-freebsd-jail@FreeBSD.ORG Fri Jul 25 03:31:19 2014 Return-Path: Delivered-To: freebsd-jail@FreeBSD.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97DDF97D; Fri, 25 Jul 2014 03:31:18 +0000 (UTC) Date: Thu, 24 Jul 2014 23:31:14 -0400 From: Glen Barber To: Warren Block Subject: Re: check_dhcp Message-ID: <20140725033114.GZ1065@hub.FreeBSD.org> References: <20140725032045.GY1065@hub.FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lBR2yNlwcY132B3M" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-jail@FreeBSD.org X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2014 03:31:19 -0000 --lBR2yNlwcY132B3M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 24, 2014 at 09:25:06PM -0600, Warren Block wrote: > On Thu, 24 Jul 2014, Glen Barber wrote: >=20 > >On Thu, Jul 24, 2014 at 09:14:24PM -0600, Warren Block wrote: > >>net-mgmt/monitoring-plugins has a check_dhcp program used to test the > >>availability of a remote DHCP server. It has BSD-specific code, but se= ems > >>fairly dated and only works when all supposedly optional parameters are > >>given. However, it does work on a normal machine: > >> > >> OK: Received 1 DHCPOFFER(s), 1 of 1 requested servers responded, max = lease time =3D 600 sec. > >> > >>But it does not work inside a jail, seeing no offers: > >> > >> CRITICAL: No DHCPOFFERs were received. > >> > >>Raw sockets and bpf are enabled in the jail. dhclient in the jail can > >>actually get a lease. Is there anything else that needs to be configur= ed to > >>allow this to work in a jail? > >> > >> > >> > >>After 'make -C /usr/ports/net-mgmt/monitoring-plugins', the code in que= stion > >>is check_dhcp.c in > >>work/monitoring-plugins-monitoring-plugins-b5611ea/plugins-root. It gi= ves > >>these type of errors: > >> > >> % ./check_dhcp -s 192.168.1.1 > >> Error: if_nametoindex error - Device not configured. > >> > >> % ./check_dhcp -s 192.168.1.1 -i em0 > >> Error: Couldn't get hardware address from em0. sysctl 2 error - No su= ch file or directory. > >> > >>After adding -m , it gives no errors but never sees a > >>response. > > > >The problem, I suspect, is that bpf(4) does not exist in the jail. >=20 > It's there: >=20 > # ls -lh /dev/b* > crw------- 1 root wheel 0x12 Jul 24 21:00 /dev/bpf > lrwxr-xr-x 1 root wheel 3B Jul 24 20:08 /dev/bpf0 -> bpf >=20 This is within the jail? > dhclient would not work without it, I think. But something else is > different between the jail and a real machine. Glen --lBR2yNlwcY132B3M Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJT0c+CAAoJELls3eqvi17QHtwP/1l+1okPVixTLggVYzcBRD7E 5Uwnkm6e9dJcRP63i+HvNqYQdT5gdxDh4a7N4sAotUId6HaAoABYXNXuJLjAGzP0 qjcU8Sao/U7hyfy559OvXYV5ST7BtqiGNqz1s1Aznlm3vmpfF8+LyC5uOlJ1bMW/ c8Wt9+ToxSnglY4C1R253TPaVx7LULiufYUbtbGROsoJspLMEgTL6EKTxj8F2UOk tti+9JrFy/x3e9fcwMzLWeeUDfC4fWbj6O3Jge9gnHfX/9tUeX8gjPiVeACSoFvr ujJSfPiJuKt8gnN81ex/8PugbrhrN4sVOAJgDvPq82ngy5fOKEm4kxtReU8sOkPh 623Lx19DnJ/EztoBxyJe2JzmySbGZ7224fG2a7uV9/NQthtvfjlMNhxhsrwO5Z7R FS5xgEvaYRM6J9Hv0WeurNQ0SDimruyMxx9NLtmgoZU+aE8UOkcfLJ3JgJ0wbqE5 bnzO5DyTjWwjvpoRLxPCRrhPvUxW+QFdK55E4vmtyI5/vStPHeHqOIri2c8ZO7xW hw6u/ozchL7sge2oX4JiigDgqV8Oh7LCOik4LCrFo0n0ob6AVtFGrosSesYgQM8m ddG9qWkwXl1To5cxJQG70e5u+rhTIT9YrgdNojxHGpbOCDh+NO8TB16MtCbHo6GL vKEN8t4MVLeyFELFFRtW =Pq18 -----END PGP SIGNATURE----- --lBR2yNlwcY132B3M--