-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
85 lines (47 loc) · 19.5 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>elephantNose</title>
<link href="/atom.xml" rel="self"/>
<link href="https://elephantnose.github.io/"/>
<updated>2018-09-24T01:54:07.548Z</updated>
<id>https://elephantnose.github.io/</id>
<author>
<name>John Do</name>
</author>
<generator uri="http://hexo.io/">Hexo</generator>
<entry>
<title>10分钟教你用 Google Cloud Platform 搭建自己的VPN</title>
<link href="https://elephantnose.github.io/2018/09/24/10%E5%88%86%E9%92%9F%E6%95%99%E4%BD%A0%E7%94%A8%20Google%20Cloud%20Platform%20%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84VPN/"/>
<id>https://elephantnose.github.io/2018/09/24/10分钟教你用 Google Cloud Platform 搭建自己的VPN/</id>
<published>2018-09-24T01:30:09.000Z</published>
<updated>2018-09-24T01:54:07.548Z</updated>
<content type="html"><![CDATA[<p><a href="#准备">准备</a><br><a href="#申请并创建vm实例">申请并创建VM实例</a><br><a href="#防火墙规则">防火墙规则</a><br><a href="#vpc网络">VPC网络</a><br><a href="#负载平衡">负载平衡</a><br><a href="#登陆服务器">登陆服务器</a><br><a href="#部署vpn服务">部署VPN服务</a><br><a href="#如何连接">如何连接</a><br><a href="#如何管理vpn用户">如何管理VPN用户</a><br><a href="#可能用到的命令">可能用到的命令</a><br><a href="#注意事项">注意事项</a><br><a href="#遇到问题了">遇到问题了</a><br><a href="#如何访问谷歌站点">如何访问谷歌站点</a><br><a href="#链接">链接</a></p><hr><p>本教程以 Google Cloud Platform 为例进演示,如果你已经有国外主机仅想知道如何部署VPN,请直接跳到<a href="#jump_2_build">这里</a>开始阅读</p><hr><h2 id="准备"><a href="#准备" class="headerlink" title="准备"></a>准备</h2><ul><li><a href="#jump_2_visit_google">能够访问谷歌站点</a></li><li><a href="https://accounts.google.com/signup/v2/webcreateaccount?hl=zh-CN&flowName=GlifWebSignIn&flowEntry=SignUp" target="_blank" rel="noopener">Google 账号</a></li><li>VISA 双币信用卡</li></ul><hr><h2 id="申请并创建VM实例"><a href="#申请并创建VM实例" class="headerlink" title="申请并创建VM实例"></a>申请并创建VM实例</h2><ol><li><p>登陆 <a href="https://console.cloud.google.com/getting-started?hl=zh-CN&pli=1" target="_blank" rel="noopener">Google Cloud Platform</a> 并填写相关信息<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/1537708746.jpg" alt=""><br>如图选好各选项后点击 <code>同意并继续</code></p></li><li><p>激活奖励<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923214100.png" alt=""><br>点击 <code>免费试用</code> 或者右上角的 <code>激活</code> 按钮</p></li><li><p>创建项目<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923214342.png" alt=""><br><code>导航菜单</code> → <code>Compute Engine</code> → <code>VM实例</code><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923214714.png" alt=""><br>点击 <code>创建</code>(项目名称选填)</p></li><li><p>试用 Cloud Platform<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923215144.png" alt=""><br>点击 <code>同意并继续</code><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923215353.png" alt=""><br>按空填写信息,完成后点击 <code>开始免费试用</code><br><em>信用卡用于人机校验,注册时会暂扣$1,会自动退回至账户</em></p></li><li><p><span id="jump_2_create">创建虚拟机实例</span><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923220235.png" alt=""><br>点击 <code>创建</code></p></li><li><p><span id="jump_2_area">自定义实例配置</span><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923220637.png" alt=""><br> 填写实例 <code>名称</code><br> 选择 <code>区域</code> 及 <code>地区</code>(日本站点距离近,响应速度快)<br> <code>内核</code> 及 <code>内存</code> 选择最低配置(如还需其他服务可自行定义参数)<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923221223.png" alt=""><br>更改 <code>启动磁盘</code> 系统为 <code>Ubuntu 18.04 LTS</code><br>勾选 <code>允许 HTTP 流量</code> <code>允许 HTTPS 流量</code><br>点击 <code>创建</code><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923222007.png" alt=""></p></li></ol><hr><h2 id="防火墙规则"><a href="#防火墙规则" class="headerlink" title="防火墙规则"></a>防火墙规则</h2><ol><li><p>新建防火墙规则<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923222248.png" alt=""><br><code>导航菜单</code> → <code>VPC 网络</code> → <code>防火墙规则</code><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923222433.png" alt=""><br>点击 <code>+ 创建防火墙规则</code></p></li><li><p>自定义规则配置<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923222948.png" alt=""><br> <code>名称</code> 按规则自定义<br> <code>目标</code> <code>网络中的所有实例</code><br> <img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923223625.png" alt=""><br> <code>来源ip地址范围</code> <code>0.0.0.0/0</code><br> <code>协议和端口</code> 勾选 <code>UDP</code> 填写 <code>500,4500</code>,勾选 <code>其他协议</code> 填写 <code>esp</code><br> 点击 <code>创建</code><br> <img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923224110.png" alt=""><br> 刚刚定义好的防火墙规则</p></li></ol><hr><h2 id="VPC网络"><a href="#VPC网络" class="headerlink" title="VPC网络"></a>VPC网络</h2><ol><li>配置VPC网络<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923224443.png" alt=""><br> <code>导航菜单</code> → <code>VPC 网络</code> → <code>VPC 网络</code> → <code>default</code><br> <img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923224810.png" alt=""><br> 点击 <code>修改</code><br> <img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923224913.png" alt=""><br> 勾选 <code>自动</code> 及 <code>全局</code> 复选框<br> 点击 <code>保存</code></li></ol><hr><h2 id="负载平衡"><a href="#负载平衡" class="headerlink" title="负载平衡"></a>负载平衡</h2><ol><li>负载平衡<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923225418.png" alt=""><br> <code>导航菜单</code> → <code>网络服务</code> → <code>负载均衡</code></li><li><p>创建负载平衡器<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923225642.png" alt=""></p></li><li><p>UDP负载平衡<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923225806.png" alt=""><br> 点击 <code>开始配置</code><br> <img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923225931.png" alt=""><br> 勾选 <code>从互联网到我的VM</code>(默认)<br> 点击 <code>继续</code></p></li><li>后端配置<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923231055.png" alt=""><br> <code>名称</code> 按规则自定义填写<br> <a href="#jump_2_area">选择 <code>区域</code></a><br> <a href="#jump_2_area"><code>选择现有实例</code></a></li><li>前端配置<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923231339.png" alt=""><br> <code>名称</code> 按规则自定义填写<br> <code>端口</code> 填写<code>500-4500</code><br> 点击 <code>完成</code><br> 点击 <code>创建</code><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923231557.png" alt=""></li></ol><hr><h2 id="登陆服务器"><a href="#登陆服务器" class="headerlink" title="登陆服务器"></a>登陆服务器</h2><p><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923231801.png" alt=""><br><code>导航菜单</code> → <code>Compute Engine</code> → <code>VM实例</code><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923231937.png" alt=""><br>点击 <code>SSH</code><br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923234204.png" alt=""></p><hr><h2 id="部署VPN服务"><a href="#部署VPN服务" class="headerlink" title="部署VPN服务"></a><span id="jump_2_build">部署VPN服务</span></h2><p>执行命令<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get update && apt-get dist-upgrade</span><br></pre></td></tr></table></figure></p><p><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923232400.png" alt=""></p><p>命令行一步部署VPN服务<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">wget https://git.io/vpnsetup -O vpnsetup.sh && sudo \</span><br><span class="line">VPN_IPSEC_PSK='预分享密钥' \</span><br><span class="line">VPN_USER='用户名' \</span><br><span class="line">VPN_PASSWORD='密码' sh vpnsetup.sh</span><br></pre></td></tr></table></figure></p><p>五分钟后…<br><img src="https://raw.githubusercontent.com/elephantNose/FigureBed/master/20180923234014.png" alt=""><br>看到如上界面表示已经成功部署VPN服务,请将框内连接信息妥善保存</p><p><a href="https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/README-zh.md#%E9%87%8D%E8%A6%81%E6%8F%90%E7%A4%BA" target="_blank" rel="noopener">详细部署VPN服务教程请移步至Github</a></p><hr><h2 id="如何连接"><a href="#如何连接" class="headerlink" title="如何连接"></a>如何连接</h2><p><a href="https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-xauth-zh.md" target="_blank" rel="noopener">IPsec/XAuth VPN 客户端连接方式</a>(推荐)<br><a href="https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md" target="_blank" rel="noopener">IPsec/L2TP VPN 客户端连接方式</a><br><a href="https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/ikev2-howto-zh.md" target="_blank" rel="noopener">IKEv2连接方式</a></p><p>第一台设备连接成功后,为了保证后续设备能够正常使用VPN,建议优先阅读<a href="#jump_2_note">注意事项</a></p><hr><h2 id="如何管理VPN用户"><a href="#如何管理VPN用户" class="headerlink" title="如何管理VPN用户"></a>如何管理VPN用户</h2><p>在默认情况下,搭建好VPN服务后,将只创建一个用于 VPN 登录的用户账户。如果你需要添加,更改或者删除用户,请<a href="https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/manage-users-zh.md" target="_blank" rel="noopener">阅读此链接</a></p><hr><h2 id="可能用到的命令"><a href="#可能用到的命令" class="headerlink" title="可能用到的命令"></a>可能用到的命令</h2><ul><li><p>重启服务</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo service ipsec restart && sudo service xl2tpd restart</span><br></pre></td></tr></table></figure></li><li><p>查看连接客户端</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo ipsec whack --trafficstatus</span><br></pre></td></tr></table></figure></li><li><p>查看连接日志</p></li></ul><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tail -F /var/log/auth.log | grep pluto</span><br></pre></td></tr></table></figure><ul><li>查看服务状态<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo ipsec status</span><br><span class="line">sudo ipsec verify</span><br></pre></td></tr></table></figure></li></ul><hr><h2 id="注意事项"><a href="#注意事项" class="headerlink" title="注意事项"></a><span id="jump_2_note">注意事项</span></h2><p>本注意事项为我在使用过程当中从所遇到的问题当中整理得来,目前还未找到解决办法</p><ul><li>多台(2台及以上)设备不能通过同一路由器进行VPN连接,一个路由器只能路由一台设备连接VPN</li><li>同一账号可在多台设备上使用,但不能同时使用同一账号进行VPN连接</li></ul><hr><h2 id="遇到问题了"><a href="#遇到问题了" class="headerlink" title="遇到问题了"></a>遇到问题了</h2><p>使用过程中出现任何问题都建议优先查看此<a href="https://gist.github.com/hwdsl2/9030462" target="_blank" rel="noopener">链接</a>,该VPN作者对使用者使用过程当中所产生的问题都做出了解答,如果问题仍然没有解决,不要犹豫,删掉所有实例及配置从<a href="#jump_2_create">这里</a>再次开始吧!</p><hr><h2 id="如何访问谷歌站点"><a href="#如何访问谷歌站点" class="headerlink" title="如何访问谷歌站点"></a><span id="jump_2_visit_google">如何访问谷歌站点</span></h2><p>安装 Chrome 插件<a href="http://www.ggfwzs.com/" target="_blank" rel="noopener">谷歌访问助手</a>,如果为新版 Chrome 可能会发生安装失败,由于 Chrome 21.x 系列增加了对扩展插件安装的限制,自 Chrome 21.x 开始默认只允许从 Chrome Web Store (Chrome 网上应用店)安装扩展、应用及脚本,也就是意味着用户只能安装谷歌浏览器(Chrome Store)内的扩展插件,解决方法:</p><ol><li>右击Chrome浏览器图标选择属性,</li><li>在目标后面添加以下内容” –enable-easy-off-store-extension-install”(注:不包括前后双引号,包含空格)并保存,</li><li>重启Chrome浏览器将插件拖拽至插件区即可。</li></ol><hr><h2 id="链接"><a href="#链接" class="headerlink" title="链接"></a>链接</h2><p>参考链接:<a href="https://medium.com/@YasuoYuHao/google-cloud-platform-%E6%90%AD%E5%BB%BA%E5%80%8B%E4%BA%BAvpn-358ccdbeca40" target="_blank" rel="noopener">Google Cloud Platform 搭建個人VPN</a><br>相关链接:<a href="https://www.jianshu.com/p/05bad6912954" target="_blank" rel="noopener">Google Cloud Platform免费申请&一键搭建SSR & BBR加速教程</a></p>]]></content>
<summary type="html">
<p><a href="#准备">准备</a><br><a href="#申请并创建vm实例">申请并创建VM实例</a><br><a href="#防火墙规则">防火墙规则</a><br><a href="#vpc网络">VPC网络</a><br><a href="#负载平衡"
</summary>
<category term="谷歌云 VPN" scheme="https://elephantnose.github.io/tags/%E8%B0%B7%E6%AD%8C%E4%BA%91-VPN/"/>
</entry>
<entry>
<title></title>
<link href="https://elephantnose.github.io/2018/09/22/FirstBlog/"/>
<id>https://elephantnose.github.io/2018/09/22/FirstBlog/</id>
<published>2018-09-22T11:31:39.390Z</published>
<updated>2018-09-22T11:40:23.198Z</updated>
<content type="html"><![CDATA[<h1 id="占个位置"><a href="#占个位置" class="headerlink" title="占个位置"></a>占个位置</h1><p>等我想好了我再补充内容</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">print(<span class="string">"hello elephantNose!"</span>)</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html">
<h1 id="占个位置"><a href="#占个位置" class="headerlink" title="占个位置"></a>占个位置</h1><p>等我想好了我再补充内容</p>
<figure class="highlight python"><table><tr><t
</summary>
</entry>
<entry>
<title>Hello World</title>
<link href="https://elephantnose.github.io/2018/09/22/hello-world/"/>
<id>https://elephantnose.github.io/2018/09/22/hello-world/</id>
<published>2018-09-22T10:09:57.398Z</published>
<updated>2018-09-22T10:09:57.403Z</updated>
<content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="noopener">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="noopener">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="noopener">GitHub</a>.</p><h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="noopener">Writing</a></p><h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="noopener">Server</a></p><h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="noopener">Generating</a></p><h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="noopener">Deployment</a></p>]]></content>
<summary type="html">
<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a>! This is your very first post. Check <a href="https://hexo.
</summary>
</entry>
</feed>