{"id":984,"date":"2013-08-26T11:28:13","date_gmt":"2013-08-26T03:28:13","guid":{"rendered":"http:\/\/www.dogeye.net\/?p=984"},"modified":"2013-08-26T11:28:13","modified_gmt":"2013-08-26T03:28:13","slug":"tcpcopy%e5%88%9d%e4%bd%93%e9%aa%8c","status":"publish","type":"post","link":"https:\/\/ykyi.net\/?p=984","title":{"rendered":"Tcpcopy\u521d\u4f53\u9a8c."},"content":{"rendered":"<p>Tcpcopy \u521d\u4f53\u9a8c<\/p>\n<p>&nbsp;<\/p>\n<p>Tcpcopy\u662f\u4e00\u4e2a\u6a21\u62df\u771f\u5b9e\u6d41\u91cf\u7684\u6d4b\u8bd5\u5de5\u5177\u3002\u5b83\u7684\u5de5\u4f5c\u57fa\u672c\u601d\u60f3\u662f\uff0c\u4ece\u5df2\u7ecf\u4e0a\u7ebf\u7684\u670d\u52a1\u5668\u590d\u5236\u4e00\u4efd\u771f\u5b9e\u6d41\u91cf\u5230\u6d4b\u8bd5\u670d\u52a1\u5668\u3002Tcpcopy\u7684\u4ee3\u7801\u5f00\u6e90\uff0c\u4ee3\u7801\u4ed3\u5e93\u653e\u5728<a href=\"https:\/\/github.com\/wangbin579\/tcpcopy\">https:\/\/github.com\/wangbin579\/tcpcopy<\/a>\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u7ecf\u8fc7\u521d\u6b65\u5b66\u4e60\uff0c\u5df2\u6210\u529f\u5728\u516c\u53f8\u7684\u6d4b\u8bd5\u673a\u5668\u4e0a\u90e8\u7f72tcpcopy\uff0c\u5e76\u7528\u7b80\u5355\u7684DEMO\u7a0b\u5e8f\u6d4b\u8bd5\u8fbe\u5230\u9884\u671f\u76ee\u7684\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.<\/strong><strong>\u5b89\u88c5<\/strong><\/p>\n<p>\u56e0\u4e3a\u4f5c\u8005\u5199\u7684\u5b89\u88c5\u4ecb\u7ecd\u53ea\u63d0\u5230\u6700\u57fa\u672c\u7684\u4fe1\u606f\uff0c\u800c\u6d4b\u8bd5\u73af\u5883\u5404\u4e0d\u4e00\u6837\uff0c\u5728\u6211\u7528\u7684\u6d4b\u8bd5\u673a\u7684\u5b9e\u9645\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u78b0\u5230\u4e00\u4e9b\u95ee\u9898\u3002\u8fd9\u65f6\u95ee\u9898\u5728\u8fd9\u91cc\u5217\u51fa\uff0c\u4ee5\u4f9b\u540e\u6765\u8005\u53c2\u8003\uff0c\u4ee5\u8282\u7701\u65f6\u95f4\u3002\u6d4b\u8bd5\u673a\uff1a10.12.194.199 \uff1b 10.12.194.212 \uff1b 10.12.194.214 \u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.1 <\/strong><strong>\u9700\u8981\u989d\u5916\u5b89\u88c5\u7684\u5e93\uff1a<\/strong><\/p>\n<p>\u9700\u8981\u5728\u7f51\u7ad9 <a href=\"http:\/\/www.netfilter.org\">www.netfilter.org<\/a> \u4e0b\u8f7d libmnl\uff0c libnfnetlink\uff0c libnetfilter_queue \u4e09\u4e2a\u5de5\u7a0b\u5e76\u5b89\u88c5\u3002 \u5b89\u88c5\u987a\u5e8f\u4e3a libmnl\uff0c libnfnetlink, libnetfilter_queue\uff0c\u56e0\u4e3a\u7b2c\u4e09\u4e2a\u4f9d\u8d56\u7b2c\u4e8c\u4e2a\uff0c\u7b2c\u4e8c\u4e2a\u4f9d\u8d56\u7b2c\u4e00\u4e2a\u3002\u5b89\u88c5\u65b9\u6cd5\u662fGNU\u5de5\u5177\u7684\u4f20\u7edf\u4e09\u677f\u65a7\u65b9\u5f0f\uff1a .\/configure ; make; make install\u3002\u8fd9\u4e09\u4e2a\u5de5\u7a0b\u751f\u6210\u4e09\u4e2a.so\u5e93\u653e\u7f6e\u5230\/usr\/local\/lib\uff0c\u800c\u6211\u4eec\u7528\u7684\u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u5e76\u6ca1\u6709\u628a\u8be5\u76ee\u5f55\u5217\u5728\u9ed8\u8ba4\u67e5\u627e\u5e93\u6587\u4ef6\u7684\u76ee\u5f55\u5217\u8868\u4e2d\uff0c\u56e0\u6b64\u8981\u7f16\u8f91 \/etc\/ld.so.conf \u6587\u4ef6\uff0c\u628a\u76ee\u5f55\/usr\/local\/lib \u52a0\u5165\uff0c\u518d\u8fd0\u884c ldconfig \u66f4\u65b0ld\u94fe\u63a5\u7a0b\u5e8f\u4f7f\u7528\u7684cache\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.2 IP_Queue<\/strong><strong>\u548cNFQueue\u5185\u6838\u6a21\u5757\uff1a<\/strong><\/p>\n<p>\u8fd9\u4e24\u4e2a\u5185\u6838\u6a21\u5757\u7ed9\u5728\u7528\u6237\u7a7a\u95f4\u7f16\u5199\u5904\u7406\u5185\u6838\u7a7a\u95f4\u4e2d\u4f20\u9012\u7f51\u7edc\u6570\u636e\u5305\u63d0\u4f9b\u63a5\u53e3\u3002\u5b83\u4eec\u7684\u533a\u522b\u662fIP_Queue\u662f\u65e7\u7684\u5b9e\u73b0\uff0c\u4ec5\u652f\u6301IPv4\uff0cNFQueue\u662f\u65b0\u7684\u5b9e\u73b0\u3002Tcpcopy\u5de5\u7a0b\u4f9d\u8d56\u8fd9\u4e24\u4e2a\u6a21\u5757\u4e4b\u4e00\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Tcpcopy\u5b98\u65b9\u6587\u6863\u4e2d\u591a\u6b21\u63d0\u5230tcpcopy\u5728\u5185\u6838\u7248\u672c\u5c0f\u4e8e3.5\u65f6\u9ed8\u8ba4\u4f7f\u7528IP_Queue\uff0c\u5e76\u5728\u4f7f\u7528\u4f8b\u5b50\u4e2d\u6709\u4e00\u6b65\u64cd\u4f5c\uff1a<\/p>\n<p># modprobe ip_queue<\/p>\n<p>\u8fd9\u4e2a\u64cd\u4f5c\u662f\u786e\u4fdd\u52a0\u8f7dip_queue\u6a21\u5757\u5230\u5185\u6838\u3002<\/p>\n<p>\u6211\u4eec\u7684\u6d4b\u8bd5\u73af\u5883\u7684\u5185\u6838\u7248\u672c\u53f7\u662f2.6.32\uff0c\u6309\u7167\u5b98\u65b9\u6587\u6863\u4ecb\u7ecd\uff0c\u5185\u6838\u7248\u672c\u5c0f\u4e8e3.5\uff0c\u4e8e\u662f\u4f7f\u7528#modprobe ip_queue\u547d\u4ee4\uff0c\u7ed3\u679c\u62a5\u9519\u663e\u793a\u6211\u4eec\u4f7f\u7528\u7684\u5185\u6838\u6ca1\u6709\u542f\u7528\u52a8\u6001\u6a21\u5757\u52a0\u8f7d\u3002<\/p>\n<p>\u4e8e\u662f\u518d\u7528 # zcat \/proc\/config.gz \u68c0\u67e5\u5f53\u524d\u5185\u6838\u7684\u914d\u7f6e\uff0c\u53d1\u73b0CONFIG_IP_NF_QUEUE is not set, \u8bf4\u660eIP_Queue\u6a21\u5757\u6ca1\u6709\u88abbuit-in\uff0c\u518d\u67e5\u627eNFQueue\u7684\u914d\u7f6e\u9879\u53d1\u73b0 CONFIG_NETFILTER_NETLINK_QUEUE=y\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u5728\u6211\u4eec\u7684\u73af\u5883\u4e2d\uff0c\u5e94\u8be5\u5ffd\u7565\u5b98\u65b9\u6587\u6863\u4e2d# modprobe ip_queue\uff0c\u6211\u4eec\u7684\u5185\u6838\u5df2\u7ecf\u5185\u5efa\u4e86\u6bd4IPQueue\u66f4\u65b0\u7684<strong>NFQueue<\/strong><strong>\u3002<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.3 <\/strong><strong>\u7f16\u8bd1\u5b89\u88c5tcpcopy<\/strong><strong>\uff1a<\/strong><\/p>\n<p>\u5b98\u65b9\u6587\u6863\u4e2d\u628a\u5df2\u7ecf\u6b63\u5e38\u8fd0\u884c\u4e1a\u52a1\u7684\u670d\u52a1\u5668\u79f0\u4e3a\u5728\u7ebf\u670d\u52a1\u5668(online server)\uff0c\u628a\u8fd0\u884c\u5f85\u6d4b\u8bd5\u7528\u7684\u670d\u52a1\u5668\u79f0\u4e3a\u76ee\u6807\u670d\u52a1\u5668(target server)\u3002<\/p>\n<p>\u5728\u5728\u7ebf\u670d\u52a1\u5668\u7aef\u8fd0\u884c\u914d\u7f6e\u547d\u4ee4\u65f6\u52a1\u5fc5\u6307\u5b9a &#8211;enable-nfqueue\uff0c\u8fd9\u662f\u56e0\u4e3a\u6211\u4eec\u7528\u7684\u5185\u6838\u4e2d\u53ea\u6709NFQueue\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\u8fd9\u4e2a\u9009\u9879\uff0c\u7f16\u8bd1\u51fa\u7684tcpcopy\u4e0d\u4f1a\u8fd0\u884c\u6210\u529f\uff0c\u4f1a\u5728\u65e5\u5fd7\u6587\u4ef6\u4e2d\u62a5\u9519\uff1aplease make sure ip queue is running.<\/p>\n<p># .\/configure &#8211;enable-nfqueue &#8211;enable-pcap<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b98\u65b9\u6587\u6863\u4e2d\u4ecb\u7ecd\u8bbe\u7f6e\u9632\u706b\u5899\u89c4\u5219\u65f6\u5199\u9053\uff0c\u5982\u679c\u5185\u6838\u4f7f\u7528NFQueue,\u5219\u5728\u76ee\u6807\u670d\u52a1\u5668\u5982\u6b64\u8bbe\u7f6e<\/p>\n<p><em># iptables -I OUTPUT -p tcp &#8211;sport port -j NFQUEUE<\/em><\/p>\n<p>\u5b9e\u9645\u6267\u884c\u4e2d\uff0ciptables\u8fd4\u56de\u51fa\u9519iptables: Unknown error 18446744073709551615\u3002\u54a8\u8be2\u4e07\u80fd\u7684\u8c37\u6b4c\u540e\uff0c\u7ed9\u7684\u7b54\u6848\u662fiptables\u7684\u7248\u672c\u592a\u65e7\uff0c\u4e0d\u8ba4\u8bc6NFQueue\u3002\u4e8e\u662f\u4e0b\u8f7d\u4e86\u65b0\u7684iptables\u7248\u672c\u5e76\u5b89\u88c5\uff0c\u4f46\u7f16\u8bd1\u65f6\u62a5\u9519\u7f3a\u5c11\u4e00\u4e2a\u5e93\u6587\u4ef6\uff0c\u8fd9\u4e2a\u65b0\u7684\u5e93\u6587\u4ef6\u5728\u6211\u4eec\u7684\u76f8\u5bf9\u6bd4\u8f83\u65e7\u7684\u73af\u5883\u4e0b\u6ca1\u6709\u3002\u89e3\u51b3\u65b9\u6848\u662f\u4ecd\u7136\u7528\u65e7\u7684iptables\uff1a<\/p>\n<p><em># iptables -I OUTPUT -p tcp &#8211;sport port -j QUEUE<\/em><\/p>\n<p>\u6ca1\u6709\u4f7f\u7528NFQUEUE\uff0c\u800c\u662f\u4f7f\u7528QUEUE\uff0ciptables\u8bbe\u5b9a\u901a\u8fc7\u3002\u540e\u9762\u7684\u6d4b\u8bd5\u8bc1\u660e\u6682\u65f6\u4e5f\u6ca1\u6709\u95ee\u9898\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2.<\/strong><strong>\u6d4b\u8bd5<\/strong><\/p>\n<p>\u6211\u628atcpd\u7a0d\u5fae\u6539\u4e86\u4e00\u4e0b\uff0c\u6539\u6210\u4e86\u4e00\u4e2aecho\u670d\u52a1\u5668\u540c\u65f6\u4e5f\u6253\u5370\u6536\u5230\u7684\u62a5\u6587\uff0c\u76d1\u542c9999\u7aef\u53e3\u3002<\/p>\n<p>\u628a10.12.194.199\u4f5c\u4e3a\u5728\u7ebf\u670d\u52a1\u5668\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p># cd \/home\/kamus\/bin<\/p>\n<p># .\/tcpd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \u8fd0\u884cecho\u670d\u52a1\u5668<\/p>\n<p># .\/tcpcopy -x 9999-10.12.194.212:9999&nbsp; # \u628a\u53d1\u5f80echo\u670d\u52a1\u5668\u7684tcp\u5305\u590d\u5236\u4e00\u4efd\u53d1\u5f8010.12.194.212\u76849999\u7aef\u53e3<\/p>\n<p># .\/tcpdump -vv -i any dst port 9999 # \u76d1\u89c6\u6240\u6709\u53d1\u5f809999\u7aef\u53e3\u7684\u5305<\/p>\n<p>&nbsp;<\/p>\n<p>\u628a 10.12.194.212 \u4f5c\u4e3a\u76ee\u6807\u670d\u52a1\u5668\uff1a<\/p>\n<p># cd \/home\/kamus\/bin<\/p>\n<p># .\/tcpd<\/p>\n<p># .\/intercept<\/p>\n<p>&nbsp;<\/p>\n<p>\u628a 10.12.194.214 \u4f5c\u4e3a\u5ba2\u6237\u673a\uff1a<\/p>\n<p># cat \/etc\/passwd | netcat 10.12.194.199 9999<\/p>\n<p>\u5ba2\u6237\u673a\u628a\u672c\u673a\u7684\u5bc6\u7801\u6587\u4ef6\u53d1\u5f8010.12.194.199\u673a\u5668\u7684echo\u670d\u52a1\u5668\u3002\u8fd9\u65f6\u5ba2\u6237\u673a\uff0c\u5728\u7ebf\u670d\u52a1\u5668\u548c\u76ee\u6807\u670d\u52a1\u5668\u90fd\u6253\u5370\u51fa\u4e86 \/etc\/passwd \u7684\u6587\u4ef6\u3002\u8fd0\u884c\u5728\u5728\u7ebf\u670d\u52a1\u5668\u4e0a\u7684tcpdump\u76d1\u63a7\u5230\u4e86tcpcopy\u590d\u5236\u7684\u5305\u3002\u6d4b\u8bd5\u7ed3\u679c\u7b26\u5408\u9884\u671f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>3.<\/strong><strong>\u5c0f\u7ed3<\/strong><\/p>\n<p>\u76ee\u524d\u53ea\u662f\u7b80\u5355\u7684\u5b9e\u9a8c\u4e86\u4e00\u4e0btcpcopy\uff0c\u6ca1\u6709\u8fdb\u884c\u5927\u6d41\u91cf\u7684\u6d4b\u8bd5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Tcpcopy\u7684\u5b98\u65b9\u9996\u9875\u4e0a\u7684\u6587\u6863\u6bd4\u7528git clone\u4e0b\u8f7d\u4e0b\u6765\u540e\u7684\u6e90\u4ee3\u7801\u6811\u4e2d\u7684\u6700\u65b0\u6587\u6863\u65e7\u3002\u65b0\u7684tcpcopy\u5b9e\u73b0\u6709\u4e86\u66f4\u9ad8\u7ea7\u7684\u53d1\u5f0f\uff0c\u53ef\u4ee5\u4e0d\u4f9d\u8d56\u5185\u6838\u7a7a\u95f4\u7684IP_Queue\u6216NFQueue\u6a21\u5757\uff0c\u4f46\u9700\u8981\u989d\u5916\u4e00\u53f0\u673a\u5668\u3002\u8fd8\u672a\u6d4b\u8bd5\u8fd9\u79cd\u65b9\u5f0f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u53e6\u5916\uff0c\u6211\u6709\u4e2a\u60f3\u6cd5\uff0c\u5982\u679c\u5728\u7ebf\u670d\u52a1\u5668\u548c\u76ee\u6807\u670d\u52a1\u5668\u7528\u96c6\u7ebf\u5668\u8fde\u63a5\uff0c\u90a3\u4e48\u7406\u8bba\u4e0a\u53ef\u4ee5\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u55c5\u63a2\u5230\u5728\u7ebf\u670d\u52a1\u5668\u4e0a\u6536\u53d1\u7684\u6570\u636e\u5305\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e0d\u7528\u5728\u5728\u7ebf\u670d\u52a1\u5668\u4e0a\u8fd0\u884ctcpcopy\u590d\u5236\u6d41\u91cf\uff0c\u800c\u53ea\u9700\u8981\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u55c5\u63a2\u4ee5\u592a\u7f51\u4e0a\u53d1\u5f80\u5728\u7ebf\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u5305\uff0c\u8fd9\u6837\u5c31\u4f1a\u5bf9\u5728\u7ebf\u670d\u52a1\u5668\u6beb\u65e0\u5f71\u54cd\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5927\u81f4\u770b\u4e86\u4e0btcpcopy\u7684\u4ee3\u7801\uff0c\u53d1\u73b0\u4ee3\u7801\u5199\u5f97\u5f88\u5e72\u51c0\uff0c\u5e0c\u671b\u628atcpcopy\u7684\u4ee3\u7801\u8be6\u7ec6\u770b\u4e00\u904d\uff0c\u4ee5\u540e\u5c31\u80fd\u5728\u4e0a\u9762\u8fdb\u884c\u4e8c\u6b21\u5f00\u53d1\uff0c\u4ee5\u53ca\u63d0\u9ad8\u8c03\u8bd5\u4f7f\u7528tcpcopy\u65f6\u51fa\u9519\u7684\u80fd\u529b\u3002<\/p>\n<p><span style=\"color: rgb(0, 0, 0); font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 22px;\">copyright ykyi.net<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tcpcopy \u521d\u4f53\u9a8c &nbsp; Tcpcopy\u662f\u4e00\u4e2a\u6a21\u62df\u771f\u5b9e\u6d41\u91cf\u7684\u6d4b\u8bd5\u5de5\u5177\u3002\u5b83\u7684\u5de5\u4f5c\u57fa\u672c\u601d\u60f3\u662f\uff0c\u4ece\u5df2\u7ecf\u4e0a\u7ebf\u7684\u670d\u52a1\u5668\u590d\u5236\u4e00\u4efd\u771f\u5b9e\u6d41\u91cf\u5230\u6d4b\u8bd5\u670d\u52a1\u5668\u3002Tcpcopy\u7684\u4ee3\u7801\u5f00\u6e90\uff0c\u4ee3\u7801\u4ed3\u5e93\u653e\u5728https:\/\/github.com\/wangbin579\/tcpcopy\u3002 &nbsp; \u7ecf\u8fc7\u521d\u6b65\u5b66\u4e60\uff0c\u5df2\u6210\u529f\u5728\u516c\u53f8\u7684\u6d4b\u8bd5\u673a\u5668\u4e0a\u90e8\u7f72tcpcopy\uff0c\u5e76\u7528\u7b80\u5355\u7684DEMO\u7a0b\u5e8f\u6d4b\u8bd5\u8fbe\u5230\u9884\u671f\u76ee\u7684\u3002 &nbsp; 1.\u5b89\u88c5 \u56e0\u4e3a\u4f5c\u8005\u5199\u7684\u5b89\u88c5\u4ecb\u7ecd\u53ea\u63d0\u5230\u6700\u57fa\u672c\u7684\u4fe1\u606f\uff0c\u800c\u6d4b\u8bd5\u73af\u5883\u5404\u4e0d\u4e00\u6837\uff0c\u5728\u6211\u7528\u7684\u6d4b\u8bd5\u673a\u7684\u5b9e\u9645\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u78b0\u5230\u4e00\u4e9b\u95ee\u9898\u3002\u8fd9\u65f6\u95ee\u9898\u5728\u8fd9\u91cc\u5217\u51fa\uff0c\u4ee5\u4f9b\u540e\u6765\u8005\u53c2\u8003\uff0c\u4ee5\u8282\u7701\u65f6\u95f4\u3002\u6d4b\u8bd5\u673a\uff1a10.12.194.199 \uff1b 10.12.194.212 \uff1b 10.12.194.214 \u3002 &nbsp; 1.1 \u9700\u8981\u989d\u5916\u5b89\u88c5\u7684\u5e93\uff1a \u9700\u8981\u5728\u7f51\u7ad9 www.netfilter.org \u4e0b\u8f7d libmnl\uff0c libnfnetlink\uff0c libnetfilter_queue \u4e09\u4e2a\u5de5\u7a0b\u5e76\u5b89\u88c5\u3002 \u5b89\u88c5\u987a\u5e8f\u4e3a libmnl\uff0c libnfnetlink, libnetfilter_queue\uff0c\u56e0\u4e3a\u7b2c\u4e09\u4e2a\u4f9d\u8d56\u7b2c\u4e8c\u4e2a\uff0c\u7b2c\u4e8c\u4e2a\u4f9d\u8d56\u7b2c\u4e00\u4e2a\u3002\u5b89\u88c5\u65b9\u6cd5\u662fGNU\u5de5\u5177\u7684\u4f20\u7edf\u4e09\u677f\u65a7\u65b9\u5f0f\uff1a .\/configure ; make; make install\u3002\u8fd9\u4e09\u4e2a\u5de5\u7a0b\u751f\u6210\u4e09\u4e2a.so\u5e93\u653e\u7f6e\u5230\/usr\/local\/lib\uff0c\u800c\u6211\u4eec\u7528\u7684\u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u5e76\u6ca1\u6709\u628a\u8be5\u76ee\u5f55\u5217\u5728\u9ed8\u8ba4\u67e5\u627e\u5e93\u6587\u4ef6\u7684\u76ee\u5f55\u5217\u8868\u4e2d\uff0c\u56e0\u6b64\u8981\u7f16\u8f91 \/etc\/ld.so.conf \u6587\u4ef6\uff0c\u628a\u76ee\u5f55\/usr\/local\/lib \u52a0\u5165\uff0c\u518d\u8fd0\u884c ldconfig \u66f4\u65b0ld\u94fe\u63a5\u7a0b\u5e8f\u4f7f\u7528\u7684cache\u3002 &nbsp; 1.2 IP_Queue\u548cNFQueue\u5185\u6838\u6a21\u5757\uff1a \u8fd9\u4e24\u4e2a\u5185\u6838\u6a21\u5757\u7ed9\u5728\u7528\u6237\u7a7a\u95f4\u7f16\u5199\u5904\u7406\u5185\u6838\u7a7a\u95f4\u4e2d\u4f20\u9012\u7f51\u7edc\u6570\u636e\u5305\u63d0\u4f9b\u63a5\u53e3\u3002\u5b83\u4eec\u7684\u533a\u522b\u662fIP_Queue\u662f\u65e7\u7684\u5b9e\u73b0\uff0c\u4ec5\u652f\u6301IPv4\uff0cNFQueue\u662f\u65b0\u7684\u5b9e\u73b0\u3002Tcpcopy\u5de5\u7a0b\u4f9d\u8d56\u8fd9\u4e24\u4e2a\u6a21\u5757\u4e4b\u4e00\u3002 &nbsp; Tcpcopy\u5b98\u65b9\u6587\u6863\u4e2d\u591a\u6b21\u63d0\u5230tcpcopy\u5728\u5185\u6838\u7248\u672c\u5c0f\u4e8e3.5\u65f6\u9ed8\u8ba4\u4f7f\u7528IP_Queue\uff0c\u5e76\u5728\u4f7f\u7528\u4f8b\u5b50\u4e2d\u6709\u4e00\u6b65\u64cd\u4f5c\uff1a # modprobe ip_queue \u8fd9\u4e2a\u64cd\u4f5c\u662f\u786e\u4fdd\u52a0\u8f7dip_queue\u6a21\u5757\u5230\u5185\u6838\u3002 \u6211\u4eec\u7684\u6d4b\u8bd5\u73af\u5883\u7684\u5185\u6838\u7248\u672c\u53f7\u662f2.6.32\uff0c\u6309\u7167\u5b98\u65b9\u6587\u6863\u4ecb\u7ecd\uff0c\u5185\u6838\u7248\u672c\u5c0f\u4e8e3.5\uff0c\u4e8e\u662f\u4f7f\u7528#modprobe ip_queue\u547d\u4ee4\uff0c\u7ed3\u679c\u62a5\u9519\u663e\u793a\u6211\u4eec\u4f7f\u7528\u7684\u5185\u6838\u6ca1\u6709\u542f\u7528\u52a8\u6001\u6a21\u5757\u52a0\u8f7d\u3002 \u4e8e\u662f\u518d\u7528 # zcat \/proc\/config.gz \u68c0\u67e5\u5f53\u524d\u5185\u6838\u7684\u914d\u7f6e\uff0c\u53d1\u73b0CONFIG_IP_NF_QUEUE &hellip; <a href=\"https:\/\/ykyi.net\/?p=984\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Tcpcopy\u521d\u4f53\u9a8c.&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[77],"class_list":["post-984","post","type-post","status-publish","format-standard","hentry","category-tech_articles","category-unix_linux","tag-tcpcopy"],"_links":{"self":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=984"}],"version-history":[{"count":0,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/984\/revisions"}],"wp:attachment":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}