background img

The New Stuff

Konfigurasi DHCP dan Sharing Internet Di Ubuntu Server 12.04

DHCP adalah pemberian ip address dari server kepada  client, disini saya menggunakan virtual box, dimana ubuntu servernya menggunakan 2 adapter, adapter 1 (eth0) disetting bridge Wlan yang dihubungkan ke Laptop dan adapter2(eth1) disetting internal yang di hubungkan ke client.
Langkah-langkahnya :
$ sudo apt-get install dhcp3-server
masukkan password
kalau melalui root : # apt-get install dhcp3-server
KONFIGURASI DHCP SERVER
caranya: ketik di terminal
1. nano /etc/dhcp/dhcpd.conf
2. Kemudian edit pada bagian yang ada tulisan:
ini sebelum di edit
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name “internal.example.org”;
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}.
EDIT DAN SESUAIKAN IP ADDRESS YANG ANDA INGINKAN
setelah di edit
# A slightly different configuration for an internal subnet.
Subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.2 192.168.1.254;
option domain-name-servers 192.168.1.1, 8.8.4.4;
# option domain-name “internal.example.org”;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}
kemudian SIMPAN ya.. CTRL + O [ENTER], CTRL + X
Menentukan INTERFACES YANG MENGARAH KE CLIENT
CARANYA:
lihat dulu interface yang ada di komputer anda dengan cara:
ketik di terminal: ifconfig [ENTER]
anda perhatikan interface apakah terdeteksi: eth0, eth1, eth2 dst
Jika sudah terlihat interfaces nya maka lanjutkan ketik
nano /etc/default/isc-dhcp-server
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. “eth0 eth1”.
INTERFACES=”eth1″
SIMPAN lagi,
terakhir: restart servic dhcp
ketik: /etc/init.d/networking restart
#
service isc-dhcp-server restart
Jika gagal, cek kembali penulisannya.
Setelah itu ketik
Nano /etc/network/interfaces
#The primary network interface
Auto eth0
Iface eth0 inet dhcp
Auto eth1
iface eth1 inet static
Address 192.168.1.1
Netmask 255.255.255.0
simpan CTRL+O
ifconfig eth1 up
Setelah itu restart /etc/init.d/networking restart

Konfigurasi agar client terkoneksi internet
Perintahnya “nano /etc/sysctl.conf”
Caribaris yang bertuliskan -> “net.ipv4.ip_forward =1”
Hilangkantanda “#” pada awal baris tersebut.
Restart Network
“/etc/init.d/networking restart”
nano /etc/rc.local
#by default this script doest nothing
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 0/0 -j MASQUERADE
exit o
simpan dengan ctrl+o
cat /proc/sys/net/ipv4/ip_forward
bila muncul angka 1 berarti sharing internet berhasil, bila masih 0 cek kembali di nano /etc/rc/local
selesai

Sources list untuk Ubuntu

Langkah-langkahnya:
1. perintahnya sudo nano /etc/apt/sources.lis
2. Hapus semua isi file lalu masukan data dibawah ini

Repo Sekolah

deb http://200.200.200.202/repo-12.04/ precise main restricted universe multiverse
deb http://200.200.200.202/repo-12.04/ precise-updates main restricted universe multiverse
deb http://200.200.200.202/repo-12.04/ precise-security main restricted universe multiverse
deb http://200.200.200.202/repo-12.04/ precise-backports main restricted universe multiverse
deb http://200.200.200.202/repo-12.04/ precise-proposed main restricted universe multiverse

online

deb http://kambing.ui.ac.id/ubuntu/ precise-proposed main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ precise-security main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ precise-updates main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ precise main restricted universe multiverse

3. lalu jalankan perintah sudo apt-get update
4. lalu jalankan perintah sudo apt-get upgrade

deb http://200.200.200.202/repo-12.04/ precise main restricted universe multiverse
deb http://200.200.200.202/repo-12.04/ precise-updates main restricted universe multiverse
deb http://200.200.200.202/repo-12.04/ precise-security main restricted universe multiverse
deb http://200.200.200.202/repo-12.04/ precise-backports main restricted universe multiverse
deb http://200.200.200.202/repo-12.04/ precise-proposed main restricted universe multiverse

untuk ubuntu 14.04 i386 dan amd64
deb http://200.200.200.202/repo-14.04/ trusty main restricted universe multiverse
deb http://200.200.200.202/repo-14.04/ trusty-updates main restricted universe multiverse
deb http://200.200.200.202/repo-14.04/ trusty-security main restricted universe multiverse
deb http://200.200.200.202/repo-14.04/ trusty-backports main restricted universe multiverse
deb http://200.200.200.202/repo-14.04/ trusty-proposed main restricted universe multiverse


Popular Posts