sebelum konfigurasi proxy, sharing internet antara client dan sserver.
langkahnya:
1. sudo su
2. cd
3. pico /etc/sysctl.conf
hapus tanda pagar/# pada net.ipv4.ip-forward = 1
kemudian save (ctrl O)
4. pico masquerade
isikan:
#!/bin/bash
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.9.0/24 -d 0/0 -j MASQUERADE
5. kemudian save (ctrl O)
6. chmod u+x masquerade
7. ./masquerade
8. cek pc client:
ping google.com
langkah-langkah konfigurasi proxy server:
1. sudo apt-get install squid
2. cp /etc/squid/squid.conf /etc/squid/squid.conf.original
3. rm /etc/squid/squid.conf
4. pico /etc/squid/squid.conf
isikan perintah sebagai berikut:
acl all src all
acl localnet src 192.168.9.0/24 (ip local)
acl situs url_regex -i "/etc/squid/blokir.txt"
http_access deny situs
http_allow localnet
http_allow all
http_port 3128 transparent
cache_mem 8 mb
memory_replacement_policy heap GDFS
cache_replacement_policy heap LFUDA
store_dir_select_algorithm round-robin
cache_dir aufs /cache 10000 24 256
cache_store_log none
cache_access_log /var/log/squid/access.log
cache_effective_user proxy
cache_effective_group proxy
visible_hostname tkj09
5. pico /etc/squid/blokir.txt
isikan, misal:
www.facebook.com
www.youtube.com
6. mkdir /cache
7. chown -R proxy:proxy /etc/squid/blokir.txt
8. chown -R proxy:proxy /cach
9. /etc/init.d/squid stop
10. squid -z
11. /etc/init.d/squid start
12. pico /etc/rc.local
isikan, (sebelum exit 0):
iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 3128
13. /etc/init.d/squid restart
jika tidak bisa restart komputer kemudian:
jalankan routing : ./routing
restart squid : /etc/init.d/squid restart
langkahnya:
1. sudo su
2. cd
3. pico /etc/sysctl.conf
hapus tanda pagar/# pada net.ipv4.ip-forward = 1
kemudian save (ctrl O)
4. pico masquerade
isikan:
#!/bin/bash
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.9.0/24 -d 0/0 -j MASQUERADE
5. kemudian save (ctrl O)
6. chmod u+x masquerade
7. ./masquerade
8. cek pc client:
ping google.com
langkah-langkah konfigurasi proxy server:
1. sudo apt-get install squid
2. cp /etc/squid/squid.conf /etc/squid/squid.conf.original
3. rm /etc/squid/squid.conf
4. pico /etc/squid/squid.conf
isikan perintah sebagai berikut:
acl all src all
acl localnet src 192.168.9.0/24 (ip local)
acl situs url_regex -i "/etc/squid/blokir.txt"
http_access deny situs
http_allow localnet
http_allow all
http_port 3128 transparent
cache_mem 8 mb
memory_replacement_policy heap GDFS
cache_replacement_policy heap LFUDA
store_dir_select_algorithm round-robin
cache_dir aufs /cache 10000 24 256
cache_store_log none
cache_access_log /var/log/squid/access.log
cache_effective_user proxy
cache_effective_group proxy
visible_hostname tkj09
5. pico /etc/squid/blokir.txt
isikan, misal:
www.facebook.com
www.youtube.com
6. mkdir /cache
7. chown -R proxy:proxy /etc/squid/blokir.txt
8. chown -R proxy:proxy /cach
9. /etc/init.d/squid stop
10. squid -z
11. /etc/init.d/squid start
12. pico /etc/rc.local
isikan, (sebelum exit 0):
iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 3128
13. /etc/init.d/squid restart
jika tidak bisa restart komputer kemudian:
jalankan routing : ./routing
restart squid : /etc/init.d/squid restart