Setting up a DHCP server
This is a guide to the (hopefully) succesful configuration and usage of the DHCP server distributed with the OpenBSD base install.
Follow these pointers:
Edit /etc/rc.conf.local to start the DHCP server automatically:
DHCPd_flags="-q" # for normal use: "-q"
Create/edit the file /etc/DHCPd.conf to configure DHCPd:
# $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.
shared-network LOCAL-NET {
option routers 10.0.0.3;
option domain-name "intranet.atomicvoid.net";
option domain-name-servers 10.0.0.3;
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.100 10.0.0.200;
}
host miranda {
hardware ethernet 00:00:39:3b:68:0d;
fixed-address miranda.intranet.atomicvoid.net;
}
host andromeda {
hardware ethernet 00:50:fc:0c:3e:32;
fixed-address andromeda.intranet.atomicvoid.net;
}
}
For a more detailed working example, see my DHCPd.conf file.
The "host" directives inform the DHCP server to allocate a "fixed-address" to requests with a MAC address equal to the one listed by "hardware ethernet".
The "subnet" directive informs the DHCP server that all DHCP requests result in a allocation of an IP address in the range of [10.0.0.100 - 10.0.0.200] if a client's MAC address is not listed by one of the "host" directives.
Create/edit the file /etc/DHCPd.interfaces to list the interfaces DHCPd should listen on for DHCP requests:
# $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
xl0
In this case, only DHCP request entering via the interface xl0 will be seen and handled by the DHCP daemon.
Reboot the system to have the changes take effect. Alternately, you can execute
/usr/sbin/DHCPd -q xl0
to start the DHCP server. Option "-q" quiets the chatter of the DHCP server and "xl0" is the interface on which the DHCP server should listen for requests.
Check /var/log/daemon if the DHCP server was started succesfully.
'Computer > Security' 카테고리의 다른 글
[Ahnlab]OpenID (0) | 2007.05.17 |
---|