{"id":3155,"date":"2012-11-23T15:59:04","date_gmt":"2012-11-23T13:59:04","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=3155"},"modified":"2025-05-20T11:50:53","modified_gmt":"2025-05-20T08:50:53","slug":"%d0%bf%d1%80%d0%be%d0%b1%d1%80%d0%b0%d1%81%d1%8b%d0%b2%d0%b0%d0%b5%d0%bc-ftp-%d0%b2-%d0%bb%d0%be%d0%ba%d0%b0%d0%bb%d0%ba%d1%83","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=3155","title":{"rendered":"\u041f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c ftp \u0432 \u043b\u043e\u043a\u0430\u043b\u043a\u0443"},"content":{"rendered":"<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u044e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c &#8220;\u0432\u0438\u0434\u0435\u0442\u044c&#8221; \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 <strong>ftp<\/strong> \u0441\u043d\u0430\u0440\u0443\u0436\u0438. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0442\u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443? \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 <strong>NAT&#8217;\u043e\u043c<\/strong>? \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b <strong>ftp<\/strong> \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439<\/p>\n<p><em><span style=\"color: #ff6600;\">1) \u0422\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0430\u043c\u043e\u0433\u043e FTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\"> 2) \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043f\u043e\u0440\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 (passive ports range)<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\"> 3) \u041f\u0440\u043e\u0431\u0440\u043e\u0441 \u043f\u043e\u0440\u0442\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c 1:1 (\u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f passive ports range 5000:5099 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0442\u043e\u0436\u0435 \u0432 \u043f\u043e\u0440\u0442\u044b 5000:5099)<\/span><\/em><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e &#8220;\u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c&#8221; \u0432 \u043b\u043e\u043a\u0430\u043b\u043a\u0443 <strong>passive ports range<\/strong> + 21-\u044b\u0439. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, 21-\u044b\u0439 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c 21-\u044b\u043c, \u0430 \u0432\u043e\u0442 <strong>portrange<\/strong> &#8211; \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c <strong>1:1<\/strong>.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0444\u0430\u0439\u0435\u0440\u0432\u043e\u043b\u0430 <strong>pf<\/strong>:<\/p>\n<p><code>rdr on $ext_if proto tcp from any to $ext_if port 21 -&gt; 10.10.10.10 port 21<br \/>\nrdr on $ext_if proto tcp from any to $ext_if port 5000:5099 -&gt; 10.10.10.10 port 5000:5099<\/code><\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0430\u043a \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u0444\u0430\u0439\u0435\u0440\u0432\u043e\u043b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0440\u0442\u044b.<\/p>\n<p>\u0430 \u0442\u0430\u043a \u0434\u043b\u044f <strong>ipfw<\/strong><\/p>\n<p><code>ipfw nat 1 config redirect_port tcp 10.10.10.10:21 21<br \/>\nipfw nat 1 config redirect_port tcp 10.10.10.10:5000-5099 5000-5099<\/code><\/p>\n<p>\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a \u0434\u043b\u044f <strong>iptables<\/strong><\/p>\n<p><code>iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 21 -j DNAT --to-destination 10.10.10.10:21<br \/>\niptables -t nat -A PREROUTING -i eth0 -p tcp --dport 5000:5099 -j DNAT --to-destination 10.10.10.10<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u044e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c &#8220;\u0432\u0438\u0434\u0435\u0442\u044c&#8221; \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 ftp \u0441\u043d\u0430\u0440\u0443\u0436\u0438. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0442\u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443? \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 NAT&#8217;\u043e\u043c? \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b ftp \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 1) \u0422\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0430\u043c\u043e\u0433\u043e FTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 2) \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043f\u043e\u0440\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 (passive ports range) 3) \u041f\u0440\u043e\u0431\u0440\u043e\u0441 \u043f\u043e\u0440\u0442\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-3155","post","type-post","status-publish","format-standard","hentry","category-www"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3155"}],"version-history":[{"count":3,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3155\/revisions"}],"predecessor-version":[{"id":6573,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3155\/revisions\/6573"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}