Archive for May, 2005

Running Ragnarok Game di linux

Wednesday, May 25th, 2005

Microsoft razia windows bajakan ???? …. he he he apa ngga takut tuh ????

Semua orang pada pindah ke linux , buat rekan2 yang pingin migrate ke linux terutama yang punya warnet game, ada sedikit trick buat running RO game di linux, trick ini sudah dicoba dan berjalan meskipun rada buggy tapi daripada kena razia ???

berikut ini cara cara nya :

1. install dulu ragnarok game di satu windows box, udah gitu installin aja ragnarok game kamu plus updatenya. pastiin ada space partisi buat linux OS nya ( aku pake fedora core 3 ).

2.Trus install linux dipasrtisi ke dua, jangan lupa install wine-nya juga, download aja di http://www.winehq.org.

3.Install driver VGA yang terbaru sesuai versi linux kamu. kalau saya pake NVIDIA Geforce II drivernya : NVIDIA-Linux-x86-1.0-7174-pkg1.run ( download aja di http://www.nvidia.com/linux ),
setelah setting driver, setting juga file konfigurasi wine di "/etc/wine/config", setelash itu restart Xwindows.

3.Cara runningnya : mount partisi windows ke linux, trus jalanin game ragnaroknya

misalnya: 

dengan asumsi ragnarok ada di c:\Program Files\Gravity\Ragnarok Online\ mountnya di /mnt/dos/, running command : mount -t vfat /dev/hda1 /mnt/dos

nanti jadinya /mnt/dos/Program\ Files/Gravity/Ragnarok\ Online/

nah tinggal di running aja pakai wine :

cd /mnt/dos/Program\ Files/Gravity/Ragnarok\ Online/
trus : wine Ragnarok.exe

Thats all, it’s still buggy but at least we try … get away from …..

he he he he you should try it guys …. ;)

Semoga tips ini bisa membantu meringankan beban rekan rekan yang punya warnet dan wargame,

ayo semua migrasi ke linux … he he he he …. i love it …. linux is GOOD ….

here is the screen shot :

Screenshot1 Screenshot_1

Authentikasi browsing via Squid

Wednesday, May 25th, 2005

#!/bin/sh
# setlah konfigurasi di bikin
# edit file /etc/squid/squid.conf
# ubah baris : proxy_auth /etc/squid/users.txt
# menjadi : proxy_auth "/etc/squid/users.txt"
# thats all
# thanks

echo "================================"
echo "Proxy Auth Configurator"
echo "Running on RedHat 9"
echo "created by rizky.md@gmail.com"
echo "================================"

echo "Masukkan port proxy anda (contoh :8080) :"
read PP
echo "Masukkan unkuran chace memory (contoh : 32 MB) :"
read PRMEM
echo "Masukkan pesan login (contoh : Silahkan login) :"
read PPL
echo "Masukkan hostname proxy (contoh : cumicumi) :"
read PHN
echo "Masukkan group user (contoh : pengguna) :"
read PUG

# bikin file user dan password
/bin/touch /etc/squid/passwd
chmod 755 /etc/squid/passwd
/bin/touch /etc/squid/users
chmod 755 /etc/squid/users
# backup dan setting
mv /etc/squid/squid.conf /etc/squid/squid.conf.asli
echo "# SQUID CONFIGURATION GEN- with SQUID AUTH CONFIGURATOR
http_port $PP
cache_mem $PRMEM
maximum_object_size 4096 KB
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_swap_low 80
cache_swap_high 95
cache_access_log /var/log/squid/access.log
cache_dir ufs /var/spool/squid 1000 16 256
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 10
auth_param basic realm $PPL
auth_param basic credentialsttl 2 hours
acl $PUG proxy_auth "/etc/squid/users.txt"
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/255.255.255.255
http_access allow localhost
http_access deny !$PUG
http_reply_access allow all
icp_access allow all
error_directory /usr/share/squid/errors
cache_effective_user squid
cache_effective_group squid
visible_hostname $PHN
" > /etc/squid/squid.conf
service squid restart
echo "Masukkan ip network untuk user lokal (contoh: 192.168.2.0/24) :"
read PUIP
echo "Masukkan ip interface konesi ke internet (contoh: 10.35.2.76) :"
read INTISP

# put this iptables :
/bin/touch /etc/redirector
echo "iptables -A POSTROUTING -s $PUIP -p tcp –dport 23:8000 -t nat -j SNAT –to-source $INTISP
iptables -A PREROUTING -t nat -p tcp –dport 23:8000 -j REDIRECT –to-port 8080
service iptables save
service iptables restart" > /etc/redirector
chmod 755 /etc/redirector
clear
echo "==============================================================="
echo "File konfigurasi telah berhasil !"
echo "edit file /etc/squid/users.txt, isikan nama user urut kebawah"
echo "untuk setting password jalankan perintah berikut :"
echo "htpasswd -c /etc/squid/passwd nama-user"
echo "untuk aktifkan process jalankan perintah berikut :"
echo "/etc/redirector"
echo "==============================================================="

Blocking access dari squid

Thursday, May 12th, 2005

