-
My Reason To Life Is...
try and error documentation by me
Terimakasih telah mengunjungi blog ini, silahkan tinggalkan comment anda....
eri seta

Clear Squid Cache

Tadi pagi iseng ngecek router.
#df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ad0s1a 496M 214M 242M 47% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/ad0s1h 10G 9.8G 200M 98% /cache
/dev/ad0s1g 496M 22K 456M 0% /home
/dev/ad0s1f 496M 12K 456M 0% /tmp
/dev/ad0s1d 3.9G 1.3G 2.2G 38% /usr
/dev/ad0s1e 1.9G 499M 1.3G 27% /var
devfs 1.0K 1.0K 0B 100% /var/named/dev

wahhhh, squid cache ku dah penuh. Gini ni kalo cuma punya hardisk kecil. Baru dipasang 1 bulan sudah penuh. Ya terpaksa dibersihin.
Matiin dulu daemon squidnya, pake kill PID
#ps ax |grep squid
598 ?? Is 0:00.00 /usr/local/squid/sbin/squid -sDY
599 ?? S 0:19.00 (squid) -sDY (squid)
#kill 598
#rm -R /cache
buat ulang cachenya
#/squid/sbin/squid -z
jalankan kembali squid
#/squid/sbin/squid -sYD
cek aktivitas squid
#tail -f /var/log/squid/access.log
dah jalan, kapan ya dibeliin hardisk baru yang lebih guedeeeee......

Baca Selengkapnya ...

Load Balance 2 Speedy dengan OpenBSD + DHCP Server

Berawal dari baca artikel dari mas Yulian. Dan kebetulan seorang temenku baru bikin warnet pake 2 speedy office. Nah aku disuruh menggabungkan 2 line speedy dalam 1 LAN. Udah disiapin 1 komputer buat router dengan spek P4 dual core, ram 512Mb (sebenernya masih kurang untuk proxy server), HD 80G Sata, Lan Card 2 + 1 Onboard.
Nah tadinya rencananya sih mau pake mikrotik, eh malah dikasih HD SATA. Secara mikrotik 2.9.27 kan belum bisa pake SATA. Berbekal dari artikel itu akhirnya aku gunakan OpenBSD.

1. Install OpenBSD
Partisi HD 80G
5G /
1G swap
40G /cache #untuk cache squid proxy
10G /usr
10G /var
5G /tmp
sisa /home

Set instalasi
[X] bsd
[X] bsd.rd
[X] bsd.mp
[X] base41.tgz
[X] etc41.tgz
[X] misc41.tgz
[X] comp41.tgz
[X] man41.tgz
Disini aku menyertakan set bsd.mp karena menggunakan multi processor (p4 dual core).

selesai, reboot. kemudian mount cd openBSD untuk mengcopy source dan paket yang akan digunakan untuk mengcompile kernel kelak.
#mount /dev/cd0a /mnt
#tar -zxvf /mnt/packages/src.tar.gz -C /usr/src
#tar -zxvf /mnt/packages/sys.tar.gz -C /usr/src
#pkg_add -v /mnt/packages/dmassage-0.6.tgz #untuk menyesuaikan kernel dengan dmesg saat compile.
#pkg_add -v /mnt/packages/nano-2.0.3.tgz #text editor
#pkg_add -v /mnt/packages/ifstat-1.1p0.tgz
#pkg_add -v /mnt/packages/nmap-4.11p1.tgz
#pkg_add -v /mnt/packages/oidentd-2.0.7p1.tgz
#pkg_add -v /mnt/packages/pfstat-2.2p0.tgz
#pkg_add -v /mnt/packages/pftop-0.5.tgz

Catatan: Paket-paket yang diinstal sesuaikan dengan kebutuhan. Juga dapat diinstal melalui Port.

2. Compile Kernel
#cd /usr/src/sys/arch/i386/conf
#dmassage -s GENERIC >SKYNET
#nano -w SKYNET
tinggal sesuaikan sesuai hardware kita
tambahkan option berikut untuk optimasi squid diskd
option BUFCACHEPERCENT=15
option MSGMNB=16384
option MSGMNI=60
option MSGSEG=4096
option MSGSSZ=64
option MSGTQL=1024

kemudian keluar dan save.
#config SKYNET
#cd ../compile/SKYNET
#make clean && make depend && make
#rm -rf /usr/obj/*
#cd /usr/src
#make obj
#cd /usr/src/etc && env DESTDIR=/ make distrib-dirs
#cd /usr/src
#make build
tinggal tidur dulu, biasanya memakan waktu 3 jam.
setelah selesai kita ganti kernel kita
#cp /bsd /bsd.bak
#cp /usr/src/sys/arch/i386/compile/SKYNET/bsd /bsd
#reboot
untuk mengecek gunakan
#uname -a
harusnya kernel GENERIC sudah berubah menjadi SKYNET

3. Konfigurasi
Saya menggunakan konfigurasi sesuai artikelnya mas Yulian. Tinggal disesuaikan interface dan IP addressnya.
a. Aktifkan forwarding di /etc/sysctl.conf

net.inet.ip.forwarding=1
atau dengan
sysctl -w net.inet.ip.forwarding=1

b. Pastikan konfigurasi interface dan default routing kosong, hanya filename saja
Disini saya menggunakan card dari realtek
# /etc/hosts.rl0
# /etc/hosts.rl1
# /etc/hostname.rl0
# /etc/hostname.rl1
# /etc/mygate

Konfigurasi ethernet local /rl2
#touch /etc/hostname.rl2
#nano -w /etc/hostname.rl2
inet 192.168.1.100 255.255.255.0 NONE
media 100baseTX mediaopt full-duplex
description "ke LAN dan Gateway client"

Script koneksi DSL Speedy, pppoe0 untuk koneksi pertama dan pppoe1 untuk koneksi kedua. Sesuaikan interface, username dan passwordnya. Jangan lupa, gunakan indent tab.

# mv /etc/ppp/ppp.conf /etc/ppp/ppp.conf.bak
#touch /etc/ppp/ppp.conf
#nano -w /etc/ppp/ppp.conf
isi dengan=
default:
set log Phase Chat LCP IPCP CCP tun command
set redial 15 0
set reconnect 15 10000
pppoe0:
set device "!/usr/sbin/pppoe -i rl0"
disable acfcomp protocomp
deny acfcomp
set mtu max 1492
set mru max 1492
set crtscts off
set speed sync
enable lqr
set lqrperiod 5
set cd 5
set dial
set login
set timeout 0
set authname blahblahblah@telkom.net #nama
set authkey asaljangandejek #password
add! default HISADDR
enable dns
enable mssfixup
pppoe1:
set device "!/usr/sbin/pppoe -i rl1"
disable acfcomp protocomp
deny acfcomp
set mtu max 1492
set mru max 1492
set crtscts off
set speed sync
enable lqr
set lqrperiod 5
set cd 5
set dial
set login
set timeout 0
set authname blahblahblah2@telkom.net
set authkey vikingboneksamasaja
add! default HISADDR
enable dns
enable mssfixup

c. Aktifkan interface rl0 dan rl1

# ifconfig rl0 up
# ifconfig rl1 up

d. Jalankan PPPoE, Point to Point Protocol over Ethernet.

# ppp -ddial pppoe0
# ppp -ddial pppoe1

e. Jika koneksi Speedy berhasil, IP address dari Speedy akan di-binding di interface tunneling tun0 dan tun1
Disini saya tidak memasukkan hasil ifconfig saya, tapi ini cuma sebagai perbandingan aja. Sebagai catatan diperlukan waktu untuk dial ke speedy jadi ifconfig seperti ini tidak langsung keluar.
# ifconfig
tun0: flags=8051 mtu 1492
groups: tun egress
inet 125.xxx.xxx.113 –> 125.163.72.1 netmask 0xffffffff
tun1: flags=8051 mtu 1492
groups: tun
inet 125.xxx.xxx.114 –> 125.163.72.1 netmask 0xffffffff

f. Dan default gateway akan aktif

# netstat -nr |more
uttuk melihat list routing

g. Serta konfigurasi resolver DNS pun akan terisi secara otomatis

# cat /etc/resolv.conf
lookup file bind
nameserver 202.134.2.5
nameserver 203.130.196.5

h. Aktifkan Packet Firewall pf

# /etc/rc.conf
pf=”YES”

i. Script Packet Firewall NAT dan balancing dengan round-robin
#nano -w /etc/pf.conf
lan_net = "10.0.0.0/8" #IP client
int_if = "rl2" #interface LAN
ext_if1 = "tun0"
ext_if2 = "tun1"
ext_gw1 = "125.163.72.1"
ext_gw2 = "125.163.72.1"
# scrub all
scrub in all
# nat outgoing connections on each internet interface
nat on $ext_if1 from $lan_net to any -> ($ext_if1)
nat on $ext_if2 from $lan_net to any -> ($ext_if2)
# pass all outgoing packets on internal interface
pass out on $int_if from any to $lan_net
# pass in quick any packets destined for the gateway itself
pass in quick on $int_if from $lan_net to $int_if
# load balance outgoing tcp traffic from internal network.
pass in on $int_if route-to \
{ ($ext_if1 $ext_gw1), ($ext_if2 $ext_gw2) } round-robin \
proto tcp from $lan_net to any flags S/SA modulate state
# load balance outgoing udp and icmp traffic from internal network
pass in on $int_if route-to \
{ ($ext_if1 $ext_gw1), ($ext_if2 $ext_gw2) } round-robin \
proto { udp, icmp } from $lan_net to any keep state
# general "pass out" rules for external interfaces
pass out on $ext_if1 proto tcp from any to any flags S/SA modulate state
pass out on $ext_if1 proto { udp, icmp } from any to any keep state
pass out on $ext_if2 proto tcp from any to any flags S/SA modulate state
pass out on $ext_if2 proto { udp, icmp } from any to any keep state

j. Aktifkan script yang diperlukan di /etc/rc.local agar setiap reboot langsung bekerja.

ifconfig rl0 up
ifconfig rl1 up
# aktifkan speedy
ppp -ddial pppoe0
ppp -ddial pppoe1

PF akan langsung bekerja membaca /etc/pf.conf.
Jika harus me-restart koneksi DSL Speedy, pastikan pppoe dimatikan dulu

# pkill ppp

Jika tidak, maka ppp akan membuat tunneling baru menjadi tun2, tun3 dan seterusnya.

4. DHCP Server
Karena ga mau repot setting client aku juga disuruh pake DHCP untuk koneksi dari client.
Aktifkan service DHCP
#nano -w /etc/rc.local
ubah dhcpd_flags=NO menjadi dhcpd_flags=""

Menentukan interface yang akan digunakan
#nano -w /etc/dhcpd.interfaces
rl2 #interface LAN

Konfigurasi DHCP
rubah sesuai dengan keperluan
#nano -w /etc/dhcpd.conf
option domain-name "gw.sky.net"
option domain-name-servers 203.xxx.xxx.xxx, 203.xxx.xxx.xxx; #diisi dengan DNS
subnet 192.168.1.0 netmask 255.255.255.0
{
option routers 192.168.1.100; # gateway komputer client
range 192.168.1.1 192.168.1.64; #range ip yang digunakan client
}

keluar, save, reboot............

Untuk setting load balance dan DHCP selesai. Untuk proxy sesuaikan dengan kebutuhan. Tinggal tambahkan redirector pada pf.conf ke port dan ip squid (tentunya jika kita menggunakan squid proxy, kalo tidak ga perlu).
Tambahkan rule berikut pada pf.conf , letakkan setelah rule nat.

rdr on $int_if proto tcp from any to any port 80 -> 192.168.1.100 port 3128

untuk mengecek pf gunakan command
pfctl -f /etc/pfctl #merestart
pfctl -sq #mengecek
pfctl -vvsq #monitoring
pfctl -sn #cek rule

Terimakasih untuk artikel dari mas Yulian dan mas ree_bood yang telah banyak membimbing saya. Iya mas, udah sering ketawa sendiri. Sesuai dengan prediksi anda.


****** wah disini ada kesalahan yang belum aku perbaiki, aku kurang perhatikan artikel mas jay. kalo proxy sama router ga boleh digabung. Tapi malah aku gabung, jadinya pas Load Balancenya diaktivin malah lemot. jadi Router sama Proxy harus dipisah.******

Baca Selengkapnya ...

Maksudnya gimana sih no orang

Kemaren pulang dari ngrakit komputer di tempet temenku, dah dapet makan dapat pesangon lagi (huehuehue....). Nah dijalan lagi nyantai naik motor, tiba-tiba di depanku ada yang ngerem mendadak trus jatuh gara-gara mau nabrak pak parkir yang nyeberang jalan. Didepan Empire Jl. Gajayan. Pak parkir nyeberang dari arah Togas Mas. Si pengendara motor itu terkapar di tengah jalan. Aku kurang jelas siapa yang salah. Tiba-tiba dah jatuh aja.
Kemudian pak parkir nyamperin si pengendara motor yang jatuh tertimpa motor. Pertama aku kira mau nolong, tapi ternyata malah nendangin si pengendara motor. Dah terkapar, tertimpa motor masih ditendang lagi. 4 kali tendangan mendarat di punggung si pengendara motor.

