2015/07/19

利用小米路由mini智能翻墙

  1. echo "200 outwall" >> /etc/iproute2/rt_tables
  2. 修改firewall.user:
    ipset create outwall  iphash -exist
    ip rule add fwmark 1 table outwall
    iptables -t mangle -I PREROUTING -m set --match-set outwall dst -j MARK --set-mark 1
  3. 修改/etc/ppp/vpnup.sh:
    #!/bin/sh
    vpn_rule_ids=`ip rule list | grep 'lookup vpn' | sed 's/://g' | awk '{print $1}'`
    for rule_id in $vpn_rule_ids
    do
            ip ru del prio $rule_id
    done
    ip route add default dev pptp-vpn table outwall
  4. 修改/etc/ppp/ip-up.d/vpnup:
    #!/bin/sh
    export PATH="/bin:/sbin:/usr/sbin:/usr/bin"
    VPNGW=`ip route show | grep '^default' | grep 'pptp-vpn' | sed -e 's/default via \([^ ]*\).*/\1/ ' | head -1`
    if [ $VPNGW == '' ]; then
        exit 0
        fi
    if [ ! -e /tmp/vpngw ]; then
        echo $VPNGW >> /tmp/vpngw
        fi
    route del default gw $VPNGW
    route add -host 8.8.8.8 gw $VPNGW
  5.  执行:
    chmod a-x /etc/ppp/ppp.d/vpn-up
  6. 将下边地址下的三个文件放在/etc/dnsmasq.d/
    https://github.com/lifetyper/FreeRouter_V2/tree/master/OpenWRT/etc/dnsmasq.d
  7. 在路由器里配置vpn,名字为vpn。
  8. 重启路由器,应该可以翻墙了。
  9. 同理,在6的位置上可以搞定adblock的。
参考:
https://blog.sorz.org/p/openwrt-outwall/

2.3.51版测试通过。

2015/07/02

Twitter Daily(2015-07-01)

  • 09:50:18: 下一步准备在路由器上搞定adblock。与其被小米劫持,不如我自己劫持算了。 #

2015/07/01

Twitter Daily(2015-06-30)

  • 12:02:15: 小米路由器劫持用户浏览器事件回顾 小米路由器劫持用户浏览器事件回顾(分享自 @知乎日报 App) (url). 雷布斯改名雷不群吧。 #
  • 12:10:20: 使用我的 Uber 优惠码 xb2y2ue,即可在您的首次 Uber 乘车服务中节省 ¥30。可在(url)兑换。 #
  • 12:13:50: 一上午没上班,将小米路由器刷成openwrt了,也就意味着小米智能家居暂时不会进入我的视野了。走好。 #
  • 12:30:38: 嗯,如果你全部,身家就1万的话,会更刺激。 RT @flowerinTK: 我不大懂股票这种东西,啊是说比方我投个一万块进去,赔个血本无归也就是把本金一万亏完的意思??一万块买个跌宕起伏惊险刺激也不算太差啊亏完就亏完呗…(所以我不懂 #
  • 16:38:39: @_J_Smith @eastwoodnet openwrt可用。可以找pandorabox,最新的是6月份的,上午我刚刚刷完,正在研究智能翻墙呢。 #
  • 20:37:36: 基本搞定了在openwrt下,基于域名选择vpn通道的翻墙方式了。不过弄来弄去,只有googletwitter是常用的,其他的网站访问的几率很小。 #
  • 21:37:57: 准备给ipad2升级一下系统,发现8.3竟然要下载1.3G的更新数据。 #

Mastodon Daily(2024-03-28)

宣布对 AWS AppConfig 扩展工具的动态参数支持 ...