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. | ||
+ | |||
+ | ==== Configuration ==== | ||
+ | |||
+ | Setup the main Ethernet device to reserve the first available IP address: | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | inet 192.168.0.2 255.255.255.0 | ||
+ | </ | ||
+ | |||
+ | Setup the name server resolution manually: | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | search beandog.org | ||
+ | nameserver 192.168.0.2 | ||
+ | nameserver 205.171.3.25 | ||
+ | nameserver 205.171.2.25 | ||
+ | </ | ||
+ | |||
+ | Setup the server' | ||
+ | |||
+ | ''/ | ||
+ | |||
+ | < | ||
+ | 192.168.0.1 | ||
+ | </ | ||
+ | |||
+ | The localhost name: | ||
+ | |||
+ | ''/ | ||
+ | |||
+ | < | ||
+ | d64.beandog.org | ||
+ | </ | ||
+ | |||
+ | Configure the daemons to start up on boot: | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | dhcpd_flags=re0 | ||
+ | pkg_scripts=" | ||
+ | dnsmasq_flags= | ||
+ | dbus_daemon_flags= | ||
+ | avahi_daemon_flags= | ||
+ | </ | ||
+ | |||
+ | Here's a very basic dhcpd configuration: | ||
+ | |||
+ | ''/ | ||
+ | |||
+ | < | ||
+ | option domain-name " | ||
+ | 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; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Router ==== | ||
+ | |||
+ | Setting up the OpenBSD server as a router only adds a few more changes. | ||
+ | |||
+ | Turn on network IP forwarding in ''/ | ||
+ | |||
+ | < | ||
+ | net.inet.ip.forwarding=1 | ||
+ | </ | ||
+ | |||
+ | Setup packet filtering in ''/ | ||
+ | |||
+ | < | ||
+ | pass out on re0 from em0:network to any nat-to (re0) | ||
+ | </ | ||
+ | |||
+ | Set the second NIC's IP address manually: | ||
+ | |||
+ | < | ||
+ | inet 192.168.12.1 255.255.255.0 | ||
+ | </ | ||
+ | ==== Extras ==== | ||
+ | |||
+ | To preserve sanity, disable the PC speaker: | ||
+ | |||
+ | ''/ | ||
+ | |||
+ | < | ||
+ | keyboard.bell.volume=0 | ||
+ | </ |