Difference between revisions of "Set up a dhcp server"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
Line 1: Line 1:
 
To set up a dhcp server [[find out your distribution]] and proceed accordingly:
 
To set up a dhcp server [[find out your distribution]] and proceed accordingly:
  
= SUSE =
+
= SUSE 12.1 =
 +
This is an example that works with SUSE Linux 12.1. We use br0 as network card to offer the dhcp service, 192.168.0.0/24 as network where to take the IP addresses from, 192.168.0.1 and 192.168.0.5 as name servers and 192.168.0.5 as gateway.
 +
* install the dhcp server software:
 +
yast -i dhcp-server
 +
* edit /etc/dhcpd.conf, enter the following:
 +
ddns-update-style interim;
 +
authoritative;
 +
default-lease-time 600;
 +
max-lease-time 3600;
 +
option broadcast-address 192.168.0.255;
 +
option routers 192.168.0.5;
 +
option domain-name-servers 192.168.0.1, 192.168.0.5;
 +
option domain-name "mydomain.net";
 +
 +
subnet 192.168.0.0 netmask 255.255.255.0 {
 +
    range 192.168.0.10 192.168.0.100;
 +
}
 +
* edit /etc/sysconfig/dhcp, set
 +
DHCPD_INTERFACE=br0
 +
* start the dhcp daemon:
 +
/etc/init.d/dhcpd start
 +
 
 +
= SUSE 11.4 =
 
This is an example that works with SUSE Linux 11.4. We use br0 as network card to offer the dhcp service, 192.168.0.0/24 as network where to take the IP addresses from, 192.168.0.1 and 192.168.0.5 as name servers and 192.168.0.5 as gateway.
 
This is an example that works with SUSE Linux 11.4. We use br0 as network card to offer the dhcp service, 192.168.0.0/24 as network where to take the IP addresses from, 192.168.0.1 and 192.168.0.5 as name servers and 192.168.0.5 as gateway.
 
* install the dhcp server software:
 
* install the dhcp server software:

Revision as of 21:00, 2 July 2012

To set up a dhcp server find out your distribution and proceed accordingly:

SUSE 12.1

This is an example that works with SUSE Linux 12.1. We use br0 as network card to offer the dhcp service, 192.168.0.0/24 as network where to take the IP addresses from, 192.168.0.1 and 192.168.0.5 as name servers and 192.168.0.5 as gateway.

  • install the dhcp server software:
yast -i dhcp-server
  • edit /etc/dhcpd.conf, enter the following:
ddns-update-style interim;
authoritative; 
default-lease-time 600;
max-lease-time 3600;
option broadcast-address 192.168.0.255;
option routers 192.168.0.5;
option domain-name-servers 192.168.0.1, 192.168.0.5;
option domain-name "mydomain.net";

subnet 192.168.0.0 netmask 255.255.255.0 {
   range 192.168.0.10 192.168.0.100;
}
  • edit /etc/sysconfig/dhcp, set
DHCPD_INTERFACE=br0
  • start the dhcp daemon:
/etc/init.d/dhcpd start

SUSE 11.4

This is an example that works with SUSE Linux 11.4. We use br0 as network card to offer the dhcp service, 192.168.0.0/24 as network where to take the IP addresses from, 192.168.0.1 and 192.168.0.5 as name servers and 192.168.0.5 as gateway.

  • install the dhcp server software:
yast -i dhcpd
  • edit /etc/dhcpd.conf, enter the following:
ddns-update-style interim;
authoritative; 
default-lease-time 600;
max-lease-time 3600;
option broadcast-address 192.168.0.255;
option routers 192.168.0.5;
option domain-name-servers 192.168.0.1, 192.168.0.5;
option domain-name "mydomain.net";

subnet 192.168.0.0 netmask 255.255.255.0 {
   range 192.168.0.10 192.168.0.100;
}
  • edit /etc/sysconfig/dhcp, set
DHCPD_INTERFACE=br0
  • start the dhcp daemon:
/etc/init.d/dhcpd start