Apa maksudnya coba? Pak parkir kayaknya gengsi sama temen-temennya. Soalnya dah hampir ditabrak ko malah nolongin. Apa dia mau nunjukin, "ini lho aku. Berani2nya mau nabrak aku, kurang ajar.Belum tahu siapa aku pa?". Sepertinya banyak moral-moral preman di jiwa bangsa ini. Terlalu menjunjung tinggi harga diri, ga mau dipermalukan walaupun salah pun kadang masih ngeyel.
Pulang trus istirahat. Malemnya berguru lagi. Mancari ilmu ke mbah dukun OpenBSD. Sory ya mbah dukun, ga bawa menyan sama sesajen. huehuehue....

Baca Selengkapnya ...

Download Rapidshare

List rapid downloader:
www.nbe-media.com/download/index.php
www.wallpapertrade.com
www.rapidshare-ar.com
viete.info
www.rapid4free.com
www.rapidhack.prv.pl
www.rsfox.com/generator.php
www.rapidfile.us
www.rapidsharepremiumlinkgenerator.com

Baca Selengkapnya ...

Install squidGuard di Proxy FreeBSD

Sebelumnya kita memerlukan Install BerkeleyDB
#cd /usr/src
#wget http://download.oracle.com/berkeley-db/db-4.3.29.tar.gz
#tar -zxvf db-4.3.29.tar.gz
#cd db-4.3.29
#cd build_unix
#../dist/configure –prefix=/usr/local/BerkeleyDB
#make && make install
#vi /etc/ld.so.conf.d/BerkeleyDB.conf
isi dengan /usr/local/BerkeleyDB/lib
# ldconfig

Sekarang kita install squidGuard
#cd /usr/src
#wget http://www.squidguard.org/Downloads/squidGuard-1.3.tar.gz
#tar -zxvf squidGuard-1.3.tar.gz
#cd squidGuard-1.3
#./configure --with-db=/usr/local/BerkeleyDB
#make && make test && make install

Sekarang kita download blacklistnya bisa dilihat di http://www.squidguard.org/blacklists.html
disini aku pakai shallalist
#cd /usr/src
#wget http://www.shallalist.de/Downloads/shallalist.tar.gz
#tar -zxvf shallalist.tar.gz
akan terbentuk folder "BL" yang berisi list blacklist untuk squidGuard
#mv BL /usr/local/squidGuard/db
#vi /usr/local/squidGuard/squidGuard.conf

contoh isinya
---------------BOF---------------------
#
# CONFIG FILE FOR SQUIDGUARD
#

dbhome /usr/local/squidGuard/db
logdir /usr/local/squidGuard/log

dest sex {
domainlist BL/sex/lingerie/domains
urllist BL/sex/lingerie/urls
}
dest porn {
domainlist BL/porn/domains
urllist BL/porn/urls
}

acl {
default {
pass !sex !porn all
redirect http://www.google.com
}
}
---------------EOF---------------------

Selanjutnya bisa disesuaikan menurut kebutuhan.
untuk mengintegrasikan dengan squid perlu ditambahkan baris berikut di squid.conf
redirect_program /usr/local/bin/squidGuard -c /usr/local/squidGuard/squidguard.conf

Jalankan squidGuard
#/usr/local/bin/squidGuard -c /usr/local/squidGuard/squidGuard.conf
tunggu sampai selesai meload listnya
setelah selesai cek log nya
#tail -f usr/local/squidGuard/log/squidGuard.log

perhatikan lognya untuk memastikan tidak ada error
2008-05-01 11:25:45 [1502] init domainlist /usr/local/squidGuard/db/blacklist/sex/lingerie/domains
2008-05-01 11:25:47 [1502] init urllist /usr/local/squidGuard/db/blacklist/sex/lingerie/urls
2008-05-01 11:25:47 [1502] init domainlist /usr/local/squidGuard/db/blacklist/porn/domains
2008-05-01 11:25:47 [1502] init domainlist /usr/local/squidGuard/db/blacklist/porn/urls
2008-05-01
11:25:47 [1502 squidGuard 1.3 started (1209638897.018)
2008-05-01
11:25:47 [1502] squidGuard ready for requests (1209638897.059)

Jika tidak ada error kita restar squid,
#/usr/local/squid/sbin/squid -k reconfigure --------- disesuaikan direktori squid

Periksa apakah program sudah jalan
#ps ax | grep squid
604 ?? Is 0:00.00 /usr/local/squid/sbin/squid -D
608 ?? S 0:42.63 (squid) -D (squid)
803 ?? Ss 0:00.12 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf (squidGuard)
804 ?? Ss 0:00.01 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf (squidGuard)
805 ?? Ss 0:00.01 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf (squidGuard)
806 ?? Ss 0:00.01 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf (squidGuard)
807 ?? Ss 0:00.01 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf (squidGuard)


Baca Selengkapnya ...