{"id":5002,"date":"2022-04-13T00:57:58","date_gmt":"2022-04-12T16:57:58","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=5002"},"modified":"2024-05-05T14:19:06","modified_gmt":"2024-05-05T06:19:06","slug":"linux-%e8%ae%be%e7%bd%ae%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=5002","title":{"rendered":"Linux \u8bbe\u7f6e\u4ee3\u7406"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.iyatt.com\/?p=5002\/#%E5%89%8D%E8%A8%80\" >\u524d\u8a00<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.iyatt.com\/?p=5002\/#%E4%BB%A3%E7%90%86%E8%AE%BE%E7%BD%AE\" >\u4ee3\u7406\u8bbe\u7f6e<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.iyatt.com\/?p=5002\/#%E5%85%A8%E7%BB%88%E7%AB%AF%E8%B5%B7%E4%BD%9C%E7%94%A8\" >\u5168\u7ec8\u7aef\u8d77\u4f5c\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.iyatt.com\/?p=5002\/#%E6%8C%87%E5%AE%9A%E5%BA%94%E7%94%A8%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%90%86\" >\u6307\u5b9a\u5e94\u7528\u4f7f\u7528\u4ee3\u7406<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E5%89%8D%E8%A8%80\"><\/span>\u524d\u8a00<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6211\u5bf9\u4e8e\u7ec8\u7aef\u4ee3\u7406\u7684\u9700\u6c42\u4e3b\u8981\u662f\u56e0\u4e3a\u8981\u4f7f\u7528 git \u4e0a\u4f20\u4ee3\u7801\u5230 GitHub \u4e0a\uff0c\u4ee5\u53ca\u4ece GitHub \u514b\u9686\u9879\u76ee\u4e0b\u6765\uff0c\u8fd8\u6709\u4e9b\u5f00\u6e90\u9879\u76ee\u7684\u7f16\u8bd1\u4e2d\u9014\u9700\u8981\u4e0b\u8f7d\u4f9d\u8d56\uff0c\u7ecf\u5e38\u8981\u7528\u5230\u4ee3\u7406\uff0c\u6bd5\u7adf\u56fd\u5185\u76f4\u8fde\u5341\u5206\u4e0d\u7a33\u5b9a\u6709\u65f6\u5019\u8fd8\u65e0\u6cd5\u8bbf\u95ee\u3002<br \/>\n\u4e4b\u524d\u4e5f\u8bd5\u8fc7\u4e00\u4e9b\u76f4\u63a5\u5728 Linux \uff08\u6211\u8fd9\u91cc\u662f Ubuntu\uff09\u4e0a\u5b89\u88c5\u7684\u9b54\u6cd5\u4e0a\u7f51\u5ba2\u6237\u7aef\uff0c\u4f46\u662f\u603b\u662f\u5b58\u5728\u5404\u79cd\u95ee\u9898\uff0c\u4f7f\u7528\u8d77\u6765\u4f53\u9a8c\u4e0d\u662f\u5f88\u597d\u3002\u800c Windows \u548c Android \u7684\u5404\u7c7b\u5ba2\u6237\u7aef\u5c31\u633a\u597d\u7528\u7684\u3002<br \/>\n\u6240\u4ee5\u5c31\u6362\u4e86\u4e00\u79cd\u65b9\u6848\uff0c\u6211 Windows \u4e3b\u673a\u7684\u9b54\u6cd5\u4e0a\u7f51\u90fd\u662f\u5f00\u673a\u5c31\u8fd0\u884c\u7684\uff0c\u5982\u679c\u4f7f\u7528 Linux \u865a\u62df\u673a\u7684\u8bdd\uff0c\u5c31\u53ef\u4ee5\u7528\u4e3b\u673a\u7684\u9b54\u6cd5\u4e0a\u7f51\u5f53\u4f5c\u4e00\u4e2a\u95f4\u63a5\u4ee3\u7406\uff0c\u5c06\u865a\u62df\u673a\u5185\u4ee3\u7406\u4ee3\u4e3b\u673a\u7684\u9b54\u6cd5\u4e0a\u7f51\u5ba2\u6237\u7aef\uff0c\u518d\u7531\u4e3b\u673a\u7684\u9b54\u6cd5\u4e0a\u7f51\u5ba2\u6237\u7aef\u4ee3\u7406\u51fa\u53bb\u3002<br \/>\n\u5982\u679c\u4f7f\u7528 Linux \u7269\u7406\u673a\uff0c\u53ef\u4ee5\u7528\u624b\u673a\u5f00\u9b54\u6cd5\u4e0a\u7f51\uff0c\u540c\u4e00\u5c40\u57df\u7f51\u7684 Linux \u8bbe\u7f6e\u4ee3\u7406\u5230\u624b\u673a\uff0c\u518d\u4ee3\u7406\u51fa\u53bb\u3002<\/p>\n<p>\u6211\u8fd9\u91cc\u7535\u8111\u7528\u7684 v2rayN\uff0c\u8981\u5141\u8bb8\u5c40\u57df\u7f51\u4f7f\u7528\u7684\u8bdd\u5c31\u8981\u8bbe\u7f6e\u6253\u5f00\uff08\u5982\u679c\u662f\u672c\u673a\u7684\u865a\u62df\u673a\u7684\u5c31\u4e0d\u662f\u5fc5\u8981\u7684\uff09<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2022\/04\/image-170.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 423px; --smush-placeholder-aspect-ratio: 423\/176;\" \/><\/p>\n<p>\u624b\u673a\u7528\u7684 v2rayNG\uff0c\u56e0\u4e3a\u4e0d\u662f\u672c\u673a\u800c\u662f\u5c40\u57df\u7f51\u7684\uff0c\u6240\u4ee5\u5fc5\u987b\u5f00\u542f\u201c\u5141\u8bb8\u6765\u81ea\u5c40\u57df\u7f51\u7684\u8fde\u63a5\u201d<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/03\/image-1678339630045.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 424px; --smush-placeholder-aspect-ratio: 424\/892;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E4%BB%A3%E7%90%86%E8%AE%BE%E7%BD%AE\"><\/span>\u4ee3\u7406\u8bbe\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u8981\u8bbe\u7f6e\u4ee3\u7406\u5c31\u8981\u77e5\u9053\u4ee3\u7406\u670d\u52a1\u5668\u7684 IP \u548c\u7aef\u53e3\uff0c\u5373\u8fd9\u91cc\u9b54\u6cd5\u4e0a\u7f51\u5ba2\u6237\u7aef\u6240\u5728\u7cfb\u7edf\u5bf9\u4e8e\u9700\u8981\u4ee3\u7406\u7684 Linux \u7cfb\u7edf\u53ef\u8bbf\u95ee\u7684 IP \u548c\u7aef\u53e3<br \/>\n\u5982\u679c\u662f\u5728 Linux \u865a\u62df\u673a\u4e2d\uff08NAT \u6a21\u5f0f\uff09\uff0c\u60f3\u8981\u83b7\u53d6\u4e3b\u673a Windows \u7684 IP \u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\u6267\u884c<\/p>\n<pre><code class=\"language-bash\">ip route<\/code><\/pre>\n<p>\u5982\u679c\u662f\u540c\u4e00\u5c40\u57df\u7f51\u7528\u624b\u673a\u7ed9 Linux \u4ee3\u7406\uff0c\u5c31\u8981\u77e5\u9053\u624b\u673a\u5728\u5c40\u57df\u7f51\u4e2d\u7684 IP\uff0c\u8981\u4e48\u901a\u8fc7\u8def\u7531\u5668\u7ba1\u7406\u83b7\u53d6\uff0c\u8981\u4e48\u901a\u8fc7\u624b\u673a\u672c\u673a WiFi \u8fde\u63a5\u4fe1\u606f\u6216\u8005\u5176\u5b83\u4e00\u4e9b\u5de5\u5177\u3002<\/p>\n<p>\u7aef\u53e3\u7684\u8bdd\uff0c\u53ef\u4ee5\u770b\u9b54\u6cd5\u4e0a\u7f51\u5ba2\u6237\u7aef\u4e0a\u9762\u663e\u793a\u7684\u6216\u8bbe\u7f6e\uff0c\u6bd4\u5982\u8fd9\u91cc\u5b89\u5353\u7aef  http \u9ed8\u8ba4\u7aef\u53e3\u5c31\u662f10809\uff08\u770b\u4e0a\u4e00\u5f20\u56fe\uff09<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%85%A8%E7%BB%88%E7%AB%AF%E8%B5%B7%E4%BD%9C%E7%94%A8\"><\/span>\u5168\u7ec8\u7aef\u8d77\u4f5c\u7528<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5728\u67d0\u4e2a\u7ec8\u7aef\u9700\u8981\u4ee3\u7406\u65f6\u5c31\u8bbe\u7f6e\u4e00\u4e0b\u4ee3\u7406\u53d8\u91cf<\/p>\n<pre><code class=\"language-bash\">export http_proxy=http:\/\/[ip]:[port]\nexport https_proxy=http:\/\/[ip]:[port]<\/code><\/pre>\n<p>\u6bd4\u5982 IP \u662f 192.168.1.141\uff0c\u7aef\u53e3\u662f 10809 \u5c31\u6267\u884c<\/p>\n<pre><code class=\"language-bash\">export http_proxy=http:\/\/192.168.1.141:10809\nexport https_proxy=http:\/\/192.168.1.141:10809<\/code><\/pre>\n<p>\u8fd9\u79cd\u8bbe\u7f6e\u65b9\u6cd5\u53ea\u5728\u8bbe\u7f6e\u4ee3\u7406\u53d8\u91cf\u7684\u7ec8\u7aef\u8d77\u4f5c\u7528\uff0c\u53e6\u5916\u5f00\u4e00\u4e2a\u7ec8\u7aef\u5c31\u4e0d\u53d7\u5f71\u54cd\u3002\u5982\u679c\u8981\u5f00\u4e00\u4e2a\u7ec8\u7aef\u5c31\u81ea\u52a8\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u5c06\u6267\u884c\u7684\u5185\u5bb9\u5199\u5230 ~\/.bashrc \uff08\u7ec8\u7aef\u914d\u7f6e\u6587\u4ef6\uff09\u7684\u6700\u540e\u9762<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E6%8C%87%E5%AE%9A%E5%BA%94%E7%94%A8%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%90%86\"><\/span>\u6307\u5b9a\u5e94\u7528\u4f7f\u7528\u4ee3\u7406<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u524d\u9762\u7684\u65b9\u6cd5\u662f\u5bf9\u6574\u4e2a\u7ec8\u7aef\u8d77\u4f5c\u7528\uff0c\u4f46\u662f\u4e2d\u95f4\u53ef\u80fd\u53c8\u5939\u6742\u7740\u8fde\u63a5\u56fd\u5185\u7684\u670d\u52a1\uff0c\u56fd\u5185\u670d\u52a1\u4f7f\u7528\u4ee3\u7406\u662f\u6ca1\u5fc5\u8981\u7684\u800c\u4e14\u53ef\u80fd\u901f\u5ea6\u66f4\u6162\u4e86<\/p>\n<p>\u90a3\u4e48\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\uff0c\u6bd4\u5982 ~\/proxy\uff0c\u5199\u5165\u4e0b\u9762\u5185\u5bb9\uff08IP \u548c\u7aef\u53e3\u5199\u81ea\u5df1\u7684\uff09<\/p>\n<pre><code class=\"language-bash\">#!\/usr\/bin\/env bash\nip=XXXXX\nport=XXXXX\nexport http_proxy=http:\/\/$ip:$port\nexport https_proxy=http:\/\/$ip:$port\nexec &quot;$@&quot;<\/code><\/pre>\n<p>\u7136\u540e\u7ed9\u6587\u4ef6\u6dfb\u52a0\u53ef\u6267\u884c\u6743\u9650<\/p>\n<pre><code class=\"language-bash\">chmod a+x ~\/proxy<\/code><\/pre>\n<p>\u6bd4\u5982\u6211\u5728 git \u514b\u9686\u4e00\u4e2a\u9879\u76ee\u65f6\u4f7f\u7528\u8fd9\u4e2a\u4ee3\u7406\uff0c\u5c31\u6267\u884c\uff08\u524d\u9762\u52a0\u4e0a ~\/proxy)<\/p>\n<pre><code class=\"language-bash\">~\/proxy git clone https:\/\/github.com\/openwrt\/openwrt.git --depth=1 --branch=openwrt-22.03<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u6211\u5bf9\u4e8e\u7ec8\u7aef\u4ee3\u7406\u7684\u9700\u6c42\u4e3b\u8981\u662f\u56e0\u4e3a\u8981\u4f7f\u7528 git \u4e0a\u4f20\u4ee3\u7801\u5230 GitHub \u4e0a\uff0c\u4ee5\u53ca\u4ece GitHub \u514b\u9686\u9879 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,598],"tags":[],"class_list":["post-5002","post","type-post","status-publish","format-standard","hentry","category-all","category-linux"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/5002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5002"}],"version-history":[{"count":0,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/5002\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}