Configure DHCP on suse

This entry was posted in Linux and tagged on June 17, 2012, by

Following is the detail information on how to configure DHCP server

Configure DHCP server

1. Edit the main configuration file of dhcp

# vi /etc/dhcpd.conf

default-lease-time 600; # 10 minutes

max-lease-time 7200; # 2 hours

option domain-name “lab.com”;

option domain-name-server 192.168.1.1, 192.168.1.2;

option broadcast-address 192.168.1.255;

option routers 192.168.1.254;

option subnet-mask 255.255.255.0;

subnet 192.168.1.0 netmask 255.255.255.0

{

range 192.168.1.10 192.168.1.20;

range 192.168.1.100 192.168.1.200;

}

save and quit.

This is sample configuration file for dhcp, to assign ipaddress in the network. We have to make sure semicolon is inserted at end of the line . The sample file is divided into 3 sections. The first section defines how may time a IP address can be lease by client and also it includes the maximum lease time a machine may keep IP address.

The second section contains the domain name of teh network, gives the broadcast address, will also give router information and gives subnet mast value

The third section shows that client get IP address from range 192.168.1.10 to 192.168.1.20 and also between 192.168.1.100 and 192.168.1.200.

We can also assign fixed address to the client. below is the sample

host sun1 {

hardware ethernet 00:10:78:89:EE:EF:

fixed-address 192.168.1.21;

}

client with MAC address 00:10:78:89:EE:EF will have Ip 192.168.1.21 with hostname as sun1.

2. Next step is to start the DHCP service

# rcdhcpd start

3. On the client just select the newtork from dhcp . It will get IPvalues from dhcp server.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright 2017 ©Aceadmins. All rights reserved.