a. 获取 SSH 权限
b. 修改 root 用户密码为 admin
参考 https://zhuanlan.zhihu.com/p/260531160
/usr/sbin/ip route add 172.16.0.0/12 via 10.0.0.xxx
需要持久化就加到 /etc/rc.local 。
防火墙也要调整,编辑 /etc/config/firewall,把 config defaults / config zone name lan 的 REJECT 改成 ACCEPT,把 config defaults 中的 option drop_invalid 改为 0。
参考 http://wxxnb.com/archives/xiaomi-router-how-to-open-ssh
举例:
CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build ./cmd/notice
可在 web 控制台配置,如果有限制不许转发到路由器本机,可以自己编辑 /etc/config/firewall,照抄其它的转发配置,保存后 /etc/init.d/firewall reload。
例子:
config redirect 'wan1111rdr1'
option proto 'tcp'
option src_dport '1111'
option dest_ip '10.0.0.1'
option dest_port '1111'
option src 'wan'
option name 'notice'
option target 'DNAT'
option ftype '1'
option dest 'lan'
config redirect 'frp'
option name 'frp'
option src_dport '7000'
option dest_ip '10.0.0.1'
option dest_port '7000'
option proto 'tcp'
option src 'wan'
option target 'DNAT'
option ftype '1'
option dest 'lan'