Memblokir akses ke situs web dengan squid       
Written by Administrator    
Saturday, 28 August 2004 
Bismillahirrohmaanirrohim….

Oleh : alfinux@telkom.net

Artikel pertama saya ini akan membahas mengenai konfigurasi proxy web cache dengan squid agar dapat memblokir situs-situs tertentu, terutama situs yang bernuansa pornografi, kekerasan dan sebagainya. Hal ini mungkin diperlukan di warnet atau pun di tempat lain dimana memerlukan proteksi dari situs-situs tertentu.
Langkah yang saya lakukan telah saya uji pada sistem RH6.2 dengan squid-2.3.STABLE2 dan juga bisa diterapkan pada versi lainnya.

Catatan :
- Squid telah terinstal dengan baik dan mendukung Transparent proxy, jika belum lihat artikel "Mengkonfigurasi squid (proxy web cache) sebagai transparan proxy " oleh hari-huhui (h4ri@telkom.net).
- Ipchains atau Iptables telah terinstal dan mendukung transparent proxy.
- Alamat IP lokal yang digunakan 192.168.30.0/24
- Squid dikonfigurasi menggunakan port 8080

Prinsip Kerja :
—————–
Pada prinsipnya ada beberapa cara untuk memblokir situs porno dengan mengatur file konfigurasi "squid.conf" :
1. Menyaring berdasarkan nama domain atau URL lengkap, misalnya memblokir situs "www.playboy.com" maka cukup ditambahkan dua baris berikut ini :

acl bad dstdomain www.playboy.com
http_access deny bad

Kelemahan cara ini, situs "playboy.com" masih bisa diakses dan juga akan banyak acl yg harus di definisikan. Solusinya dengan cara membuat file khusus yg berisi daftar situs-situs yang diblokir sehingga konfigurasinya menjadi sbb :

acl bad dstdomain "/etc/squid/sex"
http_access deny bad

dan isi file "/etc/squid/sex" misalnya sbb:

vicidi.com
bedclip.com
indonona.com
exoticazza.com
dewasex.com

2. Menyaring berdasarkan kata yang terkandung pada nama domain, misalnya saya ingin memblokir situs yang mengandung kata "nude" maka konfigurasinya sbb :

acl bad url_regex -i nude
http_access deny bad

atau dengan membuat file khusus berisi daftar kata-kata yang dilarang maka sbb:

acl bad url_regex -i "/etc/squid/badwords"
http_access deny bad

dan isi file "/etc/squid/badwords" misalnya sbb:

theorgy
penthousemag
playboy
1stsex
lolita

3. Kedua cara diatas masih lemah karena situs "playboy.com" masih bisa diakses jika Anda tahu IP address situs tersebut. Tentunya hal ini terjadi jika client komputer Anda pada pinter-pinter, jika hal diatas masih belum mencukupi maka hal yang cukup berat harus kita lakukan yaitu dengan cara membuat file daftar IP address situs-situs yang diblokir. Hal ini bisa dilakukan dengan menggunakan utility nslookup, misal #nslookup playboy.com.

Contoh Konfigurasi :
————————
OK deh, cukup masalah teorinya. Berikut ini adalah konfigurasi squid yang saya buat dengan menggunakan cara ke-2 untuk memblokir beberapa situs porno :

1.) Konfigurasi "/etc/squid/squid.conf"

http_port 8080
icp_port 0
cache_mem 80 MB
maximum_object_size 256 KB
cache_dir ufs /cache 200 16 256
memory_pools_limit 32 MB
redirect_rewrites_host_header off
replacement_policy GDSF
half_closed_clients off
#———–transparent proxy ———–
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
#——————————————-
acl QUERY urlpath_regex cgi-bin ?
no_cache deny QUERY
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/255.255.255.255
acl lan src 192.168.30.0/255.255.255.0
acl Safe_ports port 80 443 210 119 563 70 21 1025-65535
acl CONNECT method CONNECT
acl notsex url_regex -i "/etc/squid/notsex"
acl sex url_regex -i "/etc/squid/sex"
no_cache deny SEX
http_access allow notsex all
http_access deny sex all
http_access allow lan
http_access allow localhost
http_access deny !Safe_ports
http_access deny CONNECT
http_access deny all
#—————- administration info ————
cache_mgr alfinux@telkom.net
cache_effective_user squid
cache_effective_group squid
log_icp_queries off
cachemgr_passwd mypassword all
forwarded_for off
buffered_logs on
visible_hostname alfinuke.edcentral.pdk
ftp_user squid@edcentral.pdk

2.) Buat daftar situs yang diblokir (vi /etc/squid/sex) dengan editor favorit Anda.
Dan berikut ini file daftar situs yg di blokir baik berdasarkan kata maupun nama situs (/etc/squid/sex):

