DHCPD under OpenBSD
Friday, 2. January 2009, 09:55:31
OpenBSD is really really secure ! It's enough and perfect to run a gateway, pf syntax is good and clear enough.
And it's a common problem with dhcpd under openbsd. OpenBSD dhcpd default using chroot but it still looking for /dev/bpf device and /,/var were mounted with nodev "dhcpd error message : Can't find free bpf". Then you should create chroot env for dhcpd to run.
Thanks to soup4you2
And it's a common problem with dhcpd under openbsd. OpenBSD dhcpd default using chroot but it still looking for /dev/bpf device and /,/var were mounted with nodev "dhcpd error message : Can't find free bpf". Then you should create chroot env for dhcpd to run.
the scope of this howto is just to simply chroot it.
mkdir -p /usr/chroot/dhcpd
mkdir -p /usr/chroot/dhcpd/dev
mkdir -p /usr/chroot/dhcpd/etc
mkdir -p /usr/chroot/dhcpd/usr/lib
mkdir -p /usr/chroot/dhcpd/usr/libexec
mkdir -p /usr/chroot/dhcpd/usr/local/sbin
mkdir -p /usr/chroot/dhcpd/usr/local/etc
mkdir -p /usr/chroot/dhcpd/var/db
mkdir -p /usr/chroot/dhcpd/var/run
mknod /usr/chroot/dhcpd/dev/null c 2 2
chown root:sys /chroot/dhcpd/dev/null
chmod 666 /chroot/dhcpd/dev/null
BPF="`ls -l /dev/bpf0 | awk '{ print $5; }' | sed -e 's/,//g'`"
export BPF
cd /usr/chroot/dhcpd/dev
mknod bpf0 c $BPF 0
mknod bpf1 c $BPF 1
chmod 0600 bpf*
cp /usr/lib/libc.so.5 /usr/chroot/dhcpd/usr/lib/libc.so.5
cp /usr/libexec/ld-elf.so.1 /usr/chroot/dhcpd/usr/libexec/ld-elf.so.1
cp /usr/local/etc/dhcpd.conf /usr/chroot/dhcpd/usr/local/etc/dhcpd.conf
cp /usr/local/sbin/dhcpd /usr/chroot/dhcpd/usr/local/sbin/dhcpd
cp /var/db/dhcpd* /usr/chroot/dhcpd/var/db/
now test it
chroot /usr/chroot/dhcpd /usr/local/sbin/dhcpd
Thanks to soup4you2








How to use Quote function: