Install dan konfigurasi DHCP Server di ubuntu

tugas sistem operasi 2 …. ni ngopi dari http://wa2n.staff.uns.ac.id/2009/02/21/install-dan-konfigurasi-dhcp-server-di-ubuntu/

Install Server DHCP di Ubuntu

sudo apt-get install dhcp3-server

Peritah tersebut akan menginstall server DHCP di ubuntu, tidak repot kan.

Konfigurasi Server DHCP

Jika komputer ubuntu anda mempunyai 2 network card, anda pilih salah satu Network card yang digunakan untuk menerima permintaan Ip dari client, atau dalam satu LAN. kemudian anda buka file

sudo vi /etc/default/dhcp3-server

cari

INTERFACES=””

ganti dengan

INTERFACES=”eth0″

simpan dan keluar

Metode Address Pool

langkah selanjutnya buka file

sudo vi /etc/dhcp3/dhcpd.conf

ganti konfigurasi seperti dibawah

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option domain-name-servers 202.188.0.133, 202.188.1.5;
option domain-name "warnet.my";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}

simpan kemudian keluar.

Konfigurasi diatas berarti Server DHCP menyiapkan IP address antara 192.168.0.100-192.168.0.200, Gateway 192.168.0.1, DNS 202.188.0.133 dan 202.188.0.5

Metode MAC Address

Metode ini memberikan IP statik ke client berdasarkan MAC Addres dari network card client.

Buka file dhcp.conf

default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name “yourdomainname.com”;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
}
host client1{
hardware ethernet 00:1b:63:ef:db:54;
fixed-address 192.168.1.20;
}
host client2{
hardware ethernet 00:0a:95:b4:d4:b0;
fixed-address 192.168.1.21;
}
host client3{
hardware ethernet 00:16:cb:aa:2a:cd;
fixed-address 192.168.1.22;
}
host client4{
hardware ethernet 00:0a:95:f5:8f:b3;
fixed-address 192.168.1.23;
}

Setelah selesai restart service DHCP.

sudo /etc/init.d/dhcp3-server restart

sudah selesai deh instalasi server DHCPnya.

Konfigurasi Klient DHCP

buka file intervace

sudo vi /etc/network/interfaces

Edit dan sesuaikan dengan ini

auto lo eth0
iface eth0 inet dhcp
iface lo inet loopback
sdsd

Simpan kemudian keluar.

Kemudian restart networkingnya

sudo /etc/init.d/networking restart

Bagaimana mencari IP Addres DHCP Server

anda harus menjalankan beberapa perintah

sudo dhclient

or

tail -n 15 /var/lib/dhcp3/dhclient.*.leases

Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s