.*.(praline|eroticworld|orion).de
.*.(theorgy|penthousemag|playboy|1stsex|lolita|sexpix|sexshop).*
.*.(smutland|hustler.onprod|hustler2.onprod|cybervixen|asiansex).*
ftp.netcom.com/pub/ac/acott
www.tvtoday.de:9600
.*.(carolcox|eroticbodies).*
.*.(cyberlustxxx|cyberporn|intersex).inter.net*
.*.(eroticxxx|sexy4you|dani|danni|hotsex|kinky|lesbos|porno|xpics).*
.*.(over21|regsex|sexnet|sextoy|smeggy|sordid).*
.*.(cybersex|hcabaret|livesex|sex4you|sexmall).*
.*.(lovesexy|nastysex|pantless|playware|showgirl).*
.*.(2xxxcite|dreamsex|futuresex|sover21sex|explaza).*
.*.(xxxparadise|playbabe|celebnude|greyhawks|sexfinder|xxx-video).*
.*.(sexaphone|beate-uhse|fantasysex|sexparlor|sexnetwork).*
.*.(cybervixen|internetsex|silverotica|erotica2000|ultimatexxx).*
.*.(xxx-rawsex-xxx|amateurs|amateursweb|erotica-toys|orion-erotic).*
.*.(sexy-jewelry|hollywoodxxx|cybererotica|sexfantasy).*
.*.(danisherotica|sexy-playmates|nastyhabits|sugarandspice|kathryn).*
.*.(persiankitty|adultplayground|supernudes|playsex).*
.*.(pinupmall|porn.byus|smutland|sizzle|heavyhangers).*
.*.(hardcorjunky|fetish|adultplayhouse|pornpics|asiansex).*
.*.(hustler|freepics|wetgirls|tropixxx|sex|pixxxcity).*
.*.(4adultsonly|peepshow|voulezvous|rated-x|69pornplace).*
.*.(shavedsluts|nudepalace|xxxguide|pics-xxx|naughty|thehotzone).*
.*.(nervemag|carolcox|snatches|freeporn|playgirlmag|cyberspice).*
.*.(erotica|afro-erotica).*
(teen|girls|xxxpic).*
(www.sex|*****.bahnhof).*
.*.(gay|sex).*
.*.fun.nl
www.playmen.it/
www.gisa.it/sex/
www.iol.it/sexol/
globall.com/j/xxx/
www.hh.nl/n-m/pic/
www.pi.net/~pauze/
www.oden.se/~hedback/
aau.diasoft.ru/~hotsex/
www.donsworld.com/xadultx/
www.well.com/user/sexymate/
ftp.zippo.com/pictures/erotica/
mm.iit.uni-miskolc.hu/Data/ladies/
drn.zippo.com/zippo-bin/wwwdecode/
pilot.msu.edu/user/rozwadow/pamela
#——manual——–
pageseeker.com
arsipceritaseru
freeones
vicidi
bedclip
indonona.com
exoticazza.com
dewasex.com
extrajos.com
bopekindo.com
sanggrahan.org
sanggrahan.com
grahan.com
vicidi.com
17tahun.com
ceritaseru.org
ceritapanas.com
celebdirectory.com
hiburan.web1000.com
seeasians.com
nyamuk.adultnations.com

3.) Daftar situs exceptions (pengecualian ;-) ) (vi /etc/squid/notsex)
Dan satu lagi daftar situs yang bukan termasuk situs porno, sebagai pencegahan agar tidak diblokir :

.*.msexchange.*
.*.msexcel.*
.*freetown.*
.*geek-girls.*
.*scsext.*
missingheart
documen
button
wirelessexcite
msexchange
msexcel
aids.lv
freetown
geek-girls
scsext
steen
adulteducation
sekst
newshits
glass
georgia
peet
chicag
speech
speed
speedtest
liputan6.com
expedia.com

Maintenance/Updating
————————–
Walaupun dengan beberapa kelemahan yang ada, tapi cara-cara yang digunakan masih cukup efektif untuk mencegah para pengguna Internet pemula mengakses situs-situs yang tidak baik. Dan tentunya tugas Anda sebagai Administrator dari proxy server tersebut adalah menjaga agar Anda tidak kalah dengan client yang lain dalam hal perbendaharaan situs "nude" yang diaksesnya. Tentu saja dengan selalu mengupdate file-file daftar tersebut (/etc/squid/sex dan /etc/squid/notsex). Jika ternyata ada situs yang client Anda ingin akses dan ternyata diblokir, maka nama situs tersebut bisa Anda masukkan pada daftar di "/etc/squid/notsex".

Halaman Peringatan/Redirector
————————————-
Dan untuk sedikit peringatan kepada client bahwa kita mengawasi aktivitas mereka, bisa dilakukan dengan memodifikasi file "/etc/squid/errors/ERR_ACCESS_DENIED" dan masukkan sedikit javascript untuk meredirect ke situs lain, contoh yang saya lakukan sbb yang akan mengarahkan client ke situs intranet atau situs lain (biar insyaf, eling atuh !!! :)) :

#————— /etc/squid/errors/ERR_ACCESS_DENIED ———————–

<HTML><HEAD>
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>

<–
var howMany = 10; // jumlah situs pengganti
var page = new Array(howMany+1);

