Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Friday, May 25, 2012

MEMBANGUN ROUTER SERVER DI UBUNTU

MEMBANGUN ROUTER SERVER DI UBUNTU

v  Membangun Router Dan Dhcp Server Di Ubuntu

                Router adalah sebuah alat jaringan komputer yang mengirimkan paket data melalui sebuah jaringan atau Internet menuju tujuannya, melalui sebuah proses yang dikenal sebagai routing. Sedangkan Dynamic Host Configuration Protocol (DCHP) adalah protokol yang berbasis arsitektur client/server yang dipakai untuk memudahkan pengalokasian alamat IP dalam satu jaringan .
                Langkah pertama , untuk membangun Router di Ubuntu adalah membuat IP address static dengan Mengedit file yang ada di /etc/network/interfaces seperti contoh di bawah :
nano /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.220
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
kemudian restart ip nya :
#/etc/init.d/networking restart
Lalu edit file /etc/init.d/rc.local , dan masukan perintah kayak contoh di bawah kedalem file tersebut :
#nano /etc/init.d/rc.local
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
                Perintah tersebut digunakan untuk mensharing koneksi internet dari eth0 ke eth1
perintah tersebut di masukan di /etc/init.d/rc.local yang merupakan file startup di ubuntu
kalo menshare sementara langsung saja di jalankan perintahnya
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
               
 Untuk DHCP server :

pertama kita install  DHCP server buat ubuntunya.
# apt-get install dhcp3-server
setelah selesai edit file conf dhcpnya..
# nano /etc/dhcp3/dhcpd.conf
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.5 192.168.0.200;
option domain-name-servers 202.134.0.155;
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}
selanjutnya restart DHCP servernya
# /etc/init.d/dhcp3-server restart
  
Membuat Nat / Router Pada Ubuntu Server 

Agar client bisa terkoneksi dengan internet maka kita harus mengaktifkan ip forward.

• Membuat router maka aktifkan IP Forwarding, dari ppp0 ke eth1, edit file /etc/sysctl.conf :
cari teks
# net.ipv4.ip_forward=1
Aktifkan dengan menghilangkan tanda “#”, menjadi :
# net.ipv4.ip_forward=1
untuk meningkatan pengaman sebaiknya anti spoofing attack dan kernel map protect diaktifkan, cari teks2 dibawah ini…
# net.ipv4.conf.default.rp_filter=1
# net.ipv4.conf.all.rp_filter=1
Aktifkan dengan menghilangkan tanda “#”, menjadi:
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.all.rp_filter=1
kemudian save. Dan lakukan reboot
# reboot

• Membuat NAT dengan command iptables
# iptables –t nat –A POSTROUTING –o ppp0 –j MASQUERADE
Lakukan test di client, bisa langsung browsing atau melakukan ping ke inet.


Selamat Mencoba...:-D

0 comments:

Post a Comment