最近在某管看到一个“德机”,首次开机2欧元,之后每个月免费续期就可以一直保留,配置1H1G,带宽是1G,流量每个月1T,只不过没有IPv4,只有IPv6。但是也不影响使用,现在流量都有IPv6了,不过我家里却没有,因为之前买的AX5虽然有IPv6的选项,但是打开却无法上网,一直不知道为什么,今天又搜了一下,发现是因为默认路由器打开了IPv6的防火墙,并且后台并不能关闭,那我问你我要IPv6干嘛??在网上搜索了一下可以通过SSH关闭防火墙,于是花了点时间搜索了一下,因为AX5并没有开发版的固件包,所以没办法通过官方工具开启SSH,只能通过降级固件,然后利用之前保留的接口来开启,固件:miwifi_ra67_all_f3fac_1.0.26.bin
下载后在 路由器后台-常用设置-系统状态 选择手动升级,然后选择下载的固件包进行降级,推荐清空现有的配置,毕竟重新设置一遍路由器也不麻烦。
在设置路由器的时候记得勾掉自动升级,不然到时候自动升级了就还要重新降级,因为使用命令关闭防火墙重启就失效了,也不推荐固化,反正路由器一般也不重启,重启了就再连上SSH关闭防火墙就可以了。
配置完成可以正常上网之后,在后台开启IPv6功能,然后来获取SSH权限,在路由器后台,按F12打开浏览器的开发者模式,并切换至控制台选项卡,复制以下代码至终端处,并敲回车执行
function getSTOK() {
let match = location.href.match(/;stok=(.*?)\//);
if (!match) {
return null;
}
return match[1];
}
function execute(stok, command) {
command = encodeURIComponent(command);
let path = `/cgi-bin/luci/;stok=${stok}/api/misystem/set_config_iotdev?bssid=SteelyWing&user_id=SteelyWing&ssid=-h%0A${command}%0A`;
console.log(path);
return fetch(new Request(location.origin + path));
}
function enableSSH() {
stok = getSTOK();
if (!stok) {
console.error('stok not found in URL');
return;
}
console.log(`stok = "${stok}"`);
password = prompt('Input new SSH password');
if (!password) {
console.error('You must input password');
return;
}
execute(stok,
`
nvram set ssh_en=1
nvram commit
sed -i 's/channel=.*/channel=\\"debug\\"/g' /etc/init.d/dropbear
/etc/init.d/dropbear start
`
)
.then((response) => response.text())
.then((text) => console.log(text));
console.log('New SSH password: ' + password);
execute(stok, `echo -e "${password}\\n${password}" | passwd root`)
.then((response) => response.text())
.then((text) => console.log(text));
}
enableSSH();
在弹窗输入你要设置的SSH密码,然后回车就可以了。使用SSH工具连接192.168.31.1,用户名是root
然后输入以下命令关闭IPv6防火墙
ip6tables -F
ip6tables -X
ip6tables -P INPUT ACCEPT
ip6tables -P OUTPUT ACCEPT
ip6tables -P FORWARD ACCEPT
也可以安装mixbox,不过我用不到插件,因为有一台Armbian服务器,所以路由器尽量不去安装这些东西
参考内容:
https://www.firetry.com/archives/1134.html
https://blog.csdn.net/xirigh/article/details/142903106
https://www.bilibili.com/video/av563220058/