page[0]="http://192.168.10.65";
page[1]="http://www.eramuslim.com";
page[2]="http://www.klikdt.com";
page[3]="http://www.dikmenjur.net";
page[4]="http://www.dikmenjur.com";
page[5]="http://www.jis.or.id";
page[6]="http://www.harunyahya.com";
page[7]="http://www.hidayatullah.com";
page[8]="http://www.myquran.com";
page[9]="http://www.sekolah2000.or.id";
page[10]="http://www.percikaniman.com";

function rndnumber(){
var randscript = -1;
while (randscript < 0 || randscript > howMany || isNaN(randscript)){
randscript = parseInt(Math.random()*(howMany+1));
}
return randscript;
}
quo = rndnumber();
quox = page[quo];
window.location=(quox);
</HEAD>

<BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>

——————————————————————————–

While trying to retrieve the URL:
%U

The following error was encountered:
Access Denied.

Access control configuration prevents your request from
being allowed at this time. Please contact your service provider if
you feel this is incorrect.

Your cache administrator is %w.

#————— /etc/squid/errors/ERR_ACCESS_DENIED ———————–

Pengembangan lebih lanjut dari blokir akses ini bisa menggunakan aplikasi pihak ketiga di bawah ini dan kalau ada waktu mungkin akan saya buat artikel penggunaannya ;-) :
- http://blacklist.dansguardian.org/ (DanGuardian)
- http://www.squidguard.org/ (SquidGuard)

Penutup :
———-
Demikian tulisan yang cukup panjang ini. Mudah-mudahan ada penyempurnaan dan tambahan dari para master sekalian. Terima kasih saya ucapkan kepada rekan-rekan di milis linux-admin@linux.or dan juga Master Onno ;-). Kritik,saran maupun pertanyaan silakan japri ke alfinux@telkom.net.

Referensi :
————
- Securing & Optimizing Linux : RedHat Edition by Gerhard Mourani
- Squid.conf
- http://web.onda.com.br/orso/sxcontrol.html
- http://blacklist.dansguardian.org/

Wassalamu’alaikum wr.wb.

Note: Terima kasih Alfinux atas artikel yang sangat menarik ini. Sering-sering nulis yah :)

Last Updated ( Thursday, 14 October 2004 ) 

Load Balancing dengan ethernet bonding

Thursday, May 12th, 2005

Load Balancing Dengan
Bonding Ethernet

Aris Wendy Sunyoto
aris_wendy@yahoo.com

Kebutuhan akan peningkatan performance koneksi suatu server di saat ini sudah tak dapat terelakkan lagi. Banyak teknologi yang digunakan untuk meningkatkan kualitas suatu koneksi. Taruh saja cisco dengan spaning tree nya, fault tolerance, load balancing dan sebagainya. Untuk teknologi terakhir ini penulis mencoba membahas dengan menggunakan ”bonding ethernet”. Beberapa perangkat yang dibutuhkan adalah :
1. Linux box : distro terserah…… dalam hal penulis menggunakan debian woody 3.0
2. Ethernet lebih dari 1, menurut om Donald Becker’s penulis code driver ethernet lebih baik menggunakan ethernet intel eepro100 dan 3com 3c59x
3. Bonding ethernet yang dapat anda download di
http://www.sourceforge.net/projects/bonding/
Untuk debian tinggal apt-get aja di cdrom masing masing

Load balancing pada ethernet adalah teknik untuk meningkatkan kualitas koneksi dengan jalan membagi beban (traffic) ke setiap masing masing ethernet dengan jumlah yang sama. Logikanya kita lebih memilih ethernet 100 Mbps berjumlah 10 buah dibanding 1 Gigabit full duplex. Salah satu alasan yang masuk akal adalah bootle neck.

—— eth0 ———- client
—— eth1 ———- client
—— eth2 ———- client

Untuk alasan tersebut load balancing diterapakan. Sekarang timbul pertanyaan ”Lho kalau beda ip dan network khan bisa diatasi mengapa harus dibuat teknik seperti itu ?” Good question…….but easy to answer after you read this article.
Kita nggak bisa membayangkan untuk membagi beban pada NIC (network Interface Card) anda dilakukan pembedaan IP. Teknik ini sangat sulit dilakukan mengingat aplikasi yang digunakana adalah client server. Tentu anda juga memikirkan coding untuk membuat aplikasi tersebut yang setiap usernya didefinisikan berbeda satu dengan yang lain. Ok guys……Let’s start on it…………!!!

Follow it !!!
1. Install paket bonding (ifenslave) dengan menggunakan perintah

aris-deb# apt-get install ifenslave
Reading Package Lists…
Building Dependency Tree…
The following NEW packages will be installed:
ifenslave
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/8412B of archives. After unpacking 73.7kB will be used.
Media Change: Please insert the disc labeled ‘Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-7 (20020718)’ in the drive ‘/cdrom/’ and press enter
Selecting previously deselected package ifenslave.
(Reading database … 6991 files and directories currently installed.)
Unpacking ifenslave (from …/ifenslave_0.07-1_i386.deb) …
Setting up ifenslave (0.07-1) …

Jika anda menginginkan instal dari source gunakan perintah :

gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux/include ifenslave.c -o ifenslave

