Minggu, 03 Agustus 2014

Transparent Proxy OpenWrt polipo/tinyproxy

Untuk membuat proxy biar transparent untuk semua user(tidak perlu mengubah setingan browser) kita harus menginstall polipo juga tiniproxy ;

Install Polipo

Install proxy polipo

# opkg install polipo
Buat Directory di dalam usb sebagai cache :
# cd /mnt/sda3/
# mkdir cache
# cd cache
# mkdir polipo
Konfigurasi Proxy Polipo
# vim /etc/config/polipo

Berikut konfigurasi yang saya buat :
# polipo daemon configuration
config 'polipo' 'daemon'
# daemonise polipo (fork in background)
option 'daemonise' '1'
# where polipo will store its process pid
option 'pidFile' '/var/run/polipo.pid'
config 'polipo' 'general'
option 'enabled' '1'
# adress on which polipo will listen, 0.0.0.0 means all addresses
option 'proxyAddress' '192.168.1.1'
# port on which polipo will listen, default is 8123
option 'proxyPort' '8123'
# list of allowed clients to connect
list 'allowedClients' '192.168.1.0/24'
#list 'allowedClients' '127.0.0.1'
#list 'allowedClients' '192.168.2.1'
# how much RAM memory should Polipo use (in bytes).
option 'chunkHighMark' '1048576'
# enable disk cache index and serverlist of integrated polipo web interface
#option 'disableIndexing' '0'
#option 'disableServersList' '0'
# disable loging to syslog
option 'logSyslog' '0'
# set log file location (disabled when not set)
option 'logFile' '/mnt/sda3/cache/log'
config 'polipo' 'cache'
# disk cache location, you should always use external storage device
# (disabled when not set)
option 'diskCacheRoot' '/mnt/sda3/cache/polipo'
# disk cache cleanup settings
#option 'diskCacheUnlinkTime' '20d'
#option 'diskCacheTruncateTime' '5d'
#option 'diskCacheTruncateSize' '3145728'
# set to 1 if proxy is used by multiple users
#option 'cacheIsShared' '1'
config 'polipo' 'pmm'
# poor man's multiplexing semgnet size to fetch
option 'pmmSize' '8192'
 
 
Install TinyProxy
 
install software packages
opkg update
opkg install tinyproxy luci-app-tinyproxy
 
Edit vi /etc/config/tinyproxy ;
  
config tinyproxy
 option User 'nobody'
 option Group 'nogroup'
 option Port '8888'
 option Timeout '600'
 option DefaultErrorFile '/usr/share/tinyproxy/default.html'
 option StatFile '/usr/share/tinyproxy/stats.html'
 option LogFile '/var/log/tinyproxy.log'
 option LogLevel 'Info'
 option MaxClients '100'
 option MinSpareServers '5'
 option MaxSpareServers '20'
 option StartServers '10'
 option MaxRequestsPerChild '0'
 option ViaProxyName 'tinyproxy'
 option enabled '1'
 list Allow '127.0.0.1'
 list Allow '192.168.1.0/24'
        list ConnectPort '443'
 list ConnectPort '563'

config upstream
 option type 'proxy'
 option target '192.168.1.0/24'
 option via '192.168.1.1:8123'
 
 
 Edit vi /etc/firewall.user 
 
iptables -A PREROUTING -t nat -p tcp --destination-port 80 -j REDIRECT --to-ports 8888

 
 
 
  

2 komentar:

  1. Looks to me like it should be redirecting to port 8888 not 3128.

    BalasHapus
  2. I also like to park outside all the time. The sun burned my car. Every time I get into the car, it's very hot. It's a good thing I have an umbrella now.

    BalasHapus