summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorform <form@openbsd.org>1998-08-19 04:25:45 +0000
committerform <form@openbsd.org>1998-08-19 04:25:45 +0000
commit30a2245dc6651a250cb4062f50b825963b0c2193 (patch)
tree98c829e25bd05e682ec48f7f0d21466d8ecdc5d9
parentbuild that man page too (diff)
downloadwireguard-openbsd-30a2245dc6651a250cb4062f50b825963b0c2193.tar.xz
wireguard-openbsd-30a2245dc6651a250cb4062f50b825963b0c2193.zip
dhcpd: start from rc, controlled by rc.conf; sample config files
-rw-r--r--etc/dhcpd.conf22
-rw-r--r--etc/dhcpd.interfaces7
-rw-r--r--etc/rc20
-rw-r--r--etc/rc.conf4
4 files changed, 42 insertions, 11 deletions
diff --git a/etc/dhcpd.conf b/etc/dhcpd.conf
new file mode 100644
index 00000000000..a137f20b3ab
--- /dev/null
+++ b/etc/dhcpd.conf
@@ -0,0 +1,22 @@
+# $OpenBSD: dhcpd.conf,v 1.1 1998/08/19 04:25:45 form Exp $
+#
+# DHCP server options.
+# See dhcpd.conf(5) and dhcpd(8) for more information.
+#
+
+# Network: 192.168.1.0/255.255.255.0
+# Domain name: my.domain
+# Name servers: 192.168.1.3 and 192.168.1.5
+# Default router: 192.168.1.1
+# Addresses: 192.168.1.32 - 192.168.1.127
+#
+shared-network LOCAL-NET {
+ option domain-name "my.domain";
+ option domain-name-servers 192.168.1.3, 192.168.1.5;
+
+ subnet 192.168.1.0 netmask 255.255.255.0 {
+ option routers 192.168.1.1;
+
+ range 192.168.1.32 192.168.1.127;
+ }
+}
diff --git a/etc/dhcpd.interfaces b/etc/dhcpd.interfaces
new file mode 100644
index 00000000000..f06c4d8fcd4
--- /dev/null
+++ b/etc/dhcpd.interfaces
@@ -0,0 +1,7 @@
+# $OpenBSD: dhcpd.interfaces,v 1.1 1998/08/19 04:25:45 form Exp $
+#
+# List of network interfaces served by dhcpd(8).
+#
+# ep0
+# ed0 le0
+# de1
diff --git a/etc/rc b/etc/rc
index 8b47f8fd7e6..ef9c36fef46 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.85 1998/08/18 23:54:41 marc Exp $
+# $OpenBSD: rc,v 1.86 1998/08/19 04:25:46 form Exp $
# System startup script run by init on autoboot
# or after single-user.
@@ -333,6 +333,16 @@ if [ "X${mrouted_flags}" != X"NO" ]; then
echo -n ' mrouted'; mrouted $mrouted_flags
fi
+# $dhcpd_flags is imported from /etc/rc.conf
+# If $dhcpd_flags == NO or /etc/dhcpd.conf doesn't exist, then dhcpd isn't run.
+if [ "X${dhcpd_flags}" != X"NO" -a -f /etc/dhcpd.conf ]; then
+ touch /var/db/dhcpd.leases
+ if [ -f /etc/dhcpd.interfaces ]; then
+ dhcpd_ifs=`cat /etc/dhcpd.interfaces | awk -F\# '{ print $1; }'`
+ fi
+ echo -n ' dhcpd'; /usr/sbin/dhcpd ${dhcpd_flags} ${dhcpd_ifs}
+fi
+
# $rwhod is imported from /etc/rc.conf;
# if $rwhod == YES, rwhod is run.
if [ X${rwhod} = X"YES" ]; then
@@ -435,15 +445,7 @@ fi
[ -f /etc/rc.local ] && . /etc/rc.local
echo -n standard daemons:
-
-# $apmd_flags is imported from /etc/rc.conf;
-# don't run daemon if $apmd_flags == NO or /usr/sbin/apmd doesn't exist
-if [ "X${apmd_flags}" != X"NO" -a -x /usr/sbin/apmd ]; then
- echo -n ' apmd'; /usr/sbin/apmd ${apmd_flags}
-fi
-
echo -n ' cron'; cron
-
echo '.'
date
diff --git a/etc/rc.conf b/etc/rc.conf
index bc8c5e524e0..71a2d742eeb 100644
--- a/etc/rc.conf
+++ b/etc/rc.conf
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: rc.conf,v 1.25 1998/08/18 23:54:42 marc Exp $
+# $OpenBSD: rc.conf,v 1.26 1998/08/19 04:25:49 form Exp $
# set these to "NO" to turn them off. otherwise, they're used as flags
routed_flags=NO # for 'normal' use: routed_flags="-q"
@@ -15,7 +15,7 @@ timed_flags=NO # for 'normal' use: timed_flags=""
photurisd_flags=NO # for 'normal' use: photurisd_flags=""
mopd_flags=NO # for 'normal' use: mopd_flags="-a"
httpd_flags=NO # for 'normal' use: httpd_flags=""
-apmd_flags=NO # for 'normal' use: apmd_flags=""
+dhcpd_flags=NO # for 'normal' use: dhcpd_flags="-q"
# On some architectures, you must also disable console getty in /etc/ttys
xdm_flags=NO # for 'normal' use: xdm_flags=""