Transparent Proxy  
  
 
 
Transparent Proxy digunakan apabila kita ingin memaksa clients dalam network untuk menggunakan proxy tanpa sepengetahuan mereka. Maksudnya semua http request dari client secara otomatis akan diarahkan ke proxy terlebih dahulu (forwarded). Keuntungan lainnya, kita tidak perlu repot untuk melakukan setting/konfigurasi browser pada masing-masing client yang mungkin berjumlah banyak.

Dalam FreeBSD kita dapat menggunakan IPFW dan SQUID untuk membuat Transparent Proxy. Contoh disini adalah transparent proxy yang berjalan pada Dial up gateway dengan menggunakan NATD dan SQUID sebagai HTTP proxy nya. 

1. Menambahkan rule IPFW untuk forwarding.

Untuk mengaktifkan fungsi IPFW forward, pastikan bahwa sudah terdapat options IPFIREWALL_FORWARD pada file konfigurasi kernel. Seandainya belum ada, maka kita harus menambahkan options tersebut dan kemudian melakukan compile dan install kernel. 

       add 350 fwd 192.168.0.1,8080 tcp from 192.168.0.0/24 to any www

Rule diatas maksudnya, semua request http (port www) dari clients di forward/diarahkan ke port 8080 (port SQUID di 192.168.0.1). Berikut contoh IPFW rules sederhana untuk menjalankan NATD dan Transparent Proxy :

       ## ipfw rules
       add 350 fwd 192.168.0.1,8080 tcp from 192.168.0.0/24 to any www
       add 400 divert natd all from any to any via tun0
       add 450 pass all from any to any via rl0
       add 500 pass all from any to any via tun0


2. Edit squid.conf pada bagian HTTPD-ACCELERATOR

       ## HTTPD-ACCELERATOR OPTIONS
        httpd_accel_host virtual
        httpd_accel_port 80
        httpd_accel_with_proxy on
        httpd_accel_uses_host_header on


3. Restart Squid dan coba matikan konfigurasi browser di client. 

reference:
http://www.tldp.org/HOWTO/mini/TransparentProxy-2.html
http://infofreebsd.org/article.php?sid=234&mode=thread&order=0 

Pessoal,

Estou no trabalho tentando colocar o proxy transparente mas ao rodar o comando :

# /sbin/ipfw add 00400 fwd 127.0.0.1,3128 tcp from 192.161.0.0/24 to any 80 via xl0

Da a seguinte mensagem:

ipfw: getsockopt(IP_FW_ADD): Invalid argument

Alguem poderia me ajudar?

[]'s 

respondido por shiray em 14/11/2002 18:04


Oie Carla,

Essa msg e' de que vc nao compilou o kernel com as opcoes de firewall

inclua no seu kernel e compile, deve funcionar dai

options IPFIREWALL #firewall
options IPFIREWALL_VERBOSE #print information about
# dropped packets
options IPFIREWALL_FORWARD #enable transparent proxy support
options IPFIREWALL_VERBOSE_LIMIT=100 #limit verbosity
options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default
options IPDIVERT #divert sockets

[]'os
Fabio 


  
 

    Source: geocities.com/w1d1anto/Document

               ( geocities.com/w1d1anto)