Install Squid

Posted on 30 August 2010. Filed under: Linux | Tags: , |

proxy server yg sy buat ini jg berfungsi sebagai internet gateway

topologinya ky gini

Modem————–eth0-[Gateway/Proxy]-eth1———–Client

ip modem : 192.168.1.1
eth0 : 192.168.1.2
eth1 : 192.168.10.1

 $ sudo vim /etc/network/interfaces

auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

auto eth1
iface eth1 inet static
address 192.168.10.1
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

kemudian pastikan ip_forward sudah di aktifkan
edit file sysctl.conf

$ sudo vim /etc/sysctl.conf

tambahkan perintah

net.ipv4.ip_forward=1

kemudian edit /etc/rc.local (tujuannya agar perintah lagsung di load ketika server dinyalakan)

$ sudo vim /etc/rc.local

tambahkan perintah

iptables -t nat -A POSTROUTING -o eth0 -j SNAT –to 192.168.1.2

iptables -t nat -A PREROUTING -i eth1 -p tcp –dport 80 -j REDIRECT –to-port 3128

perintah diatas untuk NAT dan memaksa semua akses web(port80) yang masuk ke eth1 agar dilewatkan malaui port squid (3128) atau sering disebut transparent proxy

selanjutnya install squid

$ sudo apt-get install squid

setelah squid terinstall kita tinggal edit file di /etc/squid/squid.conf
ada baiknya kita membuat backupnya terlebih dahulu

$ sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.bak

edit konfigurasi squid

$ sudo vim /etc/squid/squid.conf

#kofigurasi minimalnya
acl our_network src 192.168.0.0/24
http_access allow our_network

untuk membuat direktori swap

$ squid -z

2007/12/25 14:10:22| Creating Swap Directories

untuk melihat akses client

$ tail -f /varl/log/squid/access.log

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Siapa sih ini ?

  • Kategori

  • Masa Lalu

  • Follow me…

  • Apaan nih ?

  • Yang tersesat

    • 99,128 orang
  • Paling menyesatkan

    • Almanak

      August 2010
      M T W T F S S
      « Apr   Nov »
       1
      2345678
      9101112131415
      16171819202122
      23242526272829
      3031  

    Liked it here?
    Why not try sites on the blogroll...

    %d bloggers like this: