<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.raf.cc/index.php?action=history&amp;feed=atom&amp;title=Linux%E5%AE%89%E8%A3%85v2ray</id>
	<title>Linux安装v2ray - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.raf.cc/index.php?action=history&amp;feed=atom&amp;title=Linux%E5%AE%89%E8%A3%85v2ray"/>
	<link rel="alternate" type="text/html" href="https://wiki.raf.cc/index.php?title=Linux%E5%AE%89%E8%A3%85v2ray&amp;action=history"/>
	<updated>2026-04-15T16:06:32Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://wiki.raf.cc/index.php?title=Linux%E5%AE%89%E8%A3%85v2ray&amp;diff=459&amp;oldid=prev</id>
		<title>Admin：​创建页面，内容为“ = linux下配置V2ray作为客户端来访问GitHub、G*le等服务 = witersen • 2022年2月25日 上午12:14 • Linux, 软件资源教程 • 阅读 48693  === 1、下载安装包 ===  * 从 &lt;nowiki&gt;https://github.com/v2ray/v2ray-core/releases/tag/v4.28.2&lt;/nowiki&gt; 下载 v2ray-linux-64.zip 文件并解压 * （实际上选择合适自己机器的就行了 这里选用的是最小包 解压即用） * 可从本站点下载适用于Linux-64位的压缩包…”</title>
		<link rel="alternate" type="text/html" href="https://wiki.raf.cc/index.php?title=Linux%E5%AE%89%E8%A3%85v2ray&amp;diff=459&amp;oldid=prev"/>
		<updated>2024-04-20T01:32:13Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“ = linux下配置V2ray作为客户端来访问GitHub、G*le等服务 = witersen • 2022年2月25日 上午12:14 • Linux, 软件资源教程 • 阅读 48693  === 1、下载安装包 ===  * 从 &amp;lt;nowiki&amp;gt;https://github.com/v2ray/v2ray-core/releases/tag/v4.28.2&amp;lt;/nowiki&amp;gt; 下载 v2ray-linux-64.zip 文件并解压 * （实际上选择合适自己机器的就行了 这里选用的是最小包 解压即用） * 可从本站点下载适用于Linux-64位的压缩包…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