2. Aktifkan masing masing ethernet yang anda punyai

aris-deb# modprobe 3c59x

3. Aktifkan ethernet bonding anda

aris-deb# modprobe bonding mode=0 miimon=200 updelay=200 downdelay=200

Keterangan mode :
mode
Specifies one of four bonding policies. The default is
round-robin (balance-rr). Possible values are (you can use either the
text or numeric option):

balance-rr or 0
Round-robin policy: Transmit in a sequential order
from the first available slave through the last. This
mode provides load balancing and fault tolerance.

active-backup or 1
Active-backup policy: Only one slave in the bond is
active. A different slave becomes active if, and only
if, the active slave fails. The bond’s MAC address is
externally visible on only one port (network adapter)
to avoid confusing the switch. This mode provides
fault tolerance.

balance-xor or 2
XOR policy: Transmit based on [(source MAC address
XOR’d with destination MAC address) modula slave
count]. This selects the same slave for each
destination MAC address. This mode provides load
balancing and fault tolerance.

broadcast or 3
Broadcast policy: transmits everything on all slave
interfaces. This mode provides fault tolerance.

miimon

Specifies the frequency in milli-seconds that MII link monitoring will
occur. A value of zero disables MII link monitoring. A value of
100 is a good starting point. See High Availability section for
additional information. The default value is 0.

downdelay

Specifies the delay time in milli-seconds to disable a link after a
link failure has been detected. This should be a multiple of miimon
value, otherwise the value will be rounded. The default value is 0.

updelay

Specifies the delay time in milli-seconds to enable a link after a
link up status has been detected. This should be a multiple of miimon
value, otherwise the value will be rounded. The default value is 0.

arp_interval

Specifies the ARP monitoring frequency in milli-seconds.
If ARP monitoring is used in a load-balancing mode (mode 0 or 2), the
switch should be configured in a mode that evenly distributes packets
across all links - such as round-robin. If the switch is configured to
distribute the packets in an XOR fashion, all replies from the ARP
targets will be received on the same link which could cause the other
team members to fail. ARP monitoring should not be used in conjunction
with miimon. A value of 0 disables ARP monitoring. The default value
is 0.

arp_ip_target

Specifies the ip address to use when arp_interval is > 0. This is the
target of the ARP request sent to determine the health of the link to
the target. Specify this value in ddd.ddd.ddd.ddd format.

primary

Specifies the preferred primary network interface in a given team. The
preferred primary interface is designated with a string value equal to
eth0, eth1, etc. and is valid in active-backup mode only. The role of
the primary adapter is to transmit and receive all data as long as the
link connection is up. If the preferred primary adapter should fail,
then a secondary adapter would take over as the new primary. The
preferred primary adapter would then take over as soon as it’s status
changes back to favorable. This parameter is beneficial when one
adapter performs better than one or more of the other adapters in a
given team, i.e. Gigabit adapter versus a Fast Ethernet adapter or an
adapter with a new chip set verses one with an older chip set.

max_bonds

Specifies the number of bonding devices to create for this
instance of the bonding driver. E.g., if max_bonds is 3, and
the bonding driver is not already loaded, then bond0, bond1
and bond2 will be created. When max_bonds is used, all bonds
controlled by that instance will have the same parameters.
The default value is 1.

multicast

Option specifying the mode of operation for multicast support.
Possible values are:

disabled or 0
Disabled (no multicast support)

active or 1
Enabled on active slave only, useful in active-backup mode

all or 2
Enabled on all slaves, this is the default

4. Konfigurasi IP dengan mengedit file /etc/network/interfaces

# /etc/network/interfaces — configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

auto bond0
iface bond0 inet static
address 192.168.22.214
broadcast 192.168.22.255
network 192.168.22.22.0
netmask 255.255.255.0

auto eth0
iface eth0 inet static
address 192.168.22.214
broadcast 192.168.22.255
network 192.168.22.22.0
netmask 255.255.255.0
up /usr/sbin/ifenslave bond0 eth0

auto eth1
iface eth1 inet static
address 192.168.22.214
broadcast 192.168.22.255
network 192.168.22.22.0
netmask 255.255.255.0
up /usr/sbin/ifenslave bond0 eth1

auto eth2
iface eth2 inet static
address 192.168.22.214
broadcast 192.168.22.255
network 192.168.22.22.0
netmask 255.255.255.0
up /usr/sbin/ifenslave bond0 eth2

5. Restart serice dan cek ulang konfigurasi

aris-deb# /etc/init.d/networking restart
aris-deb# ifconfig

6. Tambahkan bonding mode=0 miimon=100 updelay=200 downdelay=200 pada /etc/modules agar module ini dapat diload saat computer start.

7. Lihat ulang apakah bonding sudah berjalan dengan baik apa tidak..

Bonding Mode: load balancing
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200

Slave Interface: eth2
MII Status: up
Link Failure Count: 0

Slave Interface: eth1
MII Status: up
Link Failure Count: 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0

8. Testing dengan ping

