You are on page 1of 1

Auto Static Proxy Mode DHCP Server Mikrotik

Mode Transparent Proxy utk squid3.2 s/d squid4 banyak masalah utk ssl tertentu, juga memakan banyak load
CPU utk client dengan PPS > 200 PPS , berikut tips Solusi auto static proxy mode DHCP Server Mikrotik :)
stepnya : buat script file dengan nama proxy.pac lalu taruh di webserver local, isi script :
########## start script ##########
function FindProxyForURL(url, host) {
// If the hostname matches, send direct.
if (dnsDomainIs(host, ".intranet.example.com") ||
shExpMatch(host, "(ib.bankmandiri.co.id|ibank.bni.co.id|ib.bri.com|ib.bca.com)"))
return "DIRECT";
// If the requested website is hosted within the internal network, send direct.
if (isPlainHostName(host) ||
shExpMatch(host, "*.local") ||
isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
isInNet(dnsResolve(host), "172.16.0.0", "255.240.0.0") ||
isInNet(dnsResolve(host), "192.168.0.0", "255.255.0.0") ||
isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0"))
return "DIRECT";
// If the IP address of the local machine is within a defined
// subnet, send to a specific proxy.
if (isInNet(myIpAddress(), "192.168.1.0", "255.255.255.0") ||
(isInNet(myIpAddress(), "192.168.2.0", "255.255.255.0") ||
(isInNet(myIpAddress(), "192.168.3.0", "255.255.255.0") ||
(isInNet(myIpAddress(), "192.168.4.0", "255.255.255.0") )
return "PROXY 192.168.100.2:8080";
// DEFAULT RULE: All other traffic, use below proxies, in fail-over order (Proxy Backup if any).
// return "PROXY 192.168.100.3:8080; PROXY 192.168.100.4:8080";
}
########## end script ##########
Di mikrotik seting DHCP Servernya dengan menambahkan option code 252 :
/ip dhcp-server option
add code=252 name=auto-proxy-config value="'http://you.web.server.com/proxy.pac'"
atau jika tanpa domain langsung pakai IP
/ip dhcp-server option
add code=252 name=auto-proxy-config value="'http://192.168.100.2/proxy.pac'"
Di Linux/BSD DHCP Server tambahkan ini :
option wpad-config code 252 = text;
...
subnet 192.168.1.0 netmask 255.255.255.0 {
...
option wpad-config "http://you.web.server.com/proxy.pac";
}
Sumber :
http://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server#DHCP_Options
http://tejaslinuxworld.blogspot.com/2013/06/proxypacwpaddat-with-dhcp.html
https://www.lrz.de/services/netzdienste/proxy/browser-config_en/
www.hikmah-teknologi.com

You might also like