分类 路由器 下的文章

finally fix dualwan ss rc4-md5 issue

一开始从论坛搜出下载的ss 安装后, 总是报下面的这个问题:

root@home:/opt/etc/init.d# ss-local -c /opt/etc/shadowsocks/ss-local.json 
 2015-11-01 19:45:36 INFO: initialize ciphers... rc4-md5
 2015-11-01 19:45:36 ERROR: Invalid cipher name: rc4-md5, use table instead
 2015-11-01 19:45:38 INFO: server listening at port 1080.

也就是不支持 rc4-md5 的加密方式, 而我买的服务商只支持这个加密方式, 很无奈.

试了N多种下载包, 终于找到支持的包. 在一篇blog (https://smileawei.com/hiwifi-1s-shadowsocks-1-4-8-rc4-md5/)
里面提到: shadowsocks升级到1.4.8, 支持rc4-md5. 并且给出了链接:
http://dl.lazyzhu.com/file/Toolchain/ss-libev/1.4.8-5d7dd372fc/mips/shadowsocks-libev-polarssl_1.4.8_mipsel_uclibc.zip

把上面的包下载后, 加压, 上传路由器, 去覆盖 /opt/bin 目录下的ss-local, ss-redir 就好了

root@home:/opt/bin# ls | grep ss
openssl
ss-local
ss-redir

当然, 安装好之后, 要给chrome 装switchysharp, 还没用上代理, 无法打开chrome store. 可以使用下面的官方站点去下载:
http://www.switchysharp.com/install.html

如何配置多个server:

{
         "server":["45.78.22.221", "45.78.22.222", "45.78.22.223"],
        "server_port":10489,
        "local_port":1080,
        "password":"password",
        "timeout":60,
        "method":"rc4-md5"
}

路由器上检测是不是已经安装shadowsocks:
ipkg list_installed | grep shadowsocks
删除已安装: ipkg remove **

路由器网站 解决端口 80 问题

在中国这个和谐和言论自由的国度, 要在路由器上建网站, 有一个很大的阻碍就是80端口不能用. 幸而443 能用, 所以可以使用https.

可是大部分的网站默认是80端口的, 所以客户直接是访问80端口的. 针对所有通过二级域名访问的, 都可以通过显示/隐身的DNS设置, 转到https 上去. 比如 你的网站是 home.tianxiaohui.com. 那么你可以在路由器设置所有的 *.tianxiaohui.com 都转到 https://home.tianxiaohui.com, 那么所有的二级域名都正常可以访问了.

那么剩下 tianxiaohui.com 这个一级域名了, 因为有非常多的人可能直接访问这个, 并且是默认80端口, 那么就需要一个中转网站, 只要tianxiaohui.com 的 IP 指向这个中转站, 这个中转站在通过301 永久重定向到 https://home.tianxiaohui.com 那么就解决了.

于是今天就找到了一个免费的空间, 只是用它来做重定向, 它就是 http://cpanel.hostinger.com.hk/order/accounts-order.

其实最后只剩下唯一一个了 http://home.tanxiaohui.com, 这个永远连接不上80端口 :(

busybox sendmail 例子

  1. 首先创建一个纯文本, 写入一下内容:

Subject: Restart due to high load
CC:tian@gmail.com
To:admin@tianxiaohui.com
From:test@tianxiaohui.com

Restart due to high load on router

  1. 发送email的命令

cat var/test/routerRestartMail.txt | sendmail -S"smtp.163.com" -au"我的163邮箱用户名" -ap"163邮箱密码" -f"发送者邮箱名@163.com"

  1. sendmail 的详细说明文档:

root@home:/opt/var/eric# sendmail
BusyBox v1.18.4 (2013-05-26 18:44:50 CST) multi-call binary.

Usage: sendmail [OPTIONS] [RECIPIENT_EMAIL]...

Read email from stdin and send it

Standard options:

    -t              Read additional recipients from message body
    -f sender       Sender (required)
    -o options      Various options. -oi implied, others are ignored
    -i              -oi synonym. implied and ignored

Busybox specific options:

    -w seconds      Network timeout
    -H 'PROG ARGS'  Run connection helper
                    Examples:
                    -H 'exec openssl s_client -quiet -tls1 -starttls smtp
                            -connect smtp.gmail.com:25' <email.txt
                            [4<username_and_passwd.txt | -au<username> -ap<password>]
                    -H 'exec openssl s_client -quiet -tls1
                            -connect smtp.gmail.com:465' <email.txt
                            [4<username_and_passwd.txt | -au<username> -ap<password>]
    -S server[:port] Server
    -au<username>   Username for AUTH LOGIN
    -ap<password>   Password for AUTH LOGIN
    -am<method>     Authentication method. Ignored. LOGIN is implied

Other options are silently ignored; -oi -t is implied

home.tianxiaohui.com 更换新的免费证书

之前一直使用的是startSSL的证书, 这个证书是免费的, 虽然startSSL 宣称它的证书浏览器都认, 不过发现在有些浏览器上面, 还是不认这个, 我的Android 手机上面就不认, 公司里面的IE 浏览器也不认, 所以就投靠了新的免费证书: 沃通.

沃通的免费证书很容易申请, 申请之后几分钟就可以下载了. 并且不需要注册.

替换: 因为之前已经设置过证书, 只要替换一把, 全都可以用.