Advertisement
sukriborneo

auto-install-squid

Nov 5th, 2017
966
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. wget -O /etc/apt/sources.list http://pastebin.com/raw/B9atBpyw
  3. apt-get update
  4. apt-get install build-essential devscripts libcppunit-dev openssl libssl-dev libcap-dev libsasl2-dev ccze pkg-config libkrb5-dev php5 apache2 -y
  5. wget -O /etc/apache2/ports.conf http://pastebin.com/raw/4pvrFczN
  6. # apabila belum memiliki folder cache, lalukan mkdir -p /cache , bila sudah memiliki folder cache, abaikan saja
  7. mkdir -p /cache
  8. chmod -R 777 /cache
  9. cd /var/www
  10. mkdir id
  11. mkdir flash
  12. wget http://c.speedtest.net/mini/mini.zip
  13. unzip mini.zip
  14. cp -arv mini/speedtest /var/www
  15. wget -O /var/www/flash/speedtest.swf http://c.speedtest.net/flash/speedtest.swf
  16. wget -O /var/www/flash/speedtest-long.swf http://c.speedtest.net/flash/speedtest-long.swf
  17. wget -O /var/www/speedtest-config.php http://www.speedtest.net/speedtest-config.php
  18. wget -O /var/www/ipaddress.php http://api.ookla.com/ipaddress.php
  19. wget -O /var/www/id/speedtest-config.php http://www.speedtest.net/id/speedtest-config.php
  20. cd
  21. wget http://www.measurement-factory.com/tmp/ecap/libecap-1.0.0.tar.gz
  22. tar xvf libecap-1.0.0.tar.gz
  23. cd libecap-1.0.0
  24. ./configure && make && make install
  25. echo '/usr/local/lib' >> /etc/ld.so.conf
  26. ldconfig
  27. cd
  28. wget http://www.measurement-factory.com/tmp/ecap/ecap_adapter_sample-1.0.0.tar.gz
  29. tar xzvf ecap_adapter_sample-1.0.0.tar.gz
  30. wget -O /root/ecap_adapter_sample-1.0.0/src/adapter_async.cc http://pastebin.com/raw/2iaykJAw
  31. cd ecap_adapter_sample-1.0.0
  32. ./configure && make && make install
  33. cd
  34. wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.20.tar.gz
  35. tar xzvf squid-3.5.20.tar.gz
  36. wget -O squid_forgery.patch http://pastebin.com/raw/cs6fKaAh
  37. cd squid-3.5.20
  38. patch -p0 <../squid_forgery.patch
  39. ./configure --prefix=/usr \
  40. --bindir=/usr/bin \
  41. --sbindir=/usr/sbin \
  42. --libexecdir=/usr/lib/squid \
  43. --sysconfdir=/etc/squid \
  44. --localstatedir=/var \
  45. --libdir=/usr/lib \
  46. --includedir=/usr/include \
  47. --datadir=/usr/share/squid \
  48. --mandir=/usr/share/man \
  49. --enable-storeio=ufs,aufs,diskd,rock \
  50. --enable-removal-policies=lru,heap \
  51. --enable-stacktrace \
  52. --enable-zph=qos \
  53. --enable-ecap \
  54. --enable-icap-client \
  55. --enable-wccp \
  56. --enable-wccpv2 \
  57. --enable-linux-netfilter \
  58. --disable-ident-lookup \
  59. --disable-auth \
  60. --disable-auth-basic \
  61. --disable-auth-digest \
  62. --disable-auth-negotiate \
  63. --disable-auth-ntlm \
  64. --disable-url-rewriter-helpers \
  65. --disable-storeid-rewrite-helpers \
  66. --with-logdir=/var/log/squid \
  67. --with-pid-file=/var/run/squid.pid \
  68. --with-swap-dir=/cache \
  69. --enable-large-cache-files \
  70. --with-large-files \
  71. --with-openssl
  72. make
  73. make install
  74. cd
  75. chown -R nobody /var/log/squid
  76. chown -R nobody /cache
  77. mkdir -p /etc/squid/ssl_cert
  78. openssl req -new -newkey rsa:2048 -sha256 -days 3652 -nodes -x509 -keyout /etc/squid/ssl_cert/proxy.pem -out /etc/squid/ssl_cert/proxy.pem -subj "/C=ID/ST=Jawa Tengah/L=Semarang/O=TSI/CN=Terapi Squid Indonesia"
  79. openssl x509 -in /etc/squid/ssl_cert/proxy.pem -outform DER -out /etc/squid/ssl_cert/proxy.der
  80. openssl x509 -in /etc/squid/ssl_cert/proxy.pem -outform DER -out /etc/squid/ssl_cert/proxy.crt
  81. cp -arv /etc/squid/ssl_cert /var/www
  82. echo '#
  83. dns_v4_first on
  84. reply_header_access Alternate-Protocol deny all
  85. reply_header_access Alt-Svc deny all
  86. refresh_all_ims on
  87. reload_into_ims on
  88.  
  89. #asumsi sisa hardisk 900Gban
  90. #(720000000/256/256)*2
  91. cache_dir aufs /cache 720000 21980 256
  92. cache_mem 2 MB
  93. cache_swap_high 95
  94. cache_swap_low 90
  95.  
  96. cache_replacement_policy heap LFUDA
  97. memory_replacement_policy heap GDSF
  98.  
  99. maximum_object_size 4096000 KB
  100. maximum_object_size_in_memory 0 KB
  101.  
  102. visible_hostname cespun-proxy
  103. strip_query_terms off
  104. httpd_suppress_version_string on
  105. log_mime_hdrs off
  106. forwarded_for off
  107. via off
  108.  
  109. coredump_dir /var/log/squid
  110. logfile_rotate 1
  111.  
  112. max_filedescriptors 65536
  113.  
  114. fqdncache_size 4096
  115. ipcache_size 4096
  116. ipcache_high 95
  117. ipcache_low 90
  118.  
  119. http_port 3128
  120. http_port 3129 tproxy
  121. #https_port 3127 tproxy ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/ssl_cert/warnet.pem
  122. https_port 3127 tproxy ssl-bump generate-host-certificates=on cert=/etc/squid/ssl_cert/warnet.pem
  123.  
  124. qos_flows local-hit=0x30
  125.  
  126. acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
  127. acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
  128. acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
  129. acl localnet src fc00::/7 # RFC 4193 local private network range
  130. acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
  131. acl SSL_ports port 443
  132. acl Safe_ports port 80 # http
  133. acl Safe_ports port 182 # http
  134. acl Safe_ports port 21 # ftp
  135. acl Safe_ports port 443 # https
  136. acl Safe_ports port 70 # gopher
  137. acl Safe_ports port 210 # wais
  138. acl Safe_ports port 1025-65535 # unregistered ports
  139. acl Safe_ports port 280 # http-mgmt
  140. acl Safe_ports port 488 # gss-http
  141. acl Safe_ports port 591 # filemaker
  142. acl Safe_ports port 777 # multiling http
  143. acl PURGE method PURGE
  144. acl step1 at_step SslBump1
  145. acl step2 at_step SslBump2
  146. acl step3 at_step SslBump3
  147. acl range206 req_header Range -i byte
  148. acl iphone browser -i regexp (iPhone|iPad)
  149. acl BB browser -i regexp (BlackBerry|PlayBook)
  150. acl Winphone browser -i regexp (Windows.*Phone|Trident|IEMobile)
  151. acl Android browser -i regexp Android
  152. acl yt-rewrite url_regex -i ^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[=%&?\/]
  153. acl youtube url_regex -i ^http.*(youtube|googlevideo|videoplayback|videogoodput)
  154. acl urltomiss url_regex -i ^http.*(update|patch).*versi
  155. acl urltomiss url_regex -i ^http.*versi.*(update|patch)
  156. acl urltomiss url_regex -i ^http.*(update|patch|versi|version)\.ini
  157. acl urltomiss url_regex -i ^http.*(hsupdate|antihack|xigncode|gameguard|captcha|gameid|game_id|idgame|id_game|launcher|\.aspx|\.html|\.shtml|\.xhtml|\.ini)
  158. acl urltomiss url_regex -i ^http.*googlevideo\.com\/video(playback|goodput).*source[\&\=\?\/]yt_live
  159. acl urltomiss url_regex -i ^http.*googleapis\.com\/game
  160. acl patchpartial url_regex -i ^http.*patch.*garena
  161. acl patchpartial url_regex -i ^http.*garena.*patch
  162. acl httptomiss http_status 302
  163. acl mimehtml rep_mime_type -i mime-type ^text/html
  164. acl mimeplain rep_mime_type -i mime-type ^text/plain
  165. acl tostoreid url_regex -i ^http.*(youtube|googlevideo|videoplayback|videogoodput)
  166. acl tostoreid url_regex -i ^http.*(fbcdn|akamaihd)
  167. acl tostoreid url_regex -i ^http.*c2lo\.reverbnation\.com\/audio_player\/ec_stream_song\/.*\?
  168. acl tostoreid url_regex -i ^http.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/GetBinary\/.*\/.*\?
  169. acl tostoreid url_regex -i ^http.*datafilehost.*\/get\.php.*file\=.*
  170. acl tostoreid url_regex -i ^http.*\.filehippo\.com\/.*\?
  171. acl tostoreid url_regex -i ^http.*\.4shared\.com\/.*\/.*\/.*\/dlink.*preview.mp3
  172. acl tostoreid url_regex -i ^http.*\.4shared\.com\/download\/.*\/.*\?tsid
  173. acl tostoreid url_regex -i ^http.*steam(powered|content)
  174. acl tostoreid url_regex -i ^http.*savefile\.co\:182\/.*\/.*\.(mp4|flv|3gp)
  175. acl tostoreid url_regex -i ^http.*video\-http\.media\-imdb\.com\/.*\.mp4\?
  176. acl tostoreid url_regex -i ^http.*\.dl\.sourceforge\.net
  177. acl speedtest url_regex -i ^http.*([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|speedtest|espeed|api\.ookla).*\/(speedtest\.swf|speedtest-long\.swf|latency\.txt|upload\.php|speedtest-config\.php|ipaddress\.php|random.*\.jpg)
  178. acl blokir url_regex -i ^http.*kendedes\.uzone\.id
  179. acl blokir url_regex -i ^http.*internetpositif\.uzone\.id
  180.  
  181. acl CONNECT method CONNECT
  182. acl getmethod method GET
  183.  
  184. deny_info http://103.80.80.246 blokir
  185. http_access deny blokir
  186.  
  187. http_access deny !Safe_ports
  188. http_access deny CONNECT !SSL_ports
  189. http_access allow localhost manager
  190. http_access deny manager
  191. http_access allow localhost purge
  192. http_access deny purge
  193. http_access allow localnet
  194. http_access allow localhost
  195. http_access deny all
  196.  
  197. access_log /var/log/squid/access.log !CONNECT
  198. #access_log none
  199.  
  200. range_offset_limit none range206 patchpartial
  201. range_offset_limit 128 KB range206 !patchpartial
  202. quick_abort_min 1 KB
  203. quick_abort_max 1 KB
  204. quick_abort_pct 95
  205.  
  206. cache deny speedtest
  207. cache deny urltomiss
  208. cache deny localhost
  209. ssl_bump splice localhost
  210. ssl_bump peek step1 all
  211. ssl_bump bump all
  212.  
  213. cache_peer 10.212.212.212 parent 8033 0 no-digest no-tproxy
  214. dead_peer_timeout 5 seconds
  215. cache_peer_access 10.212.212.212 allow speedtest
  216. cache_peer_access 10.212.212.212 deny all
  217. always_direct deny speedtest
  218. never_direct allow speedtest
  219.  
  220. url_rewrite_access allow yt-rewrite !iphone !BB !Winphone !Android
  221. url_rewrite_access deny all
  222. url_rewrite_program /etc/squid/storerewrite.pl
  223. url_rewrite_children 2000 startup=30 idle=1
  224.  
  225. request_header_access Accept-Encoding deny yt-rewrite !iphone !BB !Winphone !Android
  226. #yt_quality: tiny = 144px small = 240px medium = 360px large = 480px HD720 = Hd720px
  227. ecap_enable on
  228. loadable_modules /usr/local/lib/ecap_adapter_modifying.so
  229. ecap_service modif respmod_precache uri=ecap://e-cap.org/ecap/services/sample/modifying victim="enablejsapi" replacement="dash":"1","vq":"tiny","enablejsapi"
  230. adaptation_access modif allow yt-rewrite !iphone !BB !Winphone !Android
  231. adaptation_access modif deny all
  232.  
  233. store_id_bypass off
  234. store_id_extras "%{Referer}>h"
  235. store_id_program /etc/squid/storeid.pl
  236. store_id_children 2000 startup=30 idle=1
  237. store_id_access allow tostoreid
  238. store_id_access deny all
  239.  
  240. store_miss deny youtube httptomiss
  241. send_hit deny youtube httptomiss
  242. store_miss deny youtube mimeplain
  243. send_hit deny youtube mimeplain
  244. store_miss deny mimehtml
  245. send_hit deny mimehtml
  246. store_miss deny urltomiss
  247. send_hit deny urltomiss
  248. store_miss deny speedtest
  249. send_hit deny speedtest
  250.  
  251. refresh_pattern -i .* 0 90% 432000 override-expire override-lastmod reload-into-ims refresh-ims ignore-no-store ignore-must-revalidate ignore-private ignore-auth
  252.  
  253. max_stale 100 years ' > /etc/squid/squid.conf
  254.  
  255. echo '#!/usr/bin/perl
  256. #!/usr/bin/perl
  257. $|=1;
  258. while (<>) {
  259. @X = split;
  260. if ($X[0] =~ m/^http.*/) {
  261. $url = $X[0];
  262. $referer = $X[1];
  263. $urlreferer = $X[0] ." ". $X[1];
  264. } else {
  265. $chanel = $X[0];
  266. $url = $X[1];
  267. $referer = $X[2];
  268. $urlreferer = $X[1] ." ". $X[2];
  269. }
  270.  
  271. #youtube googlevideo
  272. if ($url =~ m/^https?\:\/\/.*google.*video(playback|goodput).*/){
  273. @cpn = m/[=%&?\/]cpn[=%&?\/]([^\&\s]*)/;
  274. @id = m/[=%&?\/]id[=%&?\/]([^\&\s]*)/;
  275. @itag = m/[=%&?\/]itag[=%&?\/]([\d]*)/;
  276. @range = m/[=%&?\/]range[=%&?\/]([\d]*-[\d]*)/;
  277. @mime = m/[=%&?\/]mime[=%&?\/]([^\&\s]*)/;
  278. if ($referer =~ m/^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[=%&?\/]([^\&\s\?]*)/){
  279. @id = $3;
  280. } else {
  281. if (defined(@cpn[0])){
  282. if (-e "/var/log/squid/@cpn"){
  283. open FILE, "/var/log/squid/@cpn";
  284. @id = <FILE>;
  285. close FILE;
  286. }
  287. }
  288. }
  289. $out="OK store-id=http://squid/google/video/id=@id/itag=@itag/mime=@mime/range=@range";
  290.  
  291. #youtube parameter
  292. } elsif (
  293. ($url =~ m/^https?\:\/\/.*youtube.*(stream_204|watchtime|qoe|atr|csi_204|playback).*[=%&?\/]docid[=%&?\/]([^\&\s]*)/) ||
  294. ($url =~ m/^https?\:\/\/.*youtube.*(ptracking|set_awesome).*[=%&?\/]video_id[=%&?\/]([^\&\s]*)/) ||
  295. ($url =~ m/^https?\:\/\/.*youtube.*(player_204).*[=%&?\/]v[=%&?\/]([^\&\s]*)/)
  296. ){
  297. @id = $2;
  298. @cpn = m/[=%&?\/]cpn[=%&?\/]([^\&\s]*)/;
  299. if ($referer !~ m/^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[=%&?\/]([^\&\s\?]*)/){
  300. unless (-e "/var/log/squid/@cpn"){
  301. open FILE, ">/var/log/squid/@cpn";
  302. print FILE @id;
  303. close FILE;
  304. }
  305. }
  306. $out = "ERR";
  307.  
  308. #utmgif
  309. } elsif ($url =~ m/^https?\:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
  310. $out="OK store-id=http://squid/google-analytics/__utm.gif";
  311.  
  312. #fbcdn.net or akamaihd.net video range
  313. } elsif ($url =~ m/^https?\:\/\/.*(fbcdn\.net|akamaihd\.net).*\/([\w-]+\.[\w]{2,4}).*(bytestart[=%&?\/][\d]+[&\/]byteend[=%&?\/][\d]+)/) {
  314. $out="OK store-id=http://squid/$1/$2/$3";
  315.  
  316. #fbcdn.net or akamaihd.net with size
  317. } elsif ($url =~ m/^https?\:\/\/.*(fbcdn\.net|akamaihd\.net).*\/([a-zA-Z][\d]+[x][\d]+\/[\w-]+\.[\w]{2,4})($|\?)/) {
  318. $out="OK store-id=http://squid/$1/$2";
  319.  
  320. #fbcdn.net or akamaihd.net safe_image.php
  321. } elsif ($url =~ m/^https?\:\/\/.*(fbcdn\.net|akamaihd\.net).*\/safe_image\.php\?(.*)/) {
  322. $out="OK store-id=http://squid/$1/$2";
  323.  
  324. #reverbnation
  325. } elsif ($url =~ m/^https?\:\/\/c2lo\.reverbnation\.com\/audio_player\/ec_stream_song\/(.*)\?.*/) {
  326. $out="OK store-id=http://squid/reverbnation/$1";
  327.  
  328. #playstore
  329. } elsif ($url =~ m/^https?\:\/\/.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/GetBinary\/(.*\/.*)\?.*/) {
  330. $out="OK store-id=http://squid/android/market/$1";
  331.  
  332.  
  333. #filehost
  334. } elsif ($url =~ m/^https?\:\/\/.*datafilehost.*\/get\.php.*file\=(.*)/) {
  335. $out="OK store-id=http://squid/datafilehost/$1";
  336.  
  337.  
  338. #speedtest
  339. } elsif ($url =~ m/^https?\:\/\/.*(speedtest|espeed).*\/(.*\.(txt|jpg)).*/) {
  340. $out="OK store-id=http://squid/speedtest/$2";
  341.  
  342.  
  343. #filehippo
  344. } elsif ($url =~ m/^https?\:\/\/.*\.filehippo\.com\/.*\/([\w-]+\.[\w]{2,4})\?.*/) {
  345. $out="OK store-id=http://squid/filehippo/$1";
  346.  
  347.  
  348. #4shared preview.mp3
  349. } elsif ($url =~ m/^https?\:\/\/.*\.4shared\.com\/.*\/(.*\/.*)\/dlink.*preview.mp3/) {
  350. $out="OK store-id=http://squid/4shared/preview/$1";
  351.  
  352. #4shared
  353. } elsif ($url =~ m/^https?\:\/\/.*\.4shared\.com\/download\/(.*\/.*)\?tsid.*/) {
  354. $out="OK store-id=http://squid/4shared/download/$1";
  355.  
  356. #savefile-animeindo.tv
  357. } elsif ($url =~ m/^https?:\/\/www\.savefile\.co\:182\/.*\/(.*\.(mp4|flv|3gp)).*/) {
  358. $out="OK store-id=http://squid/savefile:182/$1";
  359.  
  360. #imdb
  361. } elsif ($url =~ m/^https?\:\/\/video\-http\.media\-imdb\.com\/(.*\.mp4)\?.*/) {
  362. $out="OK store-id=http://squid/imdb/$1";
  363.  
  364. #sourceforge
  365. } elsif ($url =~ m/^https?\:\/\/.*\.dl\.sourceforge\.net\/([\w-]+\.[\w]{2,3})/) {
  366. $out="OK store-id=http://squid/sourceforge/$1";
  367.  
  368. #steampowered dota 2
  369. } elsif ($url =~ m/^https?\:\/\/(.*steam(powered|content).*\/(client|depot)\/[\d]+\/(chunk|manifest)\/[^\?\s]*).*/) {
  370. $out="OK store-id=http://squid/$1";
  371.  
  372. } else {
  373. $out="ERR";
  374. }
  375.  
  376. if ($X[0] =~ m/^http.*/) {
  377. print "$out\n";
  378. } else {
  379. print "$chanel $out\n";
  380. }
  381. } ' > /etc/squid/storeid.pl
  382.  
  383.  
  384. echo '#!/usr/bin/perl
  385.  
  386. $|=1;
  387. while (<>) {
  388. @X = split;
  389. if ($X[0] =~ m/^http.*/) {
  390. $url = $X[0];
  391. $referer = $X[1];
  392. $urlreferer = $X[0] ." ". $X[1];
  393. } else {
  394. $chanel = $X[0];
  395. $url = $X[1];
  396. $referer = $X[2];
  397. $urlreferer = $X[1] ." ". $X[2];
  398. }
  399.  
  400.  
  401. #watch rewrite
  402. if ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[\=\%\&\?\/].*[\=\%\&\?\/])(nohtml5\=1|html5\=1)(.*)/) {
  403. $out="OK rewrite-url=$1" . "nohtml5=1" . $5;
  404.  
  405. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[\=\%\&\?\/].*[\=\%\&\?\/].*)/) {
  406. $out="OK rewrite-url=$1" . "&nohtml5=1";
  407.  
  408. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v)[\=\%\&\?\/][^\?^\&]*$)/) {
  409. $out="OK rewrite-url=$1" ."&nohtml5=1";
  410.  
  411. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(embed|v)[\=\%\&\?\/][^\?^\&]*$)/) {
  412. $out="OK rewrite-url=$1" ."?nohtml5=1";
  413.  
  414. } else {
  415. $out="ERR";
  416. }
  417.  
  418. if ($X[0] =~ m/^http.*/) {
  419. print "$out\n";
  420. } else {
  421. print "$chanel $out\n";
  422. }
  423. } ' > /etc/squid/storerewrite.pl
  424.  
  425.  
  426. chmod +x /etc/squid/storeid.pl
  427. chmod +x /etc/squid/storerewrite.pl
  428. chmod +x /etc/squid/squid.conf
  429. squid -zN
  430. wget -O /etc/init.d/squid http://pastebin.com/raw/A77yKwbi
  431. chmod +x /etc/init.d/squid
  432. update-rc.d squid defaults
  433. service squid start
  434. echo '#tproxy
  435. iptables -t mangle -N DIVERT
  436. iptables -t mangle -A DIVERT -j MARK --set-mark 1
  437. iptables -t mangle -A DIVERT -j ACCEPT
  438. iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
  439. iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  440. iptables -t mangle -A PREROUTING -p tcp --dport 8080 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  441. iptables -t mangle -A PREROUTING -p tcp --dport 8777 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  442. iptables -t mangle -A PREROUTING -p tcp --dport 182 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  443. iptables -t mangle -A PREROUTING -p tcp --dport 5050 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  444. iptables -t mangle -A PREROUTING -p tcp --dport 443 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  445. ip rule add fwmark 1 lookup 212
  446. ip route add local 0.0.0.0/0 dev lo table 212
  447.  
  448. #intercept
  449. #iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3129
  450. #iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 3127
  451.  
  452. exit 0' > /etc/rc.local
  453. reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement