Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Installasi HTPROXY
- topologinya Squid sejajar client ( ip proxy satu subnet dgn client)
- MODEM------MT-----Swicth----client
- |
- Ubuntu 12.04
- LOKAL = 192.168.2.30/24
- Client = 192.168.2.2-192.168.2.19
- PROXY = 192.168.2.20
- /ip firewall nat
- add action=dst-nat chain=dstnat comment="TRANSPARENT PROXY SEJAJAR" disabled=no dst-port=80 in-interface=Local protocol=tcp src-address=!192.168.2.20 to-addresses=\
- 192.168.2.20 to-ports=3128
- add action=src-nat chain=srcnat disabled=no out-interface=Local protocol=tcp src-address-list=Local-Address to-addresses=192.168.2.30 to-ports=0-65535
- /ip firewall address-list add address=192.168.2.1-192.168.2.29 list=Local-Address
- tolong disesuaikan
- Ubuntu 12 32 bit
- proxy minimal p4 memory 1 G, hardisk 80 G kalo hardisk lebih besar memory harap ditambah
- ip 192.168.2.20
- netmask 255.255.255.0
- gateway 192.168.2.30
- host = proxy
- domain = local.war.net
- Memory = 1024 MB; HDD 80 Giga
- partisi
- / root 28 G ext4
- /cache-1 30 G ext4
- /cache-2 30 G ext4
- /cache-3 30 G ext4
- SWAP 2 G
- Enable root access
- sudo passwd
- mulai installasi via remote as root
- tambah repo webmin, dotdeb dan installasi build-essential supaya extract tar.bz2 tidak error
- [CODE]
- echo deb http://download.webmin.com/download/repository sarge contrib | tee -a /etc/apt/sources.list
- cd /root
- wget http://www.dotdeb.org/dotdeb.gpg
- cat dotdeb.gpg | apt-key add -
- wget http://www.webmin.com/jcameron-key.asc
- apt-key add jcameron-key.asc
- apt-get update && apt-get install build-essential
- [/CODE]
- Tuning Up
- Optimalkan file system cache & ubah opsi untuk partisi cache
- Disabled fsck (file system check)
- Angka standart Drive Cache adalah 0 2 ——>> ganti dengan 0 0 (INGAT HANYA DRIVE CACHE)
- Opsi Directory /cache :
- gunakan opsi noatime,barrier=0 0 0
- nano /etc/sysctl.conf
- kernel.sysrq = 0
- kernel.core_uses_pid = 1
- kernel.msgmax = 65536
- kernel.msgmnb = 65536
- kernel.randomize_va_space = 1
- kernel.shmall = 268435456
- kernel.shmmax = 268435456
- net.core.rmem_default = 524288
- net.core.rmem_max = 524288
- net.core.wmem_default = 524288
- net.core.wmem_max = 524288
- net.core.optmem_max = 57344
- net.ipv4.ipfrag_high_thresh = 512000
- net.ipv4.ipfrag_low_thresh = 446464
- net.ipv4.conf.all.accept_redirects = 0
- net.ipv4.conf.default.accept_redirects = 0
- net.ipv4.conf.all.accept_source_route = 0
- net.ipv4.conf.default.accept_source_route = 0
- net.ipv4.conf.all.rp_filter = 1
- net.ipv4.conf.default.rp_filter = 1
- net.ipv4.conf.all.send_redirects = 0
- net.ipv4.conf.default.send_redirects = 0
- net.ipv4.conf.all.secure_redirects = 0
- net.ipv4.conf.default.secure_redirects = 0
- net.ipv4.conf.all.log_martians = 0
- net.ipv4.conf.default.log_martians = 0
- net.ipv4.conf.all.bootp_relay = 0
- net.ipv4.conf.all.proxy_arp = 0
- net.ipv4.tcp_rmem = 4096 87380 524288
- net.ipv4.tcp_wmem = 4096 87380 524288
- net.ipv4.tcp_mem = 524288 524288 524288
- net.ipv4.tcp_max_tw_buckets = 1440000
- net.ipv4.tcp_max_orphans = 1440000
- net.ipv4.tcp_tw_recycle = 1
- net.ipv4.tcp_tw_reuse = 1
- net.ipv4.tcp_rfc1337 = 1
- net.ipv4.tcp_fin_timeout = 15
- net.ipv4.tcp_keepalive_time = 300
- net.ipv4.tcp_keepalive_probes = 5
- net.ipv4.tcp_keepalive_intvl = 15
- net.ipv4.tcp_dsack = 1
- net.ipv4.tcp_sack = 1
- net.ipv4.tcp_fack = 1
- net.ipv4.tcp_syncookies = 1
- net.ipv4.tcp_max_syn_backlog = 2048
- net.ipv4.tcp_synack_retries = 2
- net.ipv4.tcp_timestamps = 0
- net.ipv4.tcp_window_scaling = 1
- net.ipv4.ip_forward = 1
- net.ipv4.ip_local_port_range = 1024 65535
- net.ipv4.ip_no_pmtu_disc = 0
- net.ipv4.icmp_echo_ignore_all = 1
- net.ipv4.icmp_echo_ignore_broadcasts = 1
- net.ipv4.icmp_ignore_bogus_error_responses = 1
- net.ipv4.route.flush = 1
- vm.swappiness = 15
- setelah di save,
- sysctl -p
- untuk optimalisasi lainnya silahkan cari sendiri
- Install squid
- [CODE]
- cd /home
- wget http://squid-proxy-pkg.googlecode.com/files/deb-htproxy_14942_i386.tar.bz2
- tar xvf deb-htproxy_14942_i386.tar.bz2
- dpkg -i *.deb
- /etc/init.d/squid stop
- [/CODE]
- pake winscp edit
- /etc/squid/squid.conf
- edit squid.conf sesuai kondisi
- kalo saranku sih
- cache_dir aufs /cache-1 20000 20 256
- cache_dir aufs /cache-2 20000 20 256
- cache_dir aufs /cache-3 20000 20 256
- #CONTOH DNS GOOGLE
- dns_nameservers 203.130.208.18
- dns_nameservers 203.130.193.74
- dns_nameservers 203.130.196.5
- dns_nameservers 222.124.204.34
- dns_nameservers 203.130.196.6
- dns_nameservers 208.67.222.222
- dns_nameservers 208.67.220.220
- dns_nameservers 180.131.144.144
- dns_nameservers 180.131.145.145
- chown proxy:proxy /cache-1 && chmod 777 /cache-1
- chown proxy:proxy /cache-2 && chmod 777 /cache-2
- chown proxy:proxy /cache-3 && chmod 777 /cache-3
- squid -z
- squid -f /etc/squid/squid.conf -z && /etc/init.d/squid start
- Agar proses shutdown dapat langsung dijalankan dengan menekan tombol Power gunakan perintah berikut:
- apt-get install acpid
- iptables -F
- iptables -X
- iptables -t nat -F
- iptables -t nat -X
- iptables -t mangle -F
- iptables -t mangle -X
- iptables -P INPUT ACCEPT
- iptables -P OUTPUT ACCEPT
- iptables -A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 53 -j ACCEPT
- iptables -A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 53 -j ACCEPT
- iptables -A INPUT -p tcp -s 192.168.2.0/24 --dport 80 -j ACCEPT
- iptables -A INPUT -p tcp -s 192.168.2.0/24 --dport 3128 -j ACCEPT
- iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
- iptables-save -c > /etc/iptables.up.rules
- apt-get -y install gcc build-essential sharutils ccze libzip-dev automake1.9 make webmin
Advertisement
Add Comment
Please, Sign In to add comment