Simple Load Balancer using IPTables

Konfigurasi Linux agar berfungsi sebagai router.

sysctl -w net.ipv4.ip_foraward = 1

Mengkonfigurasi IPTables

iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -m state --state NEW -m statistic --mode nth --every 2 --packet 0 -j DNAT --to-destination 192.168.2.2:80

iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -m state --state NEW -m statistic --mode nth --every 2 --packet 1 -j DNAT --to-destination 192.168.2.3:80

Jangan lupa konfigurasi di chain FORWARD jika default chain FORWARD nya drop.

Referensi:
https://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.html 

Komentar

Postingan populer dari blog ini

Pembahasan IT Network Systems Administration Module A DNS (Forward Zone, Reverse Zone, CNAME, MX, Split View)

Cara restart / stop windows service (services.msc) dengan bat / cmd

How to convert VMDK to OVA