Difference between revisions of "Set up a dhcp server"

From Linuxintro
imported>ThorstenStaerk
(Created page with "To set up a dhcp server find out your distribution and proceed accordingly: = SUSE = This is an example that works with SUSE Linux 11.4. We use br0 as network card to offer ...")
 
imported>ThorstenStaerk
 
(2 intermediate revisions by the same user not shown)
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=<abbr title="Your interface to listen on, in this case a bridge">br0</abbr>
 +
* 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:
Line 14: Line 36:
 
  option domain-name-servers 192.168.0.1, 192.168.0.5;
 
  option domain-name-servers 192.168.0.1, 192.168.0.5;
 
  option domain-name "mydomain.net";
 
  option domain-name "mydomain.net";
 
+
 
  subnet 192.168.0.0 netmask 255.255.255.0 {
 
  subnet 192.168.0.0 netmask 255.255.255.0 {
 
     range 192.168.0.10 192.168.0.100;
 
     range 192.168.0.10 192.168.0.100;

Latest revision as of 09:34, 20 May 2013

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