Konfigurasi router
*Sudo gedit /etc/sysctl.conf
#net/ipv4/ip_forward=1
*Sudo sysctl –p
*Sudo iptables –t nat –A POSTROUTING –s 192.168.0.0/24 –d 0/0
–j MASQUERADE
*Sudo gedit /etc/rc.local
iptables –t nat –A POSTROUTING –s 192.168.0.0/24 –d 0/0 –j MASQUERADE
*sudo reboot
*sudo iptables –L –t nat
squid
*apt-get purge squid(untuk uninstal)
*apt-get update squid (untuk mengupdate squid)
*sudo apt-get install squid
*sudo gedit /etc/squid/squid.conf
#http_port 3128 transparent
#cache_effective_user proxy
#cache_effective_group
proxy (nulis sendiri)
#cache_mem 16 MB
#cache_mgr webmaster@skull.net
#cache_dir ufs /var/spool/squid 100 16 256
Menjadi cache_dir ufs /cache 2000 16 256
#recommended minimum configuration
cari acl all src 0.0.0.0/0.0.0.0
tulis acl lan src192.168.50.0/255.255.255.0 Ditulis dibawah acl localhost src
http_access allow localhost
http_access allow lan (ditulis sendiri)
# And finally deny all other access to this proxy
http_access deny all
visible_hotname proxy.skull.net
*sudo mkdir -p /cache
*sudo chown proxy.proxy /cache
*sudo squid -z
*sudo /etc/init.d/squid start
konfigurasi transparent
proxy
*sudo /etc/init.d/squid restart
*sudo iptable -t nat -A PREROUTING -p tcp -s 192.168.0.0/24 --dport
80 -j DNAT --to-destination 192.168.0.1:3128(ip sendiri)
Copy perintah diatas ke rc local
*sudo /etc/init.d/squid restart
menblokir situs
perintah ditulis di bawah method CONNECT
acl domain-terlarang dstdomain “/etc/squid/domain-terlarang”
acl kata-terlarang url_regex -i “/etc/squid/kata-terlarang”
acl ip-terlarang dst “/etc/squid/ip-terlarang”
http_access deny domain-terlarang
http_access deny kata-terlarang
http_accessdeny ip-terlarang
*sudo gedit /etc/squid/domain-terlarang
*sudo /etc/init.d/squid restart
*sudo gedit /etc/squid/kata-terlarang
*sudo /etc/init.d/squid restart
*sudo gedit /etc/squid/ip-terlarang
*sudo /etc/init.d/squid restart
finish.................
NB= yg bertanda (*) ditulis di terminal
yg lain di squid & rc local
NB= yg bertanda (*) ditulis di terminal
yg lain di squid & rc local
0 komentar:
Posting Komentar