no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


openbsd_dhcp_server [2015/06/01 23:08] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== OpenBSD DHCP Server ======
  
 +Configuration is very simple, direct and intuitive.  It would be easy to duplicate this setup quickly.
 +
 +==== Configuration ====
 +
 +Setup the main Ethernet device to reserve the first available IP address:
 +
 +'' /etc/hostname.re0 ''
 +
 +<code>
 +inet 192.168.0.2 255.255.255.0
 +</code>
 +
 +Setup the name server resolution manually:
 +
 +'' /etc/resolv.conf ''
 +
 +<code>
 +search beandog.org
 +nameserver 192.168.0.2
 +nameserver 205.171.3.25
 +nameserver 205.171.2.25
 +</code>
 +
 +Setup the server's gateway:
 +
 +''/etc/mygate''
 +
 +<code>
 +192.168.0.1
 +</code>
 +
 +The localhost name:
 +
 +''/etc/myname''
 +
 +<code>
 +d64.beandog.org
 +</code>
 +
 +Configure the daemons to start up on boot:
 +
 +'' /etc/rc.conf.local ''
 +
 +<code>
 +dhcpd_flags=re0
 +pkg_scripts="dnsmasq dbus_daemon avahi_daemon"
 +dnsmasq_flags=
 +dbus_daemon_flags=
 +avahi_daemon_flags=
 +</code>
 +
 +Here's a very basic dhcpd configuration:
 +
 +''/etc/dhcpd.conf''
 +
 +<code>
 +option domain-name "beandog.org";
 +option domain-name-servers 192.168.0.2;
 +subnet 192.168.0.0 netmask 255.255.255.0 {
 +  option routers 192.168.0.1;
 +  range 192.168.0.3 192.168.0.254;
 +}
 +</code>
 +
 +==== Router ====
 +
 +Setting up the OpenBSD server as a router only adds a few more changes.  First of which, is to use a second NIC, and run the DHCP and DNS servers there.
 +
 +Turn on network IP forwarding in ''/etc/sysctl.conf'':
 +
 +<code>
 +net.inet.ip.forwarding=1
 +</code>
 +
 +Setup packet filtering in ''/etc/pf.conf'':
 +
 +<code>
 +pass out on re0 from em0:network to any nat-to (re0)
 +</code>
 +
 +Set the second NIC's IP address manually:
 +
 +<code>
 +inet 192.168.12.1 255.255.255.0
 +</code>
 +==== Extras ====
 +
 +To preserve sanity, disable the PC speaker:
 +
 +''/etc/wsconsctl.conf''
 +
 +<code>
 +keyboard.bell.volume=0
 +</code>

Navigation
QR Code
QR Code openbsd_dhcp_server (generated for current page)