Router proxy

3

Click here to load reader

description

tambahan panduan debian 4 - router proxy - materi untuk siswa tkj

Transcript of Router proxy

Page 1: Router proxy

ROUTER PROXY Opsi Konfigurasi

- Eth0 = interface yg menuju ke internet (interface Public). IP address menyesuaikan dengan ip yang diberikan oleh ISP

- Eth1 = interface untuk jaringan local. Pada latihan ini menggunakan 192.168.50.1/24 - Gateway = sesuaikan dengan gateway yang didapat dari ISP - IP DNS = sesuaikan dengan IP yang didapat dari ISP - NAT - Proxy transparent port 3128 - Cache administrator [email protected] - Visible hostname www.sekolah.sch.id

1. Konfigurasi IP Address

Untuk menambah IP address pada mesin debian, edit file /etc/network/interfaces Perintah : # nano /etc/network/interfaces

Kemudian tambahkan kalimat dibawah ini : Allow-hotplug eth1 Iface eth1 inet static Address 192.168.50.1 Netmask 255.255.255.0 Network 192.168.50.0 Broadcast 192.168.50.255 Keseluruhan file /etc/network/interfaces tampak pada gambar dibawah ini :

2. Edit file /etc/sysctl.conf : # nano /etc/sysctl.conf

Hilangkan tanda pagar (#) di depan net.ipv4.ip_forward=1

Page 2: Router proxy

3. Tambahkan rule firewall untuk NAT dan Proxy transparent pada file /etc/rc.local sebelum exit 0 (untuk NAT) Iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE (untuk Transparent Proxy) Iptables –A PREROUTING –t nat –p tcp –dport 80 –j REDIRECT –to-port 3128

4. Restart system : # reboot 5. Install Squid

Perintah yang digunakan : # apt-get install squid

Backup squid.conf yang asli agar supaya tidak rusak #cp /etc/squid/squid.conf /etc/squid/squid.conf.bak

Hapus squid.conf # rm /etc/squid/squid.conf

Buat squid.conf baru # touch squid.conf

# nano squid.conf Ketikkan script dibawah ini : acl all src all

acl localnet src 192.168.50.0/24 acl situs url_regex –i “/etc/squid/blok.txt” http_access deny situs http_access allow localnet http_access allow all http_port 3128 transparent cache_mgr [email protected] cache_dir aufs /cache 100 24 256 cache_access_log /var/log/squid/access.log visible_hostname www.sekolah.sch.id

Page 3: Router proxy

Simpan konfigurasi, tekan Ctrl+O , ENTER, Ctrl+X

6. Buat file data situs yang akan diblokir dengan nama blok.txt # touch /etc/squid/blok.txt

# nano /etc/squid/blok.txt

Ketikkan : Youtube.com Facebook.com

Simpan konfigurasi, tekan Ctrl+O, ENTER, Ctrl+X Setting permissions # chown –R proxy:proxy /etc/squid/blok.txt

7. Buat cache_dir : # mkdir /cache

Setting permissions # chown –R proxy:proxy /cache

8. Hentikan service squid : # /etc/init.d/squid stop 9. Gunakan perintah : # squid –z untuk menciptakan swap directories