summaryrefslogtreecommitdiffstats
path: root/content/posts/WIP-openbsd-dhcp-server/index.org
diff options
context:
space:
mode:
authorDante Catalfamo2020-07-10 17:50:21 -0400
committerDante Catalfamo2020-07-10 17:50:21 -0400
commitaa0ba35c218ba6b85d7bdbe990a6bba9056e25b4 (patch)
tree2ae649fc9ead1a5d2dc3d13d986e6493eeb6e37b /content/posts/WIP-openbsd-dhcp-server/index.org
parent42359c21c59a01e82348752dbe22d3a35d09bb59 (diff)
downloadblog-aa0ba35c218ba6b85d7bdbe990a6bba9056e25b4.tar.gz
blog-aa0ba35c218ba6b85d7bdbe990a6bba9056e25b4.tar.bz2
blog-aa0ba35c218ba6b85d7bdbe990a6bba9056e25b4.zip
More work on dhcp
Diffstat (limited to 'content/posts/WIP-openbsd-dhcp-server/index.org')
-rw-r--r--content/posts/WIP-openbsd-dhcp-server/index.org24
1 files changed, 17 insertions, 7 deletions
diff --git a/content/posts/WIP-openbsd-dhcp-server/index.org b/content/posts/WIP-openbsd-dhcp-server/index.org
index 80fdfd1..3d40a2b 100644
--- a/content/posts/WIP-openbsd-dhcp-server/index.org
+++ b/content/posts/WIP-openbsd-dhcp-server/index.org
@@ -47,14 +47,14 @@ To jumpstart the configuration, I'll first copy the file from
=/etc/examples/dhcpd.conf= to =/etc/dhcpd.conf= so I don't have to
start from scratch.
-#+BEGIN_SRC shell
+#+BEGIN_SRC
doas cp /etc/examples/dhcpd.conf /etc/
#+END_SRC
Then I'll edit the file with =mg=, an emacs-like editor that comes
with OpenBSD.
-#+BEGIN_SRC shell
+#+BEGIN_SRC
doas mg /etc/dhcpd.conf
#+END_SRC
@@ -84,12 +84,15 @@ subnet 192.168.0.0 netmask 255.255.255.0 {
}
#+END_SRC
+Let's go through this line-by-line to get a better understanding of
+what's going on here.
+
The comments at the top are just to help understand the file at a
glance, and don't serve any practical function.
-An =option= can be specified globally or per-subnet. They can also be
-specified per-client for [[https://en.wikipedia.org/wiki/Bootstrap_Protocol][BOOTP]] clients, but I won't be covering that.
-Here I set the domain name and DNS servers globally.
+An =option= can be specified globally or per-subnet, and can also be
+specified per-client for [[https://en.wikipedia.org/wiki/Bootstrap_Protocol][BOOTP]] clients. Here I set the domain name
+and DNS servers globally.
#+BEGIN_SRC
option domain-name "home.local"
@@ -127,8 +130,8 @@ default-lease-time 604800;
max-lease-time 2592000;
#+END_SRC
-Finally I have an example client configuration. Here the client with
-the MAC address =22:33:44:55:66:77= will all ways be given the IP
+Finally I have an example static client configuration. Here the client
+with the MAC address =22:33:44:55:66:77= will all ways be given the IP
=192.168.0.201=. This is useful when you want to assign a specific IP
to a certain client without having to manually configure the IP.
@@ -138,3 +141,10 @@ host example-static-client {
fixed-address 192.168.0.201;
}
#+END_SRC
+
+To run the DHCP server, we first enable, then start it using =rcctl=.
+
+#+BEGIN_SRC
+doas rcctl enable dhcpd
+doas rcctl start dhcpd
+#+END_SRC