Akhirnya setelah seharian ngoprek dan compile kernel beberapa x dan reboot dari jauh :D (syukurlah tidak ada masalah saat booting), berhasil juga patching kernel vanilla slackware 10.2 dengan patch-o-matic-ng-20050918 (release ini sudah tidak ada lagi di situs resmi netfilter.org). Setelah googling sana sini ketemu di http://source.ipfire.org/en/index. iptables menggunakan versi 1.3.5, juga turut dipatch dengan patch-o-matic.
Untuk kernel 2.4.x seperti slack 10.2 perlu dipatch dengan extension nth dan connmark, sedangkan kalau pakai kernel 2.6.x extension connmark sudah ada, tinggal tambahkan extension nth. Bisa dicari di ftp://ftp.netfilter.org/pub/patch-o-matic-ng/ Topologi network ---------------- LAN : 192.168.0.0/24 WAN 1 : 110.138.1.101 (spidi 1 bridge mode) WAN 2 : 192.168.1.5 (spidi 2 router mode) IP Test : 192.168.0.253 Selanjutnya membuat load balancing mengikuti petunjuk lartc.org ("Routing for multiple uplinks/providers": http://lartc.org/lartc.html#LARTC.RPDB.MULTIPLE-LINKS) # ip ro ls 110.138.1.1 dev ppp0 proto kernel scope link src 110.138.1.101 192.168.1.0/30 dev eth1 proto kernel scope link src 192.168.1.2 192.168.1.4/30 dev eth3 proto kernel scope link src 192.168.1.6 110.138.1.0/24 dev ppp0 scope link src 110.138.1.101 192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.254 127.0.0.0/8 dev lo scope link default nexthop via 110.138.1.1 dev ppp0 weight 1 nexthop via 192.168.1.5 dev eth3 weight 1 # ip ru ls 0: from all lookup local 32764: from 110.138.1.101 lookup T2 32765: from 192.168.1.6 lookup T1 32766: from all lookup main 32767: from all lookup default # iptables -t nat -L POSTROUTING -n Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.0.0/24 0.0.0.0/0 to:192.168.1.2 SNAT all -- 192.168.0.0/24 0.0.0.0/0 to:192.168.1.6 SNAT all -- 192.168.0.0/24 0.0.0.0/0 to:110.138.1.101 SNAT yang pertama agar bisa masuk ke web administration modem adsl yg diset sbg bridge. Untuk tes ini saya lakukan di satu client dengan ip 192.168.0.253. Rule loadbalancing nth+connmark sebagian mengikuti petunjuk di http://tetro.net/misc/multilink.html dan sebagian nambah sendiri setelah beberapa kali menemui kegagalan. 1. pertama buat chain iptables -t mangle -N LB-1 iptables -t mangle -A LB-1 -j CONNMARK --set-mark 100 iptables -t mangle -A LB-1 -m nth --counter 1 --every 2 --packet 0 -j RETURN iptables -t mangle -A LB-1 -j CONNMARK --set-mark 101 iptables -t mangle -A LB-1 -m nth --counter 1 --every 2 --packet 1 -j RETURN 2. kemudian masukkan rule prerouting untuk client ip 192.168.0.253 iptables -t mangle -I PREROUTING 1 -i eth0 -s 192.168.0.253 ! -d 192.168.0.0/16 -m state --state NEW -j LB-1 iptables -t mangle -I PREROUTING 2 -m connmark --mark 100 -j MARK --set-mark 10 iptables -t mangle -I PREROUTING 3 -m connmark --mark 101 -j MARK --set-mark 11 3. tambahkan rule di ip rule untuk packet dengan mark 10 & 11 ip rule add fwmark 10 table T1 ip rule add fwmark 11 table T2 Kalau mengikuti situs tersebut perlu nambah extension ROUTE, ini sudah ikut keinstall di kernel ini tapi LB gagal saat dicoba. Tes dari client 192.168.0.253, buka dua koneksi ssh ke server remote. Cek di server remote, terdapat 2 koneksi dari ip spidi: $ w 07:00:14 up 23 days, 6:49, 5 users, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT yudi pts/0 1.2.3.4 02:06 0.00s 0.04s 0.00s w yudi pts/3 125.164.1.100 06:54 4:19 0.00s 0.00s -bash yudi pts/4 110.138.1.101 06:55 4:11 0.00s 0.00s -bash Dari kedua account tes ping selama 55 menit tidak putus. Tes idle (diam2an) yg pakai modem router baru 8 menit sudah timeout sedangkan yg lewat bridge aman2 saja. Tulisan lengkap akan saya upload ke blog. Rencana mau patch lagi kernel dengan IMQ, tapi gagal patch, padahal jika dipatch pertama kali dengan IMQ berhasil. -- Arief Yudhawarman http://awarmanf.wordpress.com -- FAQ milis di http://wiki.linux.or.id/FAQ_milis_tanya-jawab Unsubscribe: kirim email ke tanya-jawab-unsubscr...@linux.or.id Arsip dan info milis selengkapnya di http://linux.or.id/milis