Selasa, 23 Juli 2013

KONFIGURASI ROUTER MENGGUNAKAN DEBIAN LENNY 5.0



#nano /etc/network/interfaces

Kemudian edit file tersebut menjadi seperti dibawah ini :

(untuk IP Address eth0 sesuaikan dengan IP Address di sekolah anda)

auto eth0
iface eth0 inet static
        address 10.10.1.77
        netmask 255.255.255.0
        network 10.10.1.0
        broadcast 10.10.1.255
        gateway 10.10.1.1
        dns-nameservers 10.10.1.1

auto eth1
iface eth1 inet static
        address 192.168.55.1
        netmask 255.255.255.0
        network 192.168.55.0
        broadcast 192.168.55.255
        gateway 192.168.55.1
#/etc/init.d/networking restart
#nano /etc/sysctl.conf

Carilah baris berikut #net.ipv4.ip_forward=1 dan hilangkan tanda # menjadi seperti dibawah ini :
Kemudian buat firewallnya dengan perintah sebagai berikut :

net.ipv4.ip_forward=1

#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Kalo computer client udah dapat ping keluar seperti yahoo.com kemudian perintah firewall diatas di masukkan ke rc.local dengan tujuan perintah firewall ini akan jalan walaupun computer di restart atau di matikan. Berikut adalah perintahnya :




#nano /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

exit 0
KONFIGURASI  PROXY  SERVER 

Instalasi Aplikasi Proxy Server

#apt-get install squid 

Konfigurasi Proxy Server

#nano /etc/squid/squid.conf
    
(membuat transparent proxy). cari http_port 3128 kemudian tambahkan transparent dibelakangnya sehingga menjadi seperti ini :
http_port 3128 transparent    

kemudian cari "cache_mem 8 MB"
ganti menjadi "cache_mem 32 MB"

# cari script acl CONNECT kemudian tambahkan script :

acl situs dstdomain "/etc/squid/situs"
no_cache deny situs
http_acces deny situs
acl jaringan src 192.168.55.0/24
http_acces allow jaringan
cache_mgr admin@sekolah.sch.id
visible_hostname www.sekolah.sch.id
#cari script http_access deny all dan tambahkan tanda # didepannya sehingga menjadi  

#http_access deny all

Selanjutnya membuat daftar situs yang ingin di blok :
#nano /etc/squid/situs

www.google.com
www.yahoo.com
google.com
yahoo.com
   
Cek konfigurasi apa sudah benar atau belum dengan perintah :
#squid –z

Edit rc.local agar firewall jalan otomatis
#nano /etc/rc.local

Tambahkan script dibawah ini diatas tulisan exit0

iptables -t nat -A PREROUTING -s 192.168.55.0/24 -p tcp --dport 80 -j REDIRECT --to-ports 3128
   
CATATAN :
JIKA TIDAK MENGGUNAKAN INTERNET TAMBAHKAN DOMAIN YANG AKAN DI BLOK PADA DNS SERVER
Langkah-Langkah Menambah Domain :

Membuat Zone Domain
#nano /etc/bind/named.conf 

Huruf  yang di cetak tebal adalah tambahan domain                        

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "smkpgrigorontalo.sch.id" {                           
        type master;                                                       
        file "db.smkpgri";                                              
};

zone "google.com" {                                                    
        type master;                                                        
        file "db.google";                                                 
};

zone "yahoo.com" {                                                     
        type master;                                                        
        file "db.yahoo";                                                  
};

zone "192.in-addr.arpa" {                                        
        type master;
        file "db.192";                                                           


File Forward
#cd /etc/bind/
#cp db.local /var/cache/bind/db.google
#nano /var/cache/bind/db.google

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     google.com. root.google.com. (
                              2                               ; Serial
                         604800                        ; Refresh
                          86400                         ; Retry
                        2419200                       ; Expire
                         604800 )                      ; Negative Cache TTL
;
@                  IN      NS      google.com.
@                  IN      A       192.168.55.1
www             IN      A       192.168.55.1
   

#cp db.local /var/cache/bind/db.yahoo
#nano /var/cache/bind/db.yahoo

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     yahoo.com. root.yahoo.com. (
                              2                               ; Serial
                         604800                        ; Refresh
                          86400                         ; Retry
                        2419200                       ; Expire
                         604800 )                      ; Negative Cache TTL
;
@                  IN      NS      yahoo.com.
@                  IN      A       192.168.55.1
www             IN      A       192.168.55.1


                                Kurang lebih lebih seperti itu Semoga Bermanfaat!^_^

Tidak ada komentar:

Follow Us

  • {icon: "facebook-f", url: "#"}
  • {icon: "twitter", url: "#"}
  • {icon: "instagram", url: "#"}
  • {icon: "linkedin", url: "#"}
  • {icon: "youtube", url: "#"}
  • {icon: "vk", url: "#"}
  • {icon: "behance", url: "#"}
  • {icon: "stack-overflow", url: "#"}
  • {icon: "dribbble", url: "#"}
  • {icon: "rss", url: "#"}

Follow Us

  • {icon: "facebook", url: "#"}
  • {icon: "twitter", url: "#"}
  • {icon: "youtube", url: "#"}
  • {icon: "instagram", url: "#"}
  • {icon: "rss", url: "#"}

Comments

Recent

Bottom Ad [Post Page]

Total Tayangan Halaman

https://www.idblanter.com https://www.idblanter.com
https://www.idblanter.com

Cari Blog Ini

Archive

Text Widget

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation test link ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate another link velit esse cillum dolore eu fugiat nulla pariatur.

Sample Text

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Tags

Followers

Tags