64 bytes from 192.168.22.2: icmp_seq=16 ttl=128 time=0.1 ms
64 bytes from 192.168.22.2: icmp_seq=19 ttl=128 time=0.1 ms
64 bytes from 192.168.22.2: icmp_seq=22 ttl=128 time=0.1 ms
64 bytes from 192.168.22.2: icmp_seq=25 ttl=128 time=0.1 ms

icmp sequence naik 3 step menunjukkan jumlah ethernet yang bekerja. Jadi gambar diatas menunjukkan output dari 1 ethernet.

9. Lihat juga output pada iptraf berikut ini

Output diatas menunjukkan bahwa beban pada tiap tiap ethernet sama (balance). Sehingga sangat meningkatkan performance network anda.

File download dapat anda download disini

Ucapan terima kasih :
1. Om Donald Becker atas codingnya http://www.scyld.com/network/
2. Team bonding http://www.sourceforge.net/projects/bonding/

Modifikasi cbq wondershapper

Thursday, May 12th, 2005

#!/bin/bash
############################################################
# Penggunaan :
# Untuk setting awal run : /sbin/bandshape.cbq
# Untuk lihat konfigurasi run : /sbin/bandshape.cbq status ,kemudian inputkan
# device yang ingin di tampilkan
# Untuk menghentikan process run : /sbin/bandshape.cbq stop
############################################################

###############################
# Deklarasi input dari user : #
###############################
echo "Masukkan interface target ( contoh : eth0 ) :"
read DEV

#########################################################
### Buat perintah

if [ "$1" = "status" ]
then
tc -s qdisc ls dev $DEV
tc -s class ls dev $DEV
exit
fi

#### Flush error dulu mas
tc qdisc del dev $DEV root    2> /dev/null > /dev/null
tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null

if [ "$1" = "stop" ]
then
tc qdisc del dev $DEV
tc class del dev $DEV
  exit
fi

#########################################################

echo "Masukkan rate downlink anda ( contoh untuk 800 Kbit : 800 ) :"
read NYEDOT
echo "Masukkan rate uplink anda ( contoh untuk 800 Kbit : 800 ) :"
read NIUP
echo "Masukkan netmask source traffic prioritas rendah ( contoh : 255.255.255.0 ) :"
read MASREN
echo "Masukkan netmask tujuan traffic prioritas rendah ( contoh : 255.255.255.0 ) :"
read MASTIN
echo "Masukkan port source traffic prioritas rendah ( contoh : 5000 ) :"
read PORTREN
echo "Masukkan port tujuan traffic prioritas rendah ( contoh : 5000 ) :"
read PORTIN
#########################################################

#################################################
## UPLINK-na di dieu mang teu keudah di ubah ! ##
#################################################

###### Pengaturan UPLINK default
tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit
tc class add dev $DEV parent 1: classid 1:1 cbq rate ${NIUP}kbit \
allot 1500 prio 5 bounded isolated
###### Pengaturan UPLINK prioritas tinggi
tc class add dev $DEV parent 1:1 classid 1:10 cbq rate ${NIUP}kbit \
   allot 1600 prio 1 avpkt 1000
###### Pengaturan UPLINK prioritas sedang
tc class add dev $DEV parent 1:1 classid 1:20 cbq rate $[9*$NIUP/10]kbit \
   allot 1600 prio 2 avpkt 1000
###### Pengaturan UPLINK paling kasihan he he he …
tc class add dev $DEV parent 1:1 classid 1:30 cbq rate $[8*$NIUP/10]kbit \
   allot 1600 prio 2 avpkt 1000
###### Pengaturan UPLINK keseluruhan stochastic
tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
###### Pengaturan UPLINK prioritas untuk ssh delay minim
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
      match ip tos 0×10 0xff  flowid 1:10
###### Pengaturan UPLINK prioritas untuk icmp
tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 \
        match ip protocol 1 0xff flowid 1:10
###### Prioritas untuk paket lebih keci dari 64 Kbit
###### yang gede biarin aja he he he
tc filter add dev $DEV parent 1: protocol ip prio 12 u32 \
   match ip protocol 6 0xff \
   match u8 0×05 0×0f at 0 \
   match u16 0×0000 0xffc0 at 2 \
   flowid 1:10

###### Untuk yang lain ??? wayahna we mang ngempot heula :))
for a in $PORTIN
do
tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
    match ip dport $a 0xffff flowid 1:30
done
for a in $PORTREN
do
  tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
    match ip sport $a 0xffff flowid 1:30
done
for a in $MASREN
do
  tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
    match ip src $a flowid 1:30
done
for a in $MASTIN
do
  tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \
    match ip dst $a flowid 1:30
done
#### Non interaktif traffic
tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
   match ip dst 0.0.0.0/0 flowid 1:20

###################################################
## DOWNLINK-na di dieu mang teu keudah di ubah ! ##
###################################################

### Ingress policy ya …
tc qdisc add dev $DEV handle ffff: ingress

### Ngedownload kenceng teuing .. digencet saeutik ah … ###
tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
   0.0.0.0/0 police rate ${NYEDOT}kbit burst 10k drop flowid :1

