id: 79eec160ec574095ae3ab8f31fd19087
parent_id: 
item_type: 1
item_id: d00b134f1aad4f29a1bc06be2cee16d6
item_updated_time: 1764345575094
title_diff: "[{\"diffs\":[[1,\"OpenWRT 路由配置技巧-月光博客\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":19}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>OpenWRT 路由配置技巧-月光博客</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"application-data:2525275\\\" content=\\\"6692893/s30/b5844fad-10b1-432f-950a-69647cadc067/app.yinxiang.com\\\"/>\\\r\\\n  <meta name=\\\"application-data:ANDROID_CLIP_TYPE\\\" content=\\\"article\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"12596\\\"></a>\\\r\\\n<h1>OpenWRT 路由配置技巧-月光博客</h1>\\\r\\\n\\\r\\\n<div>\\\n<span><div style=\\\"font-size: 16px\\\"><div style=\\\"color:rgb(0, 0, 0);font-size:12px;text-align:center;background:url(http://www.williamlong.info/themes/j-spring/style/j-spring/bg2.gif) 50% 0% repeat-x rgb(240, 236, 224);\\\"><div style=\\\"text-align:left;background:url(http://www.williamlong.info/themes/j-spring/style/j-spring/bgw.gif) 50% 50% repeat-y rgb(246, 244, 233);\\\"><div style=\\\"text-align:left;background:rgb(238, 234, 222);\\\"><div style=\\\"text-align:left;background:rgb(246, 244, 233);\\\"><div style=\\\"text-align:left;\\\"><div style=\\\"width:100%;clear:both;float:left;\\\"><span style=\\\"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;\\\"><a href=\\\"http://www.williamlong.info/archives/3921.html\\\" style=\\\"text-decoration:none;color:rgb(78, 10, 19);float:left;padding-right:10px;padding-bottom:5px;\\\">« Google和Adobe合作开发开源字体</a><a href=\\\"http://www.williamlong.info/archives/3923.html\\\" style=\\\"text-decoration:none;color:rgb(78, 10, 19);float:right;padding-left:10px;padding-bottom:5px;\\\">阿里巴巴称正遭遇有组织的舆论敲诈 »</a></span></div><h4 style=\\\"width:96%;margin:0px;padding:5px;font-size:12px;color:rgb(51, 51, 51);\\\"></h4><div style=\\\"float:right;margin-top:-4px;\\\"><div style=\\\"zoom:1;\\\"><h4 style=\\\"width:96%;margin:0px;padding:5px;font-size:12px;color:rgb(51, 51, 51);\\\"><a href=\\\"http://www.williamlong.info/archives/3922.html#\\\" style=\\\"text-decoration:none;color:rgb(51, 51, 51);float:left;font-size:12px;padding-left:17px;height:16px;cursor:pointer;margin:6px 6px 6px 0px;background-image:url('http://bdimg.share.baidu.com/static/api/css/url(../img/share/icons_0_16.png?v=d754dcc0.png)');background-repeat:no-repeat;background-position:0px 0px;\\\"></a><a href=\\\"http://www.williamlong.info/archives/3922.html#\\\" style=\\\"text-decoration:none;color:rgb(78, 10, 19);float:left;font-size:12px;padding-left:17px;height:16px;cursor:pointer;margin:6px 6px 6px 0px;background-image:url('http://bdimg.share.baidu.com/static/api/css/url(../img/share/icons_0_16.png?v=d754dcc0.png)');background-repeat:no-repeat;background-position:0px -52px;\\\" title=\\\"分享到QQ空间\\\"></a><a href=\\\"http://www.williamlong.info/archives/3922.html#\\\" style=\\\"text-decoration:none;color:rgb(78, 10, 19);float:left;font-size:12px;padding-left:17px;height:16px;cursor:pointer;margin:6px 6px 6px 0px;background-image:url('http://bdimg.share.baidu.com/static/api/css/url(../img/share/icons_0_16.png?v=d754dcc0.png)');background-repeat:no-repeat;background-position:0px -1612px;\\\" title=\\\"分享到微信\\\"></a><a href=\\\"http://www.williamlong.info/archives/3922.html#\\\" style=\\\"text-decoration:none;color:rgb(78, 10, 19);float:left;font-size:12px;padding-left:17px;height:16px;cursor:pointer;margin:6px 6px 6px 0px;background-image:url('http://bdimg.share.baidu.com/static/api/css/url(../img/share/icons_0_16.png?v=d754dcc0.png)');background-repeat:no-repeat;background-position:0px -104px;\\\" title=\\\"分享到新浪微博\\\"></a><a href=\\\"http://www.williamlong.info/archives/3922.html#\\\" style=\\\"text-decoration:none;color:rgb(78, 10, 19);float:left;font-size:12px;padding-left:17px;height:16px;cursor:pointer;margin:6px 6px 6px 0px;background-image:url('http://bdimg.share.baidu.com/static/api/css/url(../img/share/icons_0_16.png?v=d754dcc0.png)');background-repeat:no-repeat;background-position:0px -260px;\\\" title=\\\"分享到腾讯微博\\\"></a><span style=\\\"visibility:hidden;display:block;height:0px;clear:both;\\\">.</span> 2014-7-17 17:47:36</h4></div></div><h1 style=\\\"width:96%;padding:4px 0px 4px 10px;margin:2px 0px;font-size:14px;color:rgb(40, 66, 89);border-top-width:1px;border-top-style:dashed;border-top-color:rgb(145, 137, 91);border-left-width:3px;border-left-style:solid;border-left-color:rgb(145, 137, 91);border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(145, 137, 91);\\\">OpenWRT 路由配置技巧</h1><div style=\\\"width:96%;margin:0px;padding:0px 0px 0px 5px;font-size:14px;word-break:break-all;text-align:left;\\\"><a href=\\\"http://www.williamlong.info/cat/?tags=Software\\\" rel=\\\"tag\\\" style=\\\"text-decoration:underline;color:rgb(78, 10, 19);\\\"><img src=\\\":/e972d83d27b24fb79ff6e41a0d60c4a5\\\" type=\\\"image/gif\\\" data-filename=\\\"Image.gif\\\" alt=\\\"软件\\\" height=\\\"0\\\" style=\\\"cursor: default;\\\" width=\\\"0\\\"/></a><div style=\\\"float:left;margin-top:10px;margin-right:10px;\\\"><ins style=\\\"display:inline-block;width:300px;height:250px;\\\"><ins style=\\\"display:inline-table;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:300px;background-color:transparent;\\\"><ins style=\\\"display:block;border:none;height:250px;margin:0;padding:0;position:relative;visibility:visible;width:300px;background-color:transparent;\\\"><div style=\\\"left:0;position:absolute;top:0;\\\"><ins style=\\\"display:inline-block;width:300px;height:250px;\\\"></ins></div></ins></ins></ins></div><div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　随着最近 Google 在国内已经完全无法访问，使得通过 VPN 访问网络的需求更加强烈，本文介绍的方法可以使一个普通的路由具备稳定连接 VPN 的能力，并能够根据目标访问网站选择国内外线路，从而得到一个既没有限制，也不会影响速度的 Wifi 环境，连接到这个网络的设备不需要任何配置即可安全上网，完全感觉不到任何不便。</p><h3 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:5px 0px;font-size:14px;font-weight:bold;border-top-width:1px;border-top-style:dotted;border-top-color:rgb(192, 192, 192);border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(192, 192, 192);\\\">　　chnroutes 路由表</h3><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　这个路由表集中了所有分配到中国大陆的 IP 段，根据 http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest 每天自动更新，可使得在访问国内地址时不经过 VPN。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　想想如果能够让家里的路由直接连接 VPN，在家连接 WiFi 的所有设备直接达到Fan墙的效果，应该很 Cool，所以最近在某宝整了一个 Netgear WNDR3800 二手路由回来，先后分别在 DD-WRT 和 OpenWRT 成功配置 VPN + chnroutes，最后还是选择了 OpenWRT。</p><h3 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:5px 0px;font-size:14px;font-weight:bold;border-top-width:1px;border-top-style:dotted;border-top-color:rgb(192, 192, 192);border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(192, 192, 192);\\\">　　DD-WRT vs OpenWRT</h3><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　关于 DD-WRT 和 OpenWRT，我选择 OpenWRT 主要因为 DD-WRT ROM 中集成的软件太多，绝大多数用不到，要配置 jffs2 来保存脚本文件，一般配置则保存在nvram中，而且无线较不稳定，5G频段常搜索不到（当然可能是我这个路由器型号的支持问题）。OpenWRT 的配置文件语法统一，配置都存储在文件系统中，且 ROM 本身仅集成了必备组件，非常小，可以只安装需要的东西，WEB管理界面也是可选安装，简洁强大，经过若干天的使用一直比较稳定。</p><h4 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:0px;font-size:12px;\\\"> </h4><h3 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:5px 0px;font-size:14px;font-weight:bold;border-top-width:1px;border-top-style:dotted;border-top-color:rgb(192, 192, 192);border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(192, 192, 192);\\\">　　配置</h3><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　已配置好 OpenWRT 上网的童鞋们可以直接跳过<span style=\\\"color:#ff0000;\\\"> </span><strong>1.刷 ROM</strong> 和 <strong>2.初始配置</strong></p><h5 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:0px;font-size:11px;\\\">　　1.刷 ROM</h5><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　a.首先确定你的设备可以被 OpenWRT 所支持（到这里查看支持的设备列表：http://wiki.openwrt.org/toh/start），然后到这里下载编译好的 ROM：http://downloads.openwrt.org/ 。最新的 stable 版本是 attitude_adjustment(12.09)，我下载的是 trunk 版本。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　b.在 OpenWRT 官网找相应设备的 Wiki 页面查看刷机方法，一般都是在路由器官方Web固件升级页面直接刷入（我的 WNDR3800 Wiki页面是：http://wiki.openwrt.org/toh/netgear/wndr3800）</p><h5 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:0px;font-size:11px;\\\">　　2.初始配置</h5><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　a.路由器启动后，有的型号没有安装 Wifi 模块，需要先用网线连接到 LAN 口，本机 IP 配置为静态 192.168.1.x，然后 telnet 到 192.168.1.1，更改 root 密码，然后 ssh 连入，参考：http://wiki.openwrt.org/doc/start#configuring.openwrt</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;text-align:center;\\\"><a href=\\\"http://www.williamlong.info/upload/3922_1b.jpg\\\" style=\\\"text-decoration:underline;color:rgb(78, 10, 19);\\\" target=\\\"_blank\\\"><img src=\\\":/c354c9c199f6417c97ff2d46870ac2e1\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" alt=\\\"OpenWRT 路由配置 PPTP VPN + 断线自动重连 + chnroutes国内路由表\\\" border=\\\"0\\\" height=\\\"0\\\" style=\\\"cursor: default;\\\" width=\\\"0\\\"/></a></p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　b.配置 WAN 口，让路由连上 Internet，参考：http://wiki.openwrt.org/doc/howto/internet.connection 。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　比如要配置 PPPoE：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nuci set network.wan.proto=pppoe<br/>uci set network.wan.username=<span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">yougotthisfromyour@isp.su</span><span style=\\\"color:#800000;\\\">'</span><br/>uci set network.wan.password=<span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">yourpassword</span><span style=\\\"color:#800000;\\\">'</span><br/>uci commit network<br/>ifup wan\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\"> <br/>\\\n　　c.安装 LuCI Web 管理界面并设置开机自动启动，参考：http://wiki.openwrt.org/doc/howto/luci.essentials</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nopkg update<br/>opkg <span style=\\\"color:#0000ff;\\\">install</span> luci<br/>/etc/init.d/uhttpd start<br/>/etc/init.d/uhttpd enable\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\"> <br/>\\\n　　d.浏览器输入路由器 LAN 侧 IP（多为192.168.1.1），进行 Wifi 等配置</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;text-align:center;\\\"><a href=\\\"http://www.williamlong.info/upload/3922_2b.jpg\\\" style=\\\"text-decoration:underline;color:rgb(78, 10, 19);\\\" target=\\\"_blank\\\"><img src=\\\":/6a083c277c0b43ce92ab5ecfd98523e3\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" alt=\\\"OpenWRT 路由配置 PPTP VPN + 断线自动重连 + chnroutes国内路由表\\\" border=\\\"0\\\" height=\\\"0\\\" style=\\\"cursor: default;\\\" width=\\\"0\\\"/></a></p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;text-align:center;\\\"><a href=\\\"http://www.williamlong.info/upload/3922_3b.jpg\\\" style=\\\"text-decoration:underline;color:rgb(78, 10, 19);\\\" target=\\\"_blank\\\"><img src=\\\":/c358dd69c0dc4e719ae04ffa87801ed2\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" alt=\\\"OpenWRT 路由配置 PPTP VPN + 断线自动重连 + chnroutes国内路由表\\\" border=\\\"0\\\" height=\\\"0\\\" style=\\\"cursor: default;\\\" width=\\\"0\\\"/></a></p><h5 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:0px;font-size:11px;\\\">　　3.配置 DNS</h5><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　a.创建 /etc/config/sec_resolv.conf</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nvim /etc/config/sec_resolv.conf\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　填入以下 DNS Servers:</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nnameserver <span style=\\\"color:#800080;\\\">8.8</span>.<span style=\\\"color:#800080;\\\">8.8</span><span style=\\\"color:#000000;\\\"><br/>nameserver </span><span style=\\\"color:#800080;\\\">8.8</span>.<span style=\\\"color:#800080;\\\">4.4</span><span style=\\\"color:#000000;\\\"><br/>nameserver </span><span style=\\\"color:#800080;\\\">208.67</span>.<span style=\\\"color:#800080;\\\">222.222</span></pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\"><br/>\\\n　　b.编辑 /etc/config/dhcp</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nvim /etc/config/dhcp\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　找到 option resolvfile 选项，替换为：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\noption resolvfile <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">/etc/config/sec_resolv.conf</span><span style=\\\"color:#800000;\\\">'</span></pre></div><h5 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:0px;font-size:11px;\\\">　　4.配置 PPTP</h5><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　a.安装 ppp-mod-pptp</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre><span style=\\\"color:#000000;\\\">opkg updateopkg </span><span style=\\\"color:#0000ff;\\\">install</span> ppp-mod-pptp\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">  <br/>\\\n　　如果需要 LuCI 支持（推荐）：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nopkg <span style=\\\"color:#0000ff;\\\">install</span> luci-proto-ppp\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">  <br/>\\\n　　b.配置 vpn 接口，编辑 /etc/config/network 文件，应该已经有以下内容（如果没有，需要插入），并配置里面的 server、username 和 password：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nconfig <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">interface</span><span style=\\\"color:#800000;\\\">'</span> <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">vpn</span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#000000;\\\"> <br/>        option </span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">ifname</span><span style=\\\"color:#800000;\\\">'</span>    <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">pptp-vpn</span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#000000;\\\">  <br/>        option </span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">proto</span><span style=\\\"color:#800000;\\\">'</span>     <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">pptp</span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#000000;\\\"><br/>        option </span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">username</span><span style=\\\"color:#800000;\\\">'</span>  <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">vpnusername</span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#000000;\\\"><br/>        option </span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">password</span><span style=\\\"color:#800000;\\\">'</span>  <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">vpnpassword</span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#000000;\\\"><br/>        option </span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">server</span><span style=\\\"color:#800000;\\\">'</span>    <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">vpn.example.org or ipaddress</span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#000000;\\\"> <br/>        option </span><span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">buffering</span><span style=\\\"color:#800000;\\\">'</span> <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">1</span><span style=\\\"color:#800000;\\\">'</span> \\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">   <br/>\\\n　　c.进入 Network -&gt; Firewall ，把 vpn 加入 wan zone，效果如图：</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;text-align:center;\\\"><a href=\\\"http://www.williamlong.info/upload/3922_4b.jpg\\\" style=\\\"text-decoration:underline;color:rgb(78, 10, 19);\\\" target=\\\"_blank\\\"><img src=\\\":/5ee0dc75862b4a52832cff197f4eebaf\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" border=\\\"0\\\" height=\\\"0\\\" style=\\\"cursor: default;\\\" width=\\\"0\\\"/></a>    </p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　d.进入 Network -&gt; Interfaces ，此时应该已经可以看到 VPN Interface 并可以连接，效果如图：</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;text-align:center;\\\"><a href=\\\"http://www.williamlong.info/upload/3922_5b.jpg\\\" style=\\\"text-decoration:underline;color:rgb(78, 10, 19);\\\" target=\\\"_blank\\\"><img src=\\\":/2a73ca450e874aafb6fe2d4220bcf24c\\\" type=\\\"image/jpeg\\\" data-filename=\\\"Image.jpg\\\" border=\\\"0\\\" height=\\\"0\\\" style=\\\"cursor: default;\\\" width=\\\"0\\\"/></a> </p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">    </p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　e.此时在本机 traceroute www.google.com，应该能得到类似以下的结果：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nFL-MBP:~<span style=\\\"color:#000000;\\\"> fatlyz$ traceroute www.google.com <br/>traceroute: Warning: www.google.com has multiple addresses; using </span><span style=\\\"color:#800080;\\\">74.125</span>.<span style=\\\"color:#800080;\\\">239.113</span><span style=\\\"color:#000000;\\\"> <br/>traceroute to www.google.com (</span><span style=\\\"color:#800080;\\\">74.125</span>.<span style=\\\"color:#800080;\\\">239.113</span>), <span style=\\\"color:#800080;\\\">64</span> hops max, <span style=\\\"color:#800080;\\\">52</span> <span style=\\\"color:#0000ff;\\\">byte</span><span style=\\\"color:#000000;\\\"> packets<br/> </span><span style=\\\"color:#800080;\\\">1</span>  fc_r0.lan (<span style=\\\"color:#800080;\\\">192.168</span>.<span style=\\\"color:#800080;\\\">7.1</span>)  <span style=\\\"color:#800080;\\\">2.266</span> ms  <span style=\\\"color:#800080;\\\">0.999</span> ms  <span style=\\\"color:#800080;\\\">0.946</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">2</span>  <span style=\\\"color:#800080;\\\">10.7</span>.<span style=\\\"color:#800080;\\\">0.1</span> (<span style=\\\"color:#800080;\\\">10.7</span>.<span style=\\\"color:#800080;\\\">0.1</span>)  <span style=\\\"color:#800080;\\\">189.259</span> ms  <span style=\\\"color:#800080;\\\">187.813</span> ms  <span style=\\\"color:#800080;\\\">188.368</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">3</span>  <span style=\\\"color:#800080;\\\">23.92</span>.<span style=\\\"color:#800080;\\\">24.2</span> (<span style=\\\"color:#800080;\\\">23.92</span>.<span style=\\\"color:#800080;\\\">24.2</span>)  <span style=\\\"color:#800080;\\\">189.847</span> ms  <span style=\\\"color:#800080;\\\">190.489</span> ms  <span style=\\\"color:#800080;\\\">188.939</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">4</span>  10ge7-<span style=\\\"color:#800080;\\\">6</span>.core3.fmt2.he.net (<span style=\\\"color:#800080;\\\">65.49</span>.<span style=\\\"color:#800080;\\\">10.217</span>)  <span style=\\\"color:#800080;\\\">188.508</span> ms  <span style=\\\"color:#800080;\\\">192.216</span> ms  <span style=\\\"color:#800080;\\\">202.863</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">5</span>  10ge10-<span style=\\\"color:#800080;\\\">1</span>.core1.sjc2.he.net (<span style=\\\"color:#800080;\\\">184.105</span>.<span style=\\\"color:#800080;\\\">222.14</span>)  <span style=\\\"color:#800080;\\\">195.695</span> ms  <span style=\\\"color:#800080;\\\">195.691</span> ms  <span style=\\\"color:#800080;\\\">284.242</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">6</span>  <span style=\\\"color:#800080;\\\">72.14</span>.<span style=\\\"color:#800080;\\\">219.161</span> (<span style=\\\"color:#800080;\\\">72.14</span>.<span style=\\\"color:#800080;\\\">219.161</span>)  <span style=\\\"color:#800080;\\\">189.196</span> ms  <span style=\\\"color:#800080;\\\">192.287</span> ms  <span style=\\\"color:#800080;\\\">193.220</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">7</span>  <span style=\\\"color:#800080;\\\">216.239</span>.<span style=\\\"color:#800080;\\\">49.170</span> (<span style=\\\"color:#800080;\\\">216.239</span>.<span style=\\\"color:#800080;\\\">49.170</span>)  <span style=\\\"color:#800080;\\\">192.496</span> ms  <span style=\\\"color:#800080;\\\">188.547</span> ms  <span style=\\\"color:#800080;\\\">189.881</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">8</span>  <span style=\\\"color:#800080;\\\">66.249</span>.<span style=\\\"color:#800080;\\\">95.29</span> (<span style=\\\"color:#800080;\\\">66.249</span>.<span style=\\\"color:#800080;\\\">95.29</span>)  <span style=\\\"color:#800080;\\\">190.125</span> ms  <span style=\\\"color:#800080;\\\">190.335</span> ms  <span style=\\\"color:#800080;\\\">190.026</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">9</span>  nuq05s01-<span style=\\\"color:#0000ff;\\\">in</span>-f17.1e100.net (<span style=\\\"color:#800080;\\\">74.125</span>.<span style=\\\"color:#800080;\\\">239.113</span>)  <span style=\\\"color:#800080;\\\">189.804</span> ms  <span style=\\\"color:#800080;\\\">190.556</span> ms  <span style=\\\"color:#800080;\\\">190.242</span> ms\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　可以看出，其中第二跳是 VPN 的网关，而 traceroute www.baidu.com 的话第二跳应该也是同样的结果。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　这时已经可以访问 Google, Baidu 等国内外的站点了。</p><h5 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:0px;font-size:11px;\\\">　　5.配置 chnroutes</h5><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　a.到 chnroutes 项目的下载页面：http://chnroutes-dl.appspot.com/ 下载 linux.zip，解压</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　b.把 ip-pre-up 重命名为 chnroutes.sh，打开编辑，在 <strong>if [ ! -e /tmp/vpn_oldgw ]; then</strong> 前插入以下代码，以避免 ppp 连接脚本重复执行导致重复添加路由表项：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre><span style=\\\"color:#0000ff;\\\">if</span> [ $OLDGW == <span style=\\\"color:#800000;\\\">'</span><span style=\\\"color:#800000;\\\">x.x.x.x</span><span style=\\\"color:#800000;\\\">'</span> ]; <span style=\\\"color:#0000ff;\\\">then</span><span style=\\\"color:#000000;\\\">    exit </span><span style=\\\"color:#800080;\\\">0</span><br/><span style=\\\"color:#0000ff;\\\">fi</span></pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　其中 x.x.x.x 是 VPN 的网关，可以先本机连接上去之后查看一下网关地址。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　c.ssh 连接到路由器，执行以下命令：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\ncd /etc/config/<br/><span style=\\\"color:#0000ff;\\\">mkdir</span> pptp-vpn<br/>cd pptp-vpn<br/>vim chnroutes.sh\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　在 vim 中把编辑好的 chnroutes.sh 粘贴进去（当然也可以通过 ssh 直接把 chnroutes.sh 文件传过去，或者上传到某个地方再 wget 下载）</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　执行以下命令，设置权限为可执行： </p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre><span style=\\\"color:#0000ff;\\\">chmod</span> a+x chnroutes.<span style=\\\"color:#0000ff;\\\">sh</span></pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　d.用 vim 编辑 /lib/netifd/ppp-up 文件：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nvim /lib/netifd/ppp-up\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　在 <strong>[ -d /etc/ppp/ip-up.d ] &amp;&amp; {</strong> 这一行前插入以下内容，确保 ppp 连接脚本能够被执行：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre><span style=\\\"color:#0000ff;\\\">sh</span> /etc/config/pptp-vpn/chnroutes.<span style=\\\"color:#0000ff;\\\">sh</span></pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\"><br/>\\\n　　e.重启路由，启动好之后，进入 LuCI 查看接口状态，等 WAN 和 VPN 都连接成功后，ssh进去，执行 <strong>route -n | head -n 10</strong> ，效果应该类似这样：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nroot@FC_R0:/etc/config# route -n | <span style=\\\"color:#0000ff;\\\">head</span> -n <span style=\\\"color:#800080;\\\">10</span><span style=\\\"color:#000000;\\\"> <br/>Kernel IP routing table <br/>Destination     Gateway         Genmask         Flags Metric Ref    Use Iface <br/></span><span style=\\\"color:#800080;\\\">0.0</span>.<span style=\\\"color:#800080;\\\">0.0</span>         <span style=\\\"color:#800080;\\\">10.7</span>.<span style=\\\"color:#800080;\\\">0.1</span>      <span style=\\\"color:#800080;\\\">0.0</span>.<span style=\\\"color:#800080;\\\">0.0</span>         UG    <span style=\\\"color:#800080;\\\">0</span>      <span style=\\\"color:#800080;\\\">0</span>        <span style=\\\"color:#800080;\\\">0</span> pptp-<span style=\\\"color:#000000;\\\">vpn <br/></span><span style=\\\"color:#800080;\\\">1.0</span>.<span style=\\\"color:#800080;\\\">1.0</span>         <span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span>   <span style=\\\"color:#800080;\\\">255.255</span>.<span style=\\\"color:#800080;\\\">255.0</span>   UG    <span style=\\\"color:#800080;\\\">0</span>      <span style=\\\"color:#800080;\\\">0</span>        <span style=\\\"color:#800080;\\\">0</span> pppoe-<span style=\\\"color:#000000;\\\">wan <br/></span><span style=\\\"color:#800080;\\\">1.0</span>.<span style=\\\"color:#800080;\\\">2.0</span>         <span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span>   <span style=\\\"color:#800080;\\\">255.255</span>.<span style=\\\"color:#800080;\\\">254.0</span>   UG    <span style=\\\"color:#800080;\\\">0</span>      <span style=\\\"color:#800080;\\\">0</span>        <span style=\\\"color:#800080;\\\">0</span> pppoe-<span style=\\\"color:#000000;\\\">wan <br/></span><span style=\\\"color:#800080;\\\">1.0</span>.<span style=\\\"color:#800080;\\\">8.0</span>         <span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span>   <span style=\\\"color:#800080;\\\">255.255</span>.<span style=\\\"color:#800080;\\\">248.0</span>   UG    <span style=\\\"color:#800080;\\\">0</span>      <span style=\\\"color:#800080;\\\">0</span>        <span style=\\\"color:#800080;\\\">0</span> pppoe-<span style=\\\"color:#000000;\\\">wan <br/></span><span style=\\\"color:#800080;\\\">1.0</span>.<span style=\\\"color:#800080;\\\">32.0</span>        <span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span>   <span style=\\\"color:#800080;\\\">255.255</span>.<span style=\\\"color:#800080;\\\">224.0</span>   UG    <span style=\\\"color:#800080;\\\">0</span>      <span style=\\\"color:#800080;\\\">0</span>        <span style=\\\"color:#800080;\\\">0</span> pppoe-<span style=\\\"color:#000000;\\\">wan <br/></span><span style=\\\"color:#800080;\\\">1.1</span>.<span style=\\\"color:#800080;\\\">0.0</span>         <span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span>   <span style=\\\"color:#800080;\\\">255.255</span>.<span style=\\\"color:#800080;\\\">255.0</span>   UG    <span style=\\\"color:#800080;\\\">0</span>      <span style=\\\"color:#800080;\\\">0</span>        <span style=\\\"color:#800080;\\\">0</span> pppoe-<span style=\\\"color:#000000;\\\">wan <br/></span><span style=\\\"color:#800080;\\\">1.1</span>.<span style=\\\"color:#800080;\\\">2.0</span>         <span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span>   <span style=\\\"color:#800080;\\\">255.255</span>.<span style=\\\"color:#800080;\\\">254.0</span>   UG    <span style=\\\"color:#800080;\\\">0</span>      <span style=\\\"color:#800080;\\\">0</span>        <span style=\\\"color:#800080;\\\">0</span> pppoe-<span style=\\\"color:#000000;\\\">wan <br/></span><span style=\\\"color:#800080;\\\">1.1</span>.<span style=\\\"color:#800080;\\\">4.0</span>         <span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span>   <span style=\\\"color:#800080;\\\">255.255</span>.<span style=\\\"color:#800080;\\\">252.0</span>   UG    <span style=\\\"color:#800080;\\\">0</span>      <span style=\\\"color:#800080;\\\">0</span>        <span style=\\\"color:#800080;\\\">0</span> pppoe-wan\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　其中 Destination 为 0.0.0.0 的是默认路由，网关为 VPN 网关，意味着默认流量都经过 VPN，而以下的条目则把目的为国内的网段都指向了 ISP 提供的网关。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　至此 PPTP VPN 和 chnroutes 已经配置完毕。</p><h5 style=\\\"color:rgb(0, 0, 0);margin:0px;padding:0px;font-size:11px;\\\">　　6.配置 VPN 断线自动重连</h5><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　a.创建 /etc/config/pptp-vpn/status-check.sh：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nvim /etc/config/pptp-vpn/status-check.<span style=\\\"color:#0000ff;\\\">sh</span></pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　在 vim 中粘贴以下内容（此脚本检测 VPN 连接状态，并在断线后会断开 WAN 和 VPN 接口，10秒后重新连接 WAN，并在 30 秒后重连 VPN）：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\n#!/bin/<span style=\\\"color:#0000ff;\\\">sh</span><br/><span style=\\\"color:#0000ff;\\\">if</span> [ -f <span style=\\\"color:#800000;\\\">&quot;</span><span style=\\\"color:#800000;\\\">/tmp/vpn_status_check.lock</span><span style=\\\"color:#800000;\\\">&quot;</span><span style=\\\"color:#000000;\\\"> ]<br/></span><span style=\\\"color:#0000ff;\\\">then</span><span style=\\\"color:#000000;\\\"><br/>        exit </span><span style=\\\"color:#800080;\\\">0</span><br/><span style=\\\"color:#0000ff;\\\">fi</span><span style=\\\"color:#000000;\\\"><br/>VPN_CONN</span>=`<span style=\\\"color:#0000ff;\\\">ifconfig</span> | <span style=\\\"color:#0000ff;\\\">grep</span> pptp-<span style=\\\"color:#000000;\\\">vpn`<br/></span><span style=\\\"color:#0000ff;\\\">if</span> [ -z <span style=\\\"color:#800000;\\\">&quot;</span><span style=\\\"color:#800000;\\\">$VPN_CONN</span><span style=\\\"color:#800000;\\\">&quot;</span><span style=\\\"color:#000000;\\\"> ]<br/></span><span style=\\\"color:#0000ff;\\\">then</span><br/>        <span style=\\\"color:#0000ff;\\\">touch</span> /tmp/<span style=\\\"color:#000000;\\\">vpn_status_check.lock<br/>        </span><span style=\\\"color:#0000ff;\\\">echo</span> WAN_VPN_RECONNECT at: &gt;&gt; /tmp/<span style=\\\"color:#000000;\\\">vpn_status_check_reconn.log<br/>        </span><span style=\\\"color:#0000ff;\\\">date</span> &gt;&gt; /tmp/<span style=\\\"color:#000000;\\\">vpn_status_check_reconn.log<br/>        ifdown vpn<br/>        ifdown wan<br/>        </span><span style=\\\"color:#0000ff;\\\">sleep</span> <span style=\\\"color:#800080;\\\">10</span><span style=\\\"color:#000000;\\\"><br/>        ifup wan<br/>        </span><span style=\\\"color:#0000ff;\\\">sleep</span> <span style=\\\"color:#800080;\\\">30</span><span style=\\\"color:#000000;\\\"><br/>        ifdown vpn<br/>        </span><span style=\\\"color:#0000ff;\\\">sleep</span> <span style=\\\"color:#800080;\\\">10</span><span style=\\\"color:#000000;\\\"><br/>        ifup vpn<br/>        </span><span style=\\\"color:#0000ff;\\\">sleep</span> <span style=\\\"color:#800080;\\\">40</span><br/>        <span style=\\\"color:#0000ff;\\\">rm</span> /tmp/<span style=\\\"color:#000000;\\\">vpn_status_check.lock<br/></span><span style=\\\"color:#0000ff;\\\">else</span><br/>        <span style=\\\"color:#0000ff;\\\">date</span> &gt; /tmp/<span style=\\\"color:#000000;\\\">vpn_status_check.log<br/></span><span style=\\\"color:#0000ff;\\\">fi</span></pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　执行以下命令，设置权限为可执行： </p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre><span style=\\\"color:#0000ff;\\\">chmod</span> a+x /etc/config/pptp-vpn/status-check.<span style=\\\"color:#0000ff;\\\">sh</span></pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　b.进入LuCI 的 System -&gt; Scheduled Tasks 填入以下内容，并保存：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\n*/<span style=\\\"color:#800080;\\\">1</span> * * * * /etc/config/pptp-vpn/status-check.<span style=\\\"color:#0000ff;\\\">sh</span></pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　以上实际上是编辑了 cron 配置，cron 每分钟运行检测 / 重连脚本，重启 cron：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\n/etc/init.d/cron restart\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\"><br/>\\\n　　c.静待几分钟，查看 /tmp 目录，应该能看到 vpn_oldgw 和 vpn_status_check.log 文件，查看 vpn_status_check.log 文件，可以看到最近一次检测 VPN 连接状态的时间。</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nroot@FC_R0:/tmp# <span style=\\\"color:#0000ff;\\\">ls</span> vpn*<span style=\\\"color:#000000;\\\"><br/>vpn_oldgw             vpn_status_check.log<br/>root@FC_R0:</span>/tmp# <span style=\\\"color:#0000ff;\\\">cat</span><span style=\\\"color:#000000;\\\"> vpn_status_check.log <br/>Tue Jul </span><span style=\\\"color:#800080;\\\">15</span> <span style=\\\"color:#800080;\\\">00</span>:<span style=\\\"color:#800080;\\\">04</span>:<span style=\\\"color:#800080;\\\">02</span> HKT <span style=\\\"color:#800080;\\\">2014</span><span style=\\\"color:#000000;\\\"><br/>root@FC_R0:</span>/tmp# \\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　你可以在 LuCI 中断开 VPN 接口，在接下来的4-5分钟，观察 WAN 和 VPN 的重连情况。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　d.分别 traceroute www.google.com 和 www.baidu.com ，观察第二跳的地址：</p><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nFL-MBP:~ fatlyz$ traceroute www.google.com | <span style=\\\"color:#0000ff;\\\">head</span> -n <span style=\\\"color:#800080;\\\">3</span><span style=\\\"color:#000000;\\\"><br/>traceroute: Warning: www.google.com has multiple addresses; using </span><span style=\\\"color:#800080;\\\">74.125</span>.<span style=\\\"color:#800080;\\\">239.115</span><span style=\\\"color:#000000;\\\"><br/>traceroute to www.google.com (</span><span style=\\\"color:#800080;\\\">74.125</span>.<span style=\\\"color:#800080;\\\">239.115</span>), <span style=\\\"color:#800080;\\\">64</span> hops max, <span style=\\\"color:#800080;\\\">52</span> <span style=\\\"color:#0000ff;\\\">byte</span><span style=\\\"color:#000000;\\\"> packets<br/> </span><span style=\\\"color:#800080;\\\">1</span>  fc_r0.lan (<span style=\\\"color:#800080;\\\">192.168</span>.<span style=\\\"color:#800080;\\\">7.1</span>)  <span style=\\\"color:#800080;\\\">2.161</span> ms  <span style=\\\"color:#800080;\\\">0.912</span> ms  <span style=\\\"color:#800080;\\\">0.895</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">2</span>  <span style=\\\"color:#800080;\\\">10.7</span>.<span style=\\\"color:#800080;\\\">0.1</span> (<span style=\\\"color:#800080;\\\">10.7</span>.<span style=\\\"color:#800080;\\\">0.1</span>)  <span style=\\\"color:#800080;\\\">193.747</span> ms  <span style=\\\"color:#800080;\\\">187.789</span> ms  <span style=\\\"color:#800080;\\\">289.744</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">3</span>  <span style=\\\"color:#800080;\\\">23.92</span>.<span style=\\\"color:#800080;\\\">24.2</span> (<span style=\\\"color:#800080;\\\">23.92</span>.<span style=\\\"color:#800080;\\\">24.2</span>)  <span style=\\\"color:#800080;\\\">259.323</span> ms  <span style=\\\"color:#800080;\\\">354.625</span> ms  <span style=\\\"color:#800080;\\\">408.535</span> ms\\\n</pre></div><div lang=\\\"asp\\\" style=\\\"width:99%;overflow:auto;padding:5px;border:1px dotted black;margin:12px 0px;background-color:rgb(231, 229, 220);\\\"><pre>\\\nFL-MBP:~ fatlyz$ traceroute www.baidu.com | <span style=\\\"color:#0000ff;\\\">head</span> -n <span style=\\\"color:#800080;\\\">3</span><span style=\\\"color:#000000;\\\"><br/>traceroute to www.a.shifen.com (</span><span style=\\\"color:#800080;\\\">180.76</span>.<span style=\\\"color:#800080;\\\">3.151</span>), <span style=\\\"color:#800080;\\\">64</span> hops max, <span style=\\\"color:#800080;\\\">52</span> <span style=\\\"color:#0000ff;\\\">byte</span><span style=\\\"color:#000000;\\\"> packets<br/> </span><span style=\\\"color:#800080;\\\">1</span>  fc_r0.lan (<span style=\\\"color:#800080;\\\">192.168</span>.<span style=\\\"color:#800080;\\\">7.1</span>)  <span style=\\\"color:#800080;\\\">1.190</span> ms  <span style=\\\"color:#800080;\\\">0.984</span> ms  <span style=\\\"color:#800080;\\\">0.731</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">2</span>  <span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span> (<span style=\\\"color:#800080;\\\">58.111</span>.<span style=\\\"color:#800080;\\\">43.1</span>)  <span style=\\\"color:#800080;\\\">20.616</span> ms  <span style=\\\"color:#800080;\\\">38.822</span> ms  <span style=\\\"color:#800080;\\\">18.484</span><span style=\\\"color:#000000;\\\"> ms<br/> </span><span style=\\\"color:#800080;\\\">3</span>  <span style=\\\"color:#800080;\\\">183.56</span>.<span style=\\\"color:#800080;\\\">35.133</span> (<span style=\\\"color:#800080;\\\">183.56</span>.<span style=\\\"color:#800080;\\\">35.133</span>)  <span style=\\\"color:#800080;\\\">20.056</span> ms  <span style=\\\"color:#800080;\\\">52.353</span> ms  <span style=\\\"color:#800080;\\\">87.841</span> ms\\\n</pre></div><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　可以看出，已成功对国内外的目标地址进行了路由选择。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　至此，OpenWRT 路由的基本配置、PPTP VPN、chnroutes 和自动重连已经配置完成。</p><p style=\\\"margin:10px 0px 15px;padding:0px;word-break:break-all;\\\">　　来源：投稿，作者：FatLYZ，<a href=\\\"http://www.cnblogs.com/fatlyz/p/3843581.html\\\" style=\\\"text-decoration:underline;color:rgb(78, 10, 19);\\\" target=\\\"_blank\\\">原文链接</a>。</p></div></div></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":37356}]"
metadata_diff: {"new":{"id":"d00b134f1aad4f29a1bc06be2cee16d6","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348822991,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:03:57.687Z
created_time: 2025-11-28T21:03:57.687Z
type_: 13