To administer a small network, providing a static ip very easy for network administrators. However, if the network has wide ranging possibilities for using the same ip will be large, causing conflict. On this basis, the use of DHCP (Dynamic Host Configuration Protocol) server is highly recommended.
The main function of this is to provide a DHCP server IP to the host or computer connected to the network automatically. This only applies if the computer is using IP settings with DHCP or in Windows to enable the option "Obtain IP Address Automatically". What if the computer still want to use a static IP? IP could thus not be given on the computer that will ask the DHCP Server IP or change the IP of a host that has been using the same IP with a static IP is used.
If there is a DHCP server with the IP range 192.168.1.22 to 192.168.1.50 then any computer connected to the network and enable the use of DHCP, the DHCP server will assign IP addresses in the range above that is between 22-50, usually DHCP server assigns IP at the top of the range first. If in our example is a new one that uses DHCP then most likely get IP 192.168.1.50. If in the network there is a computer with Static IP and still within range of the IP DHCP Server DHCP Server will not use the IP to be given to any other DHCP users.
What about Slackware 12.2 Linux itself? By default DHCP Server already installed on your Slackware machine, ie dhcp-3.0.6-i486-1.
smkn3tkj root @ server :/ # ls / var / log / packages / | grep dhcp
dhcp-3.0.6-i486-1
dhcpcd-2.0.8-i486-1
You see that on the machines we have installed the package dhcp-3.0.6-i486-1. There is one file that we will edit as needed in building a DHCP Server, namely:
/ Etc / dhcpd.conf
If we look at the contents of the file with the command glittering cat / etc / dhcpd.conf
# Dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
dhcpd.conf file is still empty means now we will take dhcpd contained on / usr/doc/dhcp-3.0.6/examples/dhcpd.conf through ways:
smkn3tkj root @ server :/ # cp / usr/doc/dhcp-3.0.6/examples/dhcpd.conf / etc
now you have to edit the dhcpd.conf file in the directory / etc / dhcpd.conf
Penegditannya way like this:
smkn3tkj root @ server :/ # mcedit / etc / dhcpd.conf
Here's the parts you want to edit:
# Option definitions common to all supported networks ...
line: 1: option domain-name "example.org";
line: 2: option domain-name-servers ns1.example.org, ns2.example.org;
The first two lines are setting the gateway, line 1 is the domain-search, specify the domain name you read back on the previous tutorial here for setting up DNS. While line 2 is namaservernya. Please feel free to edit as needed. This is an example of DHCP that have been made:
option domain-name "TKJ-smk3bgr.net";
option domain-name-servers 192.168.1.21;
The second line should be filled with the IP address or a valid nameserver, or DHCP Client we can not access the public domain. Since in this example already exists in the DNS Server IP Address 192.168.1.21 then it will use.
We are also required to add the following line according to the rules of the Internet Systems Consortium. If you do not believe put a # to make comments and guaranteed dhcp server will not start.
ddns-update-style ad-hoc;
Option to specify the time of the DHCP Server to IP administration and re-checking of Host is still active or not.
default-lease-time 600;
max-lease-time 7200;
Next is the determination of the range of IP addresses or subnets known as:
This example from dhcpd.conf default
# This is a very basic subnet declaration.
subnet 10.254.239.0 netmask 255.255.255.224 {
range 10.254.239.10 10.254.239.20;
option routers-rtr-1.example.org 239-0, 239-0-rtr-2.example.org;
}
edit as below:
# This is a very basic subnet declaration.
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.22 192.168.1.50;
option routers 192.168.1.21;
}
On the subnet configuration above, we make the DHCP Server on the network 192.168.1.0 with netmask 255.255.255.0 with DHCP IP range is 192.168.1.22 - up to 192.168.1.50 In this section there is also a significant option routers ip gateway from DHCP IP. Option routers can also be placed outside (Global) so by default will put option routers on the subnet unless explicitly stated.
Here is the complete config of dhpcd.conf that have been made:
option domain-name "TKJ-smk3bgr.net";
option domain-name-servers 192.168.1.21;
ddns-update-style ad-hoc;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.22 192.168.1.50;
option routers 192.168.1.21;
}
The next course dhpcd activate the server:
Command to enable dhcp on your Slackware system:
smkn3tkj root @ server :/ # / usr / sbin / dhcpd
This command to enable dhcp on reboot when system slackware.
echo "/ usr / sbin / dhpcd" >> / etc / rc.d / rc.local
READ MORE - DHCP Server
The main function of this is to provide a DHCP server IP to the host or computer connected to the network automatically. This only applies if the computer is using IP settings with DHCP or in Windows to enable the option "Obtain IP Address Automatically". What if the computer still want to use a static IP? IP could thus not be given on the computer that will ask the DHCP Server IP or change the IP of a host that has been using the same IP with a static IP is used.
If there is a DHCP server with the IP range 192.168.1.22 to 192.168.1.50 then any computer connected to the network and enable the use of DHCP, the DHCP server will assign IP addresses in the range above that is between 22-50, usually DHCP server assigns IP at the top of the range first. If in our example is a new one that uses DHCP then most likely get IP 192.168.1.50. If in the network there is a computer with Static IP and still within range of the IP DHCP Server DHCP Server will not use the IP to be given to any other DHCP users.
What about Slackware 12.2 Linux itself? By default DHCP Server already installed on your Slackware machine, ie dhcp-3.0.6-i486-1.
smkn3tkj root @ server :/ # ls / var / log / packages / | grep dhcp
dhcp-3.0.6-i486-1
dhcpcd-2.0.8-i486-1
You see that on the machines we have installed the package dhcp-3.0.6-i486-1. There is one file that we will edit as needed in building a DHCP Server, namely:
/ Etc / dhcpd.conf
If we look at the contents of the file with the command glittering cat / etc / dhcpd.conf
# Dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
dhcpd.conf file is still empty means now we will take dhcpd contained on / usr/doc/dhcp-3.0.6/examples/dhcpd.conf through ways:
smkn3tkj root @ server :/ # cp / usr/doc/dhcp-3.0.6/examples/dhcpd.conf / etc
now you have to edit the dhcpd.conf file in the directory / etc / dhcpd.conf
Penegditannya way like this:
smkn3tkj root @ server :/ # mcedit / etc / dhcpd.conf
Here's the parts you want to edit:
# Option definitions common to all supported networks ...
line: 1: option domain-name "example.org";
line: 2: option domain-name-servers ns1.example.org, ns2.example.org;
The first two lines are setting the gateway, line 1 is the domain-search, specify the domain name you read back on the previous tutorial here for setting up DNS. While line 2 is namaservernya. Please feel free to edit as needed. This is an example of DHCP that have been made:
option domain-name "TKJ-smk3bgr.net";
option domain-name-servers 192.168.1.21;
The second line should be filled with the IP address or a valid nameserver, or DHCP Client we can not access the public domain. Since in this example already exists in the DNS Server IP Address 192.168.1.21 then it will use.
We are also required to add the following line according to the rules of the Internet Systems Consortium. If you do not believe put a # to make comments and guaranteed dhcp server will not start.
ddns-update-style ad-hoc;
Option to specify the time of the DHCP Server to IP administration and re-checking of Host is still active or not.
default-lease-time 600;
max-lease-time 7200;
Next is the determination of the range of IP addresses or subnets known as:
This example from dhcpd.conf default
# This is a very basic subnet declaration.
subnet 10.254.239.0 netmask 255.255.255.224 {
range 10.254.239.10 10.254.239.20;
option routers-rtr-1.example.org 239-0, 239-0-rtr-2.example.org;
}
edit as below:
# This is a very basic subnet declaration.
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.22 192.168.1.50;
option routers 192.168.1.21;
}
On the subnet configuration above, we make the DHCP Server on the network 192.168.1.0 with netmask 255.255.255.0 with DHCP IP range is 192.168.1.22 - up to 192.168.1.50 In this section there is also a significant option routers ip gateway from DHCP IP. Option routers can also be placed outside (Global) so by default will put option routers on the subnet unless explicitly stated.
Here is the complete config of dhpcd.conf that have been made:
option domain-name "TKJ-smk3bgr.net";
option domain-name-servers 192.168.1.21;
ddns-update-style ad-hoc;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.22 192.168.1.50;
option routers 192.168.1.21;
}
The next course dhpcd activate the server:
Command to enable dhcp on your Slackware system:
smkn3tkj root @ server :/ # / usr / sbin / dhcpd
This command to enable dhcp on reboot when system slackware.
echo "/ usr / sbin / dhpcd" >> / etc / rc.d / rc.local