##################################################
# Yach namanya juga shapper biasa mas …        #
# hasil modifikasi jadi ya beginilah             #
# ditambah lagi udah ngantuk gw nich ..          #
# dari 26 april 2005 pagi, belum tidur juga      #
# padahal sekarang udah 27 april 2005 jam 10     #
# he he he nasib mas mas …                     #
# grets to wshapper creator, deh@tes secteam     #
# cse@quasar.net.id, my hunny bunny meydewi      #
# most of all to ALLAH S.W.T the greatest        #
#                                                #
# rizky@quasar.net.id                            #
##################################################

Generator MRTG config dan compiler

Thursday, May 12th, 2005

#!/bin/sh
clear
if [ "$1" = "" ]
then
echo ""
echo "MRTG Auto Compiler by rizky.md@gmail.com"
echo ""
echo "———————————————-"
echo "Cara penggunaan :"
echo "./mrtg-gen config   – untuk bikin config file "
echo "./mrtg-gen index    — untuk generate html fil "
echo "———————————————-"
echo ""
echo "Have a nice day …"
echo ""
exit
fi

echo "Inputkan lokasi file MRTG ( contoh : /var/www/html/mrtg ) :"
read GLB
echo "Inputkan community string snmp target ( contoh : public ) :"
read NAMA
echo "Inputkan IP address target ( contoh : 192.168.0.1 ) :"
read ALA
echo "Inputkan lokasi file configurasi MRTG ( contoh : /etc/mrtg ) :"
read KON
echo "Inputkan nama file configurasi MRTG ( contoh : test.cfg ) :"
read CFG

if [ "$1" = "config" ]
then
   cfgmaker –global "WorkDir: $GLB" –global "Options[_]: growright,bits" –global "RunAsDaemon:Yes" –global "Interval:5" –global "Refresh:300" $NAMA@$ALA > $KON/$CFG
exit
fi

if [ "$1" = "index" ]
then
   indexmaker  –columns=1 –show=day –pagetop=Traffic-Analysis-for-$ALA  –title=$ALA-Traffic –output=$GLB/index.html $KON/$CFG
    rm $KON*.pid
     mrtg $KON/$CFG
exit
fi
##########################################
# The world will never know …          #
# and i will never understand            #
# losing my grip … slepted away        #
# tryin’ to find my way back             #
# to the main purposes why GOD create me #
##########################################

Modifikasi htb wondershapper

Thursday, May 12th, 2005

#!/bin/bash
#
############################################################
# Penggunaan :
# Untuk setting awal run : /sbin/bandshape.htb config
# Untuk lihat konfigurasi run : /sbin/bandshape.htb status ,kemudian inputkan
# device yang ingin di tampilkan
# Untuk menghentikan process run : /sbin/bandshape.htb stop
############################################################

###############################
# Deklarasi input dari user : #
###############################
echo "Masukkan interface target ( contoh : eth0 ) :"
read DEV
#########################################################
### Buat perintah

if [ "$1" = "status" ]
then
tc -s qdisc ls dev $DEV
tc -s class ls dev $DEV
exit
fi

#### Flush error dulu mas
tc qdisc del dev $DEV root    2> /dev/null > /dev/null
tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null

if [ "$1" = "stop" ]
then
  tc qdisc del dev $DEV
tc class del dev $DEV
  exit
fi

#########################################################

echo "Masukkan rate downlink anda ( contoh untuk 800 Kbit : 800 ) :"
read NYEDOT
echo "Masukkan rate uplink anda ( contoh untuk 800 Kbit : 800 ) :"
read NIUP
echo "Masukkan netmask source traffic prioritas rendah ( contoh : 255.255.255.0 ) :"
read MASREN
echo "Masukkan netmask tujuan traffic prioritas rendah ( contoh : 255.255.255.0 ) :"
read MASTIN
echo "Masukkan port source traffic prioritas rendah ( contoh : 5000 ) :"
read PORTREN
echo "Masukkan port tujuan traffic prioritas rendah ( contoh : 5000 ) :"
read PORTIN
#########################################################

#################################################
## UPLINK-na di dieu mang teu keudah di ubah ! ##
#################################################

###### Pengaturan UPLINK default
tc qdisc add dev $DEV root handle 1: htb default 20
tc class add dev $DEV parent 1: classid 1:1 htb rate ${NIUP}kbit burst 6k

###### Pengaturan UPLINK prioritas tinggi
tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${NIUP}kbit \
   burst 6k prio 1
###### Pengaturan UPLINK prioritas sedang
tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[9*$NIUP/10]kbit \
   burst 6k prio 2
###### Pengaturan UPLINK prioritas biasa
tc class add dev $DEV parent 1:1 classid 1:30 htb rate $[8*$NIUP/10]kbit \
   burst 6k prio 2
###### Pengaturan UPLINK keseluruhan stochastic
tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
###### Pengaturan UPLINK prioritas untuk ssh delay minim
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
      match ip tos 0×10 0xff  flowid 1:10
###### Pengaturan UPLINK prioritas untuk icmp
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
        match ip protocol 1 0xff flowid 1:10
