Re: Help w/ Transparent Caching

From: John Saunders <[email protected]>
Date: 14 Feb 1997 15:01:00 GMT

This post may be premature (the code certainly is - usual disclaimers
apply). For a situation fitting a number of PPP dialin lines connected
to 1 linux box (A) and a seperate linux box running Squid (B). I've
included the ipfwadm filtering rules and the code for a transparent
proxy daemon (started from inetd for now). Both the rules and daemon
should be installed on box A, not B.

I have the normal httpd server running on the same box as the ipfwadm
rules so I've taken steps to allow normal access to the httpd server.
Also because transparent proxying only affects the incoming queue, any
port 80 access originating on box A to the outside doesn't get re-directed
by the transparent proxy rules. So make sure any text browsers on A are
configured to use the proxy.

$ ipfwadm -I -a accept -P tcp -S 0.0.0.0/0 -D 127.0.0.1/32 80 -r 80
$ ipfwadm -I -a accept -P tcp -S 0.0.0.0/0 -D A.A.A.A/32 80 -r 80
$ ipfwadm -I -a accept -P tcp -S 0.0.0.0/0 -D 0.0.0.0/0 80 -r 81

And here is the code, you need to edit it a bit, it's been gzip'ed and
uuencoded to save space. Install it to run by inetd on port 81.

If you don't have a httpd running, I wouldn't change things to run
the daemon on port 80. Because if somebody telnets to port 80 on
your box, the daemon will intercept this and contact the proxy
who will try and re-connect to the box. So Squid will now be talking
to the daemon which will try contacting Squid again and you end up
with a _lot_ of daemons running at an ever increasing rate. The
daemon should probably be able to detect a request of this nature
and return some error message.

begin 644 transproxy.c.gz
M'XL(",)N!#,"`W1R86YS<')O>'DN8P#%5WMOVS80_UOZ%+<42^14L9VA&XJX
M+A`TCQIKXB!QD6U=83`2'1&128VBZWI#OOON*$J6_$B#`L."P+;NQ;O?/7CJ
M[,,7,3UB`DS>?P7YO/_*AWTPFLD\T^KKX@@?B3)*1`[XSQR/:2X-6!'(N?["
M=1L&AB1RP[3A,4RTFH*0W,1@E)41$2=3[T>C*]#\KQG/#1K4O&XR70"+(IZ1
M!29CR%B><VO!)!QN;V^+,\G.1&E(4"85\KZ-A([OOQ`R2F<QAS?Y(N\8,>7M
MY.T*-5?1`S=-.GI)GG:$;-*9SEB'.&OB\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V$/]I!A.5Y%AKT_NWL4I5=:W2UX\!(./UM&&3_U;;,WRME$
M_A:WHG.SV$KZZU>?O4)#>U'6"^A6"\/=5)TW,24`F%R`0JZ&F!E6'D+A%4[_
M4&"QWO^NN!NS$?VU5;VL8XH=>]E,@O*F01VL_\28[*C3L=(%M:XS)Y\#=XLO
M%;$C,0V5I=:ZK/4YI&3AN'#B5A0?R_G(TYP7T314BR.H.];F%*Y/,ZR@A=W7
MZ/H@J!H55?:'7>KJV;)%U>LY^,Y.QG^<7@^#77=1VP"0>',Z"IP)G+D;F,['
M&LO5(+85%D'!I[):RH2NAI>?Y2`ORG1CSSMS;HJO]&V]QQ]+!]#!P<UF_Y<=
ML1Q/E=3F(>6MC"EGH#:JOG-8K<52#Z;6A[6AM46ENZ:"&RJ;I:;0V5Y3#9W'
MC1BNIGD3@@W3_PE^13']C^BM%,EV_"R$C7,T-S,MP9[S^'VO"D^_!)3;.)D;
M$W_Y8D#+!B?V?H)?U**4W*"2I*W,OIX%QV<X/D]'(=P,W_TZOAE=GQY?A-B;
MWURUG/XSMBQ[-/F!I^*"1K[=+>R*9B/&H_K;)GMCLZLI/N/4:A^:L*E(Z9IR
MH?9J/$(9.8E1,@_<VYDWY5/:MG8;&U4(%,'!V\0]U3;ME:V+PG497@+^U.)=
97]J_"7MI^1D(E`58.6$+\5]B&*<HBA```,'!
`
end
-- +------------------------------------------------------------+
        . | John Saunders - mailto:john@nlc.net.au (EMail) |
    ,--_|\ | - http://www.nlc.net.au/ (WWW) |
   / Oz \ | - 018-223-814 or 02-9477-2881 (Phone) |
   \_,--\_/ | NHJ NORTHLINK COMMUNICATIONS - Supplying a professional, |
         v | and above all friendly, internet connection service. |
              +------------------------------------------------------------+
Received on Fri Feb 14 1997 - 07:35:10 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:27 MST