= linux下配置V2ray作为客户端来访问GitHub、G*le等服务 =&lt;br /&gt;
witersen • 2022年2月25日 上午12:14 • Linux, 软件资源教程 • 阅读 48693&lt;br /&gt;
&lt;br /&gt;
=== 1、下载安装包 ===&lt;br /&gt;
&lt;br /&gt;
* 从 &amp;lt;nowiki&amp;gt;https://github.com/v2ray/v2ray-core/releases/tag/v4.28.2&amp;lt;/nowiki&amp;gt; 下载 v2ray-linux-64.zip 文件并解压&lt;br /&gt;
* （实际上选择合适自己机器的就行了 这里选用的是最小包 解压即用）&lt;br /&gt;
* 可从本站点下载适用于Linux-64位的压缩包 下载&lt;br /&gt;
&lt;br /&gt;
=== 2、配置config.json文件 ===&lt;br /&gt;
&lt;br /&gt;
* 因为我们的v2ray此时是用来作为客户端工作 所以需要配置节点&lt;br /&gt;
* 节点的配置文件为 config.json&lt;br /&gt;
* 节点文件可以从v2ray的Windows客户端导出&lt;br /&gt;
&lt;br /&gt;
* 前提是我们在Windows客户端使用的v2ray已经有服务器节点可用；则此操作就是更便捷的为Linux下的v2ray客户端配置服务器节点&lt;br /&gt;
&lt;br /&gt;
* 检查配置文件 成功效果如下&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|1&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
6&lt;br /&gt;
|&amp;lt;code&amp;gt;[root@VM-8-11-centos v2]# v2ray -test -config config.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;V2Ray 4.44.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.17.3 linux/amd64)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;A unified platform for&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;anti-censorship.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;2022/02/23&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;22:23:52 [Info] main/jsonem: Reading config: config.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Configuration OK.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[root@VM-8-11-centos v2]#&amp;lt;/code&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 3、运行 ===&lt;br /&gt;
&lt;br /&gt;
* 在 Windows 和 macOS 中，配置文件通常是 V2Ray 同目录下的 config.json 文件 。直接运行 v2ray 或 v2ray.exe 即可&lt;br /&gt;
* 在 Linux 中，配置文件通常位于 /etc/v2ray/config.json 文件(非压缩包安装)。运行 v2ray –config=/etc/v2ray/config.json，或使用 systemd 等工具把 V2Ray 作为服务在后台运行&lt;br /&gt;
&lt;br /&gt;
=== 4、测试 ===&lt;br /&gt;
&lt;br /&gt;
* curl –socks5 127.0.0.1:10808 &amp;lt;nowiki&amp;gt;https://www.google.com&amp;lt;/nowiki&amp;gt; #注意是两个-&lt;br /&gt;
* 其中的 10808 端口为我们配置文件中配置的端口 每个人的可能都不相同&lt;br /&gt;
&lt;br /&gt;
=== 5、配置curl、wget等命令使用代理 ===&lt;br /&gt;
&lt;br /&gt;
==== 方法一（推荐） ====&lt;br /&gt;
&lt;br /&gt;
* 修改文件“/etc/profile”，在文件结束位置增加如下内容：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|1&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
6&lt;br /&gt;
&lt;br /&gt;
7&lt;br /&gt;
&lt;br /&gt;
8&lt;br /&gt;
&lt;br /&gt;
9&lt;br /&gt;
&lt;br /&gt;
10&lt;br /&gt;
&lt;br /&gt;
11&lt;br /&gt;
|&amp;lt;code&amp;gt;# 设置http代理&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
​&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# 设置https代理&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;https_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
​&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# 设置ftp代理&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ftp_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
​&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# 17.16.x.x为我们自己的云服务器的内网IP 配置为no_proxy代表内网传输不走代理&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;no_proxy=&amp;quot;172.16.x.x&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* 修改后重启服务器 上面的设置才会生效&lt;br /&gt;
* 或者不重启服务器 执行以下命令 使配置立即生效&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;code&amp;gt;source /etc/profile&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 方法二（在当前终端临时生效） ====&lt;br /&gt;
&lt;br /&gt;
* 使代理生效&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|1&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
|&amp;lt;code&amp;gt;export http_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export https_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export ftp_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export no_proxy=&amp;quot;172.16.x.x&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* 使代理失效&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|1&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
|&amp;lt;code&amp;gt;unset http_proxy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;unset https_proxy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;unset ftp_proxy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;unset no_proxy&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 方法三（针对单用户生效） ====&lt;br /&gt;
&lt;br /&gt;
* 编辑文件 vim ~/.bashrc 添加以下内容&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|1&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
6&lt;br /&gt;
&lt;br /&gt;
7&lt;br /&gt;
&lt;br /&gt;
8&lt;br /&gt;
&lt;br /&gt;
9&lt;br /&gt;
&lt;br /&gt;
10&lt;br /&gt;
&lt;br /&gt;
11&lt;br /&gt;
&lt;br /&gt;
12&lt;br /&gt;
|&amp;lt;code&amp;gt;# set proxy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;setproxy() {&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;   export&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;   export&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;https_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;   export&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ftp_proxy=socks5://127.0.0.1:10808&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;   export&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;no_proxy=&amp;quot;172.16.x.x&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
​&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# unset proxy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;unsetproxy() {&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;   unset&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;http_proxy https_proxy ftp_proxy no_proxy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* 保存退出&lt;br /&gt;
* 执行 source ~/.bashrc ,使得配置立即生效;&lt;br /&gt;
* 或是关闭当前终端，重新打开，使得配置立即生效;&lt;br /&gt;
* 在终端执行 setproxy 使代理生效&lt;br /&gt;
* 在终端执行 unsetproxy 使代理生效&lt;br /&gt;
&lt;br /&gt;
原创文章，作者：witersen，如若转载，请注明出处：&amp;lt;nowiki&amp;gt;https://www.witersen.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;v2ray&lt;br /&gt;
&lt;br /&gt;
svg_1.svg&lt;br /&gt;
&lt;br /&gt;
869 bytes&lt;br /&gt;
赞 (18)&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>