Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2014 23:20:45 -0400
From:      Glen Barber <gjb@FreeBSD.org>
To:        Warren Block <wblock@wonkity.com>
Cc:        freebsd-jail@FreeBSD.org
Subject:   Re: check_dhcp
Message-ID:  <20140725032045.GY1065@hub.FreeBSD.org>
In-Reply-To: <alpine.BSF.2.11.1407242042240.3624@wonkity.com>
References:  <alpine.BSF.2.11.1407242042240.3624@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--KH9S6eoVXLBawpUJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 seems
> fairly dated and only works when all supposedly optional parameters are
> given.  However, it does work on a normal machine:
>=20
>   OK: Received 1 DHCPOFFER(s), 1 of 1 requested servers responded, max le=
ase time =3D 600 sec.
>=20
> But it does not work inside a jail, seeing no offers:
>=20
>   CRITICAL: No DHCPOFFERs were received.
>=20
> 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 configured=
 to
> allow this to work in a jail?
>=20
>=20
>=20
> After 'make -C /usr/ports/net-mgmt/monitoring-plugins', the code in quest=
ion
> is check_dhcp.c in
> work/monitoring-plugins-monitoring-plugins-b5611ea/plugins-root.  It gives
> these type of errors:
>=20
>   % ./check_dhcp -s 192.168.1.1
>   Error: if_nametoindex error - Device not configured.
>=20
>   % ./check_dhcp -s 192.168.1.1 -i em0
>   Error: Couldn't get hardware address from em0. sysctl 2 error - No such=
 file or directory.
>=20
> After adding -m <jail card's MAC>, it gives no errors but never sees a
> response.

The problem, I suspect, is that bpf(4) does not exist in the jail.

Glen


--KH9S6eoVXLBawpUJ
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJT0c0NAAoJELls3eqvi17QjHsP/3m3hBvbsop21I9PWdSwQfa9
H1mTmXT+FJDeuNaA1aSZ3jzqGt0+oqVUVPQ0JBZ8NsGEymrAzPyn8i6d7tg+sNEp
m9KFBSr1opaqbr7Cu1Bjp9t/3Vfy3y3bJKFo1xguJK0hP0JIE6iXMtSTxbesA+6t
t8dI7R2Dt6jqK7Bdatn7c3MUKz3VOc21BL3X1J4MGJY6yPJSEFe0e9VXsFNNIseR
i2K8HvL6OGb4i+XYCYI5VDv6obCguP7KKIaGnVCeuEvDTBxYHQ0HY+KAoAHlwcia
hwzI/JwdTDvodvyO2JNYkWkdwdBLihrxI0X3GV1SMaIWC3Lux9IoI1I53iL3jwaN
CRsZs2ASKwGOWnBZssDphkEs3wbrVkmOOfX3w+2HNlqxvEFojl49pDTNNqzdU52+
f8mNwJIHxl0GIIifyfg1JFt2AYgePfG6Jg0nSz6jgj4kah1+9nVHXQUAVVhRar75
YgkqXcMKVQe+dOLfuhQXkGulEMxFKozqtfb5CRhjvn4qyzWpkc/IUY54ruJMtyAg
JDAhLi3OK8wfG4KOIWxAJsWy4rM6+fWHzq9nn5B/lnF8pMT3QDdbopqm/9sLrt/S
T0VcW0AqP38rINaersw/TyIGsYj5LE+SfShP8xGOkYHrwNWzC50YftPHKr+pU2pZ
4qG6bmx3P8Ltkr+kphMI
=Ewnu
-----END PGP SIGNATURE-----

--KH9S6eoVXLBawpUJ--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140725032045.GY1065>