Minggu, 12 Oktober 2014

JOBSHEET 2 "MEMBUAT PC ROUTER DAN PROXY DI UBUNTU"



Nama : Diana Wahyuni
Membuat PC Router dan Proxy Di Ubuntu
Tanggal : Jum'at,26 Sep. 2014
Kelas :  XII.TKJ.2
SK/KD :
No. JobSheet : 2
Guru Produktif : Pak Maman



I.                    TUJUAN
Mengkonfigurasikan ubuntu server sebagai  gateway internet atau membangun pc router dan blok situs

II.                 PENDAHULUAN


III.               ALAT  DAN BAHAN
·         Laptop / PC yang sudah terinstall sistem operasi, disini saya menggunkan OS linux
·         Software VirtualBox
·         File Iso ubuntu server 12.04
·         File Iso windows xp (client)

IV.              LANGKAH KERJA
1.      Konfigurasi adapter di OS ubuntu server
·         Adapter 1 : bridge adapter
·         Adapter 2 : internal
2.      Mengkonfigurasikan perintah untuk membangun pc router
·         Langkah 1 , untuk masuk sebagai super / root :
Root : ~ # sudo su (enter)
·         Langkah 2 , chek NIC server untuk melihat 2 NIC yang sudah kita konfigurasikan dengan ketik :
Root : ~ # mii-tool         #ifconfig
·         Langkah 3 , setting network interfaces dengan cara
Root : ~ # nano /etc/network/interfaces
Kemudian masukkan konfigurasi seperti ini
Auto eth0
Iface eth0 inet static
Address 192.168.2.56
Netmask 255.255.255.0
Gateway 192.168.2.1
Network 192.168.2.0
Broadcast 192.168.2.255
 Auto eth1
Iface eth1 inet static
Address 192.168.50.1
Netmask 255.255.255.0
Network 192.168.50.0
Broadcast 192.168.50.25

Lalu simpan dengan ctrl o + ctrl x
Keterangan :
eth0 : merupakan NIC yang terhubung ke koneksi internet
eth1: merupakan NIC yang terhubung ke client

·         Langkah 4 yaitu melakukkan konfigurasi file resolv.conf, ketik :
Root : ~ # nano /etc/resolv.conf
Lalu isi seperti dibawah ini :
Nameserver : 8.8.8.8
Nameserver : 8.8.4.4

·         Langkah 5 konfigurasi file sysctl.conf dengan cara ketik:
Root : ~ # nano /etc/sysctl.conf
Lalu cari kalimat dibawah ini hilangkan tanda (#)
# net.ipv4.ip_fordward=1
      Menjadi
  net.ipv4.ip_forward=1

·         Langkah 6 aktifkan ip forwardnya dengan cara ketik :
Root : ~ # sysctl –w net.ipv4.ip_forward=1

·         Langkah 7 lalu chek kernel forward, ketik :
Root : ~ # cat /proc/sys/net/ipv4/ip_forward
      Jika sudah aktif maka akan muncul angka 1

·         Langkah 8, routing server ketik :
Root : ~ # iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE
Root : ~ # iptables –t nat –A POSTROUTING –s 192.168.50.0/24 –j MASQUERADE
Keterangan eth0 merupakan NIC yang connect ke internet

·         Langkah 9 cek apakah routing sudah berjalan atau belum
Root : ~ # iptables –t nat –n –L

·         Langkah 10 konfigurasi rc.local
PERHATIAN !
Besar kecilnya huruf sangat berpengaruh !
Root : ~ # nano /etc/rc.local
Tambahkan konfigurasi routing tadi , diatas exit 0
# iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE
# iptables –t nat –A POSTROUTING –s 192.168.50.0/24 –j MASQUERADE
Kemudian simpan dengan perintah ctrl o + ctrl x

·         Langkah 11 simpan iptables / perintah routing dengan cara ketik :
Root : ~ # iptables-save > /etc/iptables.conf

·         Langkah 12 update service jaringan yang baru dikonfigurasikan dengan cara ketik:
Root : ~ # /etc/init.d/networking restart

·         Langkah 13 mencoba ngeping ke ip yang terhubung ke internet dan ip yang terhubung ke clien
Ping 192.168.2.56 jika hasilnya replay berarti konfigurasi berhasil
Ping 192.168.50.1 jika hasilnya replay berarti konfigurasi berhasil

3.      Mengkonfigurasikan Proxy Server
·         Pertama menginstall aplikasi squid3, tetapi sebelum kita melakukkan penginstalan kita terlebih dahulu mengedit isi dari sourrces.list. ketik :
Root : ~ # sudo nano /etc/apt/sources.list
Hapus semua isinya dengan perintah ctrl k , lalu ketik :

deb http://200.200.200.202/ubuntu-12.04/ precise main restricted universe multiverse
deb http://200.200.200.202/ubuntu-12.04/ precise-updates  main restricted universe multiverse
deb http://200.200.200.202/ubuntu-12.04/ precise-security main restricted universe multiverse
deb http://200.200.200.202/ubuntu-12.04/ precise-backports main restricted universe multiverse
deb http://200.200.200.202/ubuntu-12.04/ precise-proposed main restricted universe multiverse
·         Setelah itu ketik :
Root : ~ # sudo apt-get update
·         Selanjutnya install squid3 ketik :
Root : ~ # sudo apt-get install squid3
·         Edit file “squid.conf”
Root : ~ # cd /etc/squid3
Root : ~ # nano squid3.conf
·         Adapun bagian bagian yang harus diedit dan ditambah pada file “squid.conf” agar squid berfungsi sebagai caching
Proxy transparent proxy, dan web filter
hapus semua data pada squid.conf dan masukkan :
http_port 3128 transparent
cache_effective_user proxy
cache_effective_group proxy
visible_hostname www.diana.com
cache_mem 20 MB
cache_mgr admin@diana.com
cache_dir lifs /cache 2000 16 256
acl manager proto cache object

acl situsx dstdomain “/etc/squid3/situsx”
htpp_access deny situsx
http_access allow lan
http_access deny all

·         Masukan transparent proxy
Root : ~ # iptables –A PREROUTING –t nat –p tcp –dport 80 –j REDIRECT –to-port 3128
Lalu masuk : Root : ~ # nano /etc/rc.local
Ketik yang tadi iptablesnya
·         Masuk ke : nano situsx
Ketik web yang akan di blog , misal : www.detik.com

·         Ketik :
Root : ~ # mkdir /cache
Root : ~ # chwon proxy.proxy /cache
Root : ~ # squid –z

·         Lalu restart “/etc/init.d/squid3 restart”
·         Lalu ketik : Root : ~ # iptables –L nat
·         Ping 192.168.2.106
Ping 192.168.100.1
Ping 8.8.8.8

V.                 HASIL KERJA
Buka web yang tadi sudah di blokir www.detik.com jika error maka, blokir sukses

VI.              KESIMPULAN
Harus teliti dalam proses pengkonfigurasiannya supaya hasilnya baik..

0 komentar:

Posting Komentar