###### Pengaturan stabilitas download
# menggunakan interactive class:
tc filter add dev $DEV parent 1: protocol ip prio 10 u32 \
   match ip protocol 6 0xff \
   match u8 0×05 0×0f at 0 \
   match u16 0×0000 0xffc0 at 2 \
   match u8 0×10 0xff at 33 \
   flowid 1:10

###### Untuk yang lain ??? wayahna we mang ngempot heula :))

for a in $PORTIN
do
tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
    match ip dport $a 0xffff flowid 1:30
done
for a in $PORTREN
do
  tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
    match ip sport $a 0xffff flowid 1:30
done
for a in $MASREN
do
  tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
    match ip src $a flowid 1:30
done
for a in $MASTIN
do
  tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \
    match ip dst $a flowid 1:30
done
#### Non interaktif traffic
tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
   match ip dst 0.0.0.0/0 flowid 1:20

###################################################
## DOWNLINK-na di dieu mang teu keudah di ubah ! ##
###################################################

### Ingress policy ya …
tc qdisc add dev $DEV handle ffff: ingress

### Ngedownload kenceng teuing .. digencet saeutik ah … ###
tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
   0.0.0.0/0 police rate ${NYEDOT}kbit burst 10k drop flowid :1

##################################################
# Yach namanya juga shapper biasa mas …        #
# hasil modifikasi jadi ya beginilah             #
# ditambah lagi udah ngantuk gw nich ..          #
# dari 26 april 2005 pagi, belum tidur juga      #
# padahal sekarang udah 27 april 2005 jam 10     #
# he he he nasib mas mas …                     #
# grets to wshapper creator, deh@tes secteam     #
# cse@quasar.net.id, my hunny bunny meydewi      #
# most of all to ALLAH S.W.T the greatest        #
#                                                #
# rizky@quasar.net.id                            #
##################################################

Script untuk bikin simple QOS router

Thursday, May 12th, 2005

#!/bin/sh
#
if [ "$1" = "" ]
then
  echo "#############################"
  echo "# QOS ROUTER CONFIGURATOR   #"
  echo "# by spikecursed@gmail.com  #"
  echo "#############################"
  echo "You need at least 3 NIC to configure this"
  echo "Good luck …. have a nice day …!"
  echo "How to : "
  echo "./qos-sp8 create   -> to create configuration and auto start file."
  echo "./qos-sp8 start    -> to run QOS service"
  echo ""
  echo "Thanks bro."
  echo "spikecursed@gmail.com"
exit
fi

if [ "$1" = "create" ]
then
#
#############################
# QOS ROUTER CONFIGURATOR   #
# by spikecursed@gmail.com  #
#############################
#
R12=/sbin/tc
KY=/sbin/iptables
#
#############################
# So what … ?
#############################
##–1–##

echo "### Proses Konfigurasi Koneksi Primer ###"
echo " "
echo "Masukkan IP untuk service primer ( contoh : 192.168.100.1 ) : "
read PRIMS
echo "Masukkan interface untuk koneksi primer ke client ( contoh : eth1 ) :"
read INETSC
echo "Masukkan network IP client service primer ( contoh : 10.1.1.0/24 ) : "
read PRICS
##–2–##
echo "### Proses Konfigurasi Koneksi Sekunder ###"
echo " "
echo "Masukkan IP untuk service sekunder ( contoh : 192.168.200.1 ) : "
read SECS
echo "Masukkan interface untuk koneksi sekunder ke client ( contoh : eth2 ) :"
read INETSCA
echo "Masukkan network IP client service sekunder ( contoh : 10.1.2.0/24 ) : "
read SECCS
##–3–##
echo "
#!/bin/sh
#
#
#############################
# QOS ROUTER CONFIGURATOR   #
# by spikecursed@gmail.com  #
#############################
#############################
# Flush it all …
#############################
$KY -F -t nat
$KY -F -t mangle
$KY -F
$R12 qdisc del dev eth0 parent root handle 1: prio
$R12 qdisc del dev eth1 parent root handle 1: prio
#############################
# Route it …
#############################
$KY -A POSTROUTING -t nat -s $PRICS -o $INETS -j SNAT –to-source $PRIMS
$KY -A POSTROUTING -t nat -s $SECCS -o $INETSA -j SNAT –to-source $SECS
#############################
# Map the band …
#############################
$KY -A PREROUTING -t mangle -i $INETSC -j TOS –set-tos 0×10
$KY -A PREROUTING -t mangle -i $INETSC -j TOS –set-tos 0×09
$KY -A PREROUTING -t mangle -i $INETSCA -j TOS –set-tos 0×08
$R12 qdisc add dev eth0 parent root handle 1: prio
" > /etc/init.d/r12ky.qos
##–4–#
#############################
# Prep ….
#############################
chmod 755 /etc/init.d/r12ky.qos
ln -s /etc/init.d/r12ky.qos /etc/rc3.d/K99r12ky.qos
ln -s /etc/init.d/r12ky.qos /etc/rc3.d/S99r12ky.qos
exit
fi
if [ "$1" = "start" ]
then
/etc/init.d/r12ky.qos
exit
fi