{"id":54245,"date":"2025-02-18T12:50:50","date_gmt":"2025-02-18T04:50:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/54245\/"},"modified":"2025-02-18T12:50:50","modified_gmt":"2025-02-18T04:50:50","slug":"%e6%b7%b1%e5%85%a5%e4%ba%86%e8%a7%a3v2ray-yaml%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/54245\/","title":{"rendered":"\u6df1\u5165\u4e86\u89e3V2Ray YAML\u914d\u7f6e\u6587\u4ef6"},"content":{"rendered":"<p>V2Ray\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7f51\u7edc\u4ee3\u7406\u5de5\u5177\uff0c\u5e38\u7528\u4e8e\u7ffb\u5899\u548c\u79d1\u5b66\u4e0a\u7f51\u3002\u672c\u6587\u5c06\u91cd\u70b9\u8ba8\u8bbaV2Ray\u7684YAML\u914d\u7f6e\u6587\u4ef6\uff0c\u5e2e\u52a9\u7528\u6237\u7406\u89e3\u5982\u4f55\u914d\u7f6eV2Ray\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u7f51\u7edc\u9700\u6c42\u3002<\/p>\n<h2>\u4ec0\u4e48\u662fV2Ray YAML\u914d\u7f6e\u6587\u4ef6\uff1f<\/h2>\n<p>V2Ray\u7684\u914d\u7f6e\u6587\u4ef6\u4e3b\u8981\u4f7f\u7528YAML\u683c\u5f0f\uff0c\u5b83\u662f\u4e00\u79cd\u4eba\u7c7b\u53ef\u8bfb\u7684\u6570\u636e\u5e8f\u5217\u5316\u683c\u5f0f\uff0c\u6613\u4e8e\u7f16\u5199\u548c\u9605\u8bfb\u3002\u901a\u8fc7YAML\u6587\u4ef6\uff0c\u7528\u6237\u53ef\u4ee5\u7075\u6d3b\u5730\u914d\u7f6e\u4ee3\u7406\u7684\u5404\u4e2a\u53c2\u6570\u3002\u4e86\u89e3YAML\u914d\u7f6e\u6587\u4ef6\u7684\u7ed3\u6784\u5bf9\u4e8e\u4f7f\u7528V2Ray\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<h2>V2Ray YAML\u914d\u7f6e\u6587\u4ef6\u7684\u57fa\u672c\u7ed3\u6784<\/h2>\n<p>YAML\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u5305\u542b\u51e0\u4e2a\u4e3b\u8981\u90e8\u5206\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a\u57fa\u672c\u7684\u7ed3\u6784\u793a\u4f8b\uff1a<\/p>\n<p>yaml outbounds:<\/p>\n<ul>\n<li>protocol: vmess settings: vnext: \u2013 address: example.com port: 10086 users: \u2013 id: uuid alterId: 64<\/li>\n<\/ul>\n<p>inbounds:<\/p>\n<ul>\n<li>port: 1080 protocol: socks settings: auth: no ip: 127.0.0.1 clients: \u2013 id: uuid<\/li>\n<\/ul>\n<h3>\u5173\u952e\u7ec4\u4ef6\u89e3\u91ca<\/h3>\n<ol>\n<li><strong>inbounds<\/strong>: \u5b9a\u4e49\u8fdb\u5165\u7684\u8fde\u63a5\u8bbe\u7f6e\uff0c\u4f8b\u5982\u4ee3\u7406\u7684\u7aef\u53e3\u548c\u534f\u8bae\u3002<\/li>\n<li><strong>outbounds<\/strong>: \u5b9a\u4e49\u51fa\u53bb\u7684\u8fde\u63a5\u8bbe\u7f6e\uff0c\u5305\u62ec\u5982\u4f55\u4e0e\u8fdc\u7a0b\u670d\u52a1\u5668\u901a\u4fe1\u3002<\/li>\n<li><strong>protocol<\/strong>: \u8868\u793a\u6240\u4f7f\u7528\u7684\u534f\u8bae\uff0c\u5982<code>vmess<\/code>\u6216<code>socks<\/code>\u3002<\/li>\n<li><strong>settings<\/strong>: \u7528\u4e8e\u6307\u5b9a\u8fde\u63a5\u7684\u8be6\u7ec6\u8bbe\u7f6e\uff0c\u5982\u76ee\u6807\u5730\u5740\u548c\u7aef\u53e3\u3002<\/li>\n<li><strong>users<\/strong>: \u5b9a\u4e49\u7528\u6237\u4fe1\u606f\uff0c\u5305\u62ec<code>id<\/code>\uff08UUID\uff09\u548c<code>alterId<\/code>\uff08\u7528\u4e8e\u52a0\u5bc6\uff09\u3002<\/li>\n<\/ol>\n<h2>\u914d\u7f6eV2Ray\u7684\u6b65\u9aa4<\/h2>\n<h3>1. \u4e0b\u8f7d\u4e0e\u5b89\u88c5V2Ray<\/h3>\n<p>\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u4e0b\u8f7d\u5e76\u5b89\u88c5\u4e86V2Ray\u3002\u53ef\u4ee5\u4ece\u4e0b\u8f7d\u76f8\u5e94\u7684\u7248\u672c\uff0c\u5e76\u6309\u7167\u5b89\u88c5\u8bf4\u660e\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<h3>2. \u521b\u5efaYAML\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u627e\u5230V2Ray\u7684\u914d\u7f6e\u76ee\u5f55\uff0c\u901a\u5e38\u662f<code>\/etc\/v2ray\/<\/code>\u3002\u5728\u8be5\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>config.yaml<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5c06\u57fa\u7840\u914d\u7f6e\u7c98\u8d34\u8fdb\u53bb\u3002<\/p>\n<h3>3. \u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u4fee\u6539<code>config.yaml<\/code>\u6587\u4ef6\u4e2d\u7684\u5404\u9879\u53c2\u6570\u3002\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u51e0\u4e2a\u5e38\u89c1\u7684\u914d\u7f6e\u793a\u4f8b\uff1a<\/p>\n<ul>\n<li>\n<p><strong>\u57fa\u7840Vmess\u914d\u7f6e<\/strong>\uff1a yaml outbounds:<\/p>\n<ul>\n<li>protocol: vmess settings: vnext: \u2013 address: example.com port: 10086 users: \u2013 id: your-uuid alterId: 64<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>HTTP\u4ee3\u7406\u914d\u7f6e<\/strong>\uff1a yaml inbounds:<\/p>\n<ul>\n<li>port: 8080 protocol: http<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>4. \u542f\u52a8V2Ray<\/h3>\n<p>\u914d\u7f6e\u6587\u4ef6\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8V2Ray\uff1a bash v2ray -config \/etc\/v2ray\/config.yaml<\/p>\n<h2>V2Ray YAML\u914d\u7f6e\u7684\u5e38\u89c1\u95ee\u9898<\/h2>\n<h3>Q1: \u5982\u4f55\u751f\u6210UUID\uff1f<\/h3>\n<p>UUID\u662fV2Ray\u914d\u7f6e\u4e2d\u7684\u91cd\u8981\u53c2\u6570\u3002\u53ef\u4ee5\u4f7f\u7528\u5728\u7ebf\u5de5\u5177\u6216\u547d\u4ee4\u884c\u5de5\u5177\u751f\u6210UUID\u3002\u4f8b\u5982\uff0c\u5728Linux\u6216Mac\u4e2d\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a bash cat \/proc\/sys\/kernel\/random\/uuid<\/p>\n<h3>Q2: V2Ray\u652f\u6301\u54ea\u4e9b\u534f\u8bae\uff1f<\/h3>\n<p>V2Ray\u652f\u6301\u591a\u79cd\u534f\u8bae\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\uff1a<\/p>\n<ul>\n<li>vmess<\/li>\n<li>vless<\/li>\n<li>shadowsocks<\/li>\n<li>socks<\/li>\n<li>http<\/li>\n<\/ul>\n<h3>Q3: \u5982\u4f55\u8c03\u8bd5V2Ray\u914d\u7f6e\uff1f<\/h3>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u8c03\u8bd5\u914d\u7f6e\uff1a<\/p>\n<ul>\n<li>\u67e5\u770bV2Ray\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u901a\u5e38\u5728<code>\/var\/log\/v2ray\/<\/code>\u76ee\u5f55\u4e0b\u3002<\/li>\n<li>\u4f7f\u7528\u547d\u4ee4\u884c\u9009\u9879<code>-test<\/code>\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u662f\u5426\u6709\u6548\uff1a bash v2ray -test -config \/etc\/v2ray\/config.yaml<\/li>\n<\/ul>\n<h3>Q4: V2Ray\u914d\u7f6e\u6587\u4ef6\u7684\u683c\u5f0f\u6709\u4ec0\u4e48\u6ce8\u610f\u4e8b\u9879\uff1f<\/h3>\n<p>\u5728YAML\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u683c\u5f0f\u5fc5\u987b\u9075\u5faa\u4e25\u683c\u7684\u7f29\u8fdb\u89c4\u5219\u3002\u786e\u4fdd\u4f7f\u7528\u7a7a\u683c\u800c\u975e\u5236\u8868\u7b26\uff0c\u5e76\u4fdd\u6301\u4e00\u81f4\u7684\u7f29\u8fdb\u5c42\u6b21\u3002<\/p>\n<h2>\u7ed3\u8bba<\/h2>\n<p>\u672c\u6587\u5168\u9762\u4ecb\u7ecd\u4e86V2Ray\u7684YAML\u914d\u7f6e\u6587\u4ef6\uff0c\u5305\u62ec\u5176\u57fa\u672c\u7ed3\u6784\u3001\u914d\u7f6e\u6b65\u9aa4\u4ee5\u53ca\u5e38\u89c1\u95ee\u9898\u3002\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u5185\u5bb9\uff0c\u7528\u6237\u53ef\u4ee5\u7075\u6d3b\u5730\u914d\u7f6eV2Ray\u4ee5\u6ee1\u8db3\u4e2a\u4eba\u7684\u7f51\u7edc\u9700\u6c42\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528V2Ray\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>V2Ray\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7f51\u7edc\u4ee3\u7406\u5de5\u5177\uff0c\u5e38\u7528\u4e8e\u7ffb\u5899\u548c\u79d1\u5b66\u4e0a\u7f51\u3002\u672c\u6587\u5c06\u91cd\u70b9\u8ba8\u8bbaV2Ray\u7684YAML\u914d\u7f6e\u6587\u4ef6\uff0c\u5e2e\u52a9\u7528\u6237\u7406\u89e3\u5982\u4f55\u914d\u7f6eV2Ray\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u7f51\u7edc\u9700\u6c42\u3002 \u4ec0\u4e48\u662fV2Ray YAML\u914d\u7f6e\u6587\u4ef6\uff1f V2Ray\u7684\u914d\u7f6e\u6587\u4ef6\u4e3b\u8981\u4f7f\u7528YAML\u683c\u5f0f\uff0c\u5b83\u662f\u4e00\u79cd\u4eba\u7c7b\u53ef\u8bfb\u7684\u6570\u636e\u5e8f\u5217\u5316\u683c\u5f0f\uff0c\u6613\u4e8e\u7f16\u5199\u548c\u9605\u8bfb\u3002\u901a\u8fc7YAML\u6587\u4ef6\uff0c\u7528\u6237\u53ef\u4ee5\u7075\u6d3b\u5730\u914d\u7f6e\u4ee3\u7406\u7684\u5404\u4e2a\u53c2\u6570\u3002\u4e86\u89e3YAML\u914d\u7f6e\u6587\u4ef6\u7684\u7ed3\u6784\u5bf9\u4e8e\u4f7f\u7528V2Ray\u81f3\u5173\u91cd\u8981\u3002 V2Ray YAML\u914d\u7f6e\u6587\u4ef6\u7684\u57fa\u672c\u7ed3\u6784 YAML\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u5305\u542b\u51e0\u4e2a\u4e3b\u8981\u90e8\u5206\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a\u57fa\u672c\u7684\u7ed3\u6784\u793a\u4f8b\uff1a yaml outbounds: protocol: vmess settings: vnext: \u2013 address: example.com port: 10086 users: \u2013 id: uuid alterId: 64 inbounds: port: 1080 protocol: socks settings: auth: no ip: 127.0.0.1 clients: \u2013 id: uuid \u5173\u952e\u7ec4\u4ef6\u89e3\u91ca inbounds: \u5b9a\u4e49\u8fdb\u5165\u7684\u8fde\u63a5\u8bbe\u7f6e\uff0c\u4f8b\u5982\u4ee3\u7406\u7684\u7aef\u53e3\u548c\u534f\u8bae\u3002 outbounds: \u5b9a\u4e49\u51fa\u53bb\u7684\u8fde\u63a5\u8bbe\u7f6e\uff0c\u5305\u62ec\u5982\u4f55\u4e0e\u8fdc\u7a0b\u670d\u52a1\u5668\u901a\u4fe1\u3002 protocol: \u8868\u793a\u6240\u4f7f\u7528\u7684\u534f\u8bae\uff0c\u5982vmess\u6216socks\u3002 settings: \u7528\u4e8e\u6307\u5b9a\u8fde\u63a5\u7684\u8be6\u7ec6\u8bbe\u7f6e\uff0c\u5982\u76ee\u6807\u5730\u5740\u548c\u7aef\u53e3\u3002 users: \u5b9a\u4e49\u7528\u6237\u4fe1\u606f\uff0c\u5305\u62ecid\uff08UUID\uff09\u548calterId\uff08\u7528\u4e8e\u52a0\u5bc6\uff09\u3002 \u914d\u7f6eV2Ray\u7684\u6b65\u9aa4 1. \u4e0b\u8f7d\u4e0e\u5b89\u88c5V2Ray \u9996\u5148\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u4e0b\u8f7d\u5e76\u5b89\u88c5\u4e86V2Ray\u3002\u53ef\u4ee5\u4ece\u4e0b\u8f7d\u76f8\u5e94\u7684\u7248\u672c\uff0c\u5e76\u6309\u7167\u5b89\u88c5\u8bf4\u660e\u8fdb\u884c\u5b89\u88c5\u3002 2. \u521b\u5efaYAML\u914d\u7f6e\u6587\u4ef6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-54245","post","type-post","status-publish","format-standard","hentry","category-vpn"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/54245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=54245"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/54245\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=54245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=54245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=54245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}