|
||||||||||
|
|
||||||||||
NavigationMy posts on Twitter
|
Configure DHCP for an internal interfaceTo have a DHCP-server, you need the dhcp software package. You also need to have The homepage of the official DHCP-server is http://www.isc.org/products/DHCP. Normally your Linux distribution should have this packet in its packet list. So just check your Yast in SuSe, or do 'emerge dhcp' in Gentoo, or the correct 'apt-get' in Debian and its clones. I'm using Gentoo on my server, so the following could be different if you're using another Linux flavour. The following code is what I have in my run-level startup configuration file for DHCP. In Gentoo it's located in # Configure which interface or interfaces to for dhcp to listen on # list all interfaces space separated. IFACE="eth1" # Insert any other options needed DHCPD_OPTS="" # If you wish to run dhcp in a chroot, run: # ebuild /var/db/pkg/net-misc/<dhcp version>/<dhcp-version>.ebuild config # and un-comment the following line. # You can specify a different chroot directory but MAKE SURE it's empty. # CHROOT="/chroot/dhcp" The following is what I have in my actual DHCP configuration file. If you want more information about everything in this file, just read the man-page ('man dhcpd.conf'). On my system this file is located at default-lease-time 21600;
max-lease-time 345600;
option subnet-mask 255.255.255.0;
option broadcast-address 10.1.1.255;
option routers 10.1.1.1;
option domain-name-servers 195.238.2.22, 195.238.2.21, 10.1.1.1;
ddns-update-style ad-hoc;
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.2 10.1.1.200;
}
Now just start your service with To give certain computers a static IP-address in the network, you can specify the IP-address with the MAC-address of that computer. Just add a group section in which you can specify all the host sections you want. The name given after 'host' (in the example 'laptop' and 'workstation') can be chosen like you want, they don't really have a meaning. default-lease-time 21600;
max-lease-time 345600;
option subnet-mask 255.255.255.0;
option broadcast-address 10.1.1.255;
option routers 10.1.1.1;
option domain-name-servers 195.238.2.22, 195.238.2.21, 10.1.1.1;
ddns-update-style ad-hoc;
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.2 10.1.1.200;
group {
host laptop {
hardware ethernet 00:02:3F:8A:F4:6E;
fixed-address 10.1.1.2;
}
host workstation {
hardware ethernet 00:03:47:68:5c:6e;
fixed-address 10.1.1.3;
}
} |
|
||||||||
| © Copyleft 2005-2011 - Lode Vanstechelman - Login | ||||||||||