SSH router Redmi ax6 ?¿

Hi, I would like to know if it is possible to access a redmi ax6 router via ssh. I know this is possible with the xiami ax3600 with firmware 1.0.17, but is it also possible with the ax6? I have an ax6 in my hands and I see that it comes with version 1.0.18 and doing the same steps as with the ax3600 I see that it is not possible to access via ssh, does anyone know how to do it? Can I flash with the firmware 1.0.17 from ax3600 on the ax6? they are compatible? thanks in advance

You can presume that you can't use another model's firmware and that they are not compatible, unless the opposite is confirmed.


It is possible to access a redmi ax6 router via ssh, but more difficult than ax3600.If you can read Chinese, visit this website for more information:

Simply, you need to do

  1. You need another router running openwrt, turn off its DHCP function, and set its LAN IP to, connect your computer to this router and set the IP to If everything is OK, you can enter the URL to access this router, you also need to know wifi name and password of this router

  2. Create new file /usr/lib/lua/luci/controller/admin/xqsystem.lua on this router, its content is

module("luci.controller.admin.xqsystem", package.seeall)

function index()
    local page   = node("api")  = firstchild()
    page.title   = ("")
    page.order   = 100
    page.index = true
    page   = node("api","xqsystem")  = firstchild()
    page.title   = ("")
    page.order   = 100
    page.index = true
    entry({"api", "xqsystem", "token"}, call("getToken"), (""), 103, 0x08)

local LuciHttp = require("luci.http")

function getToken()
    local result = {}
    result["code"] = 0
    result["token"] = "; nvram set ssh_en=1; nvram commit; sed -i 's/channel=.*/channel=\"debug\"/g' /etc/init.d/dropbear; /etc/init.d/dropbear start;"

Make sure when you visit you will get result like this

{"code":0,"token":"; nvram set ssh_en=1; nvram commit; sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear; /etc/init.d/dropbear start;"}

backslashes are irrelevant

  1. Login in to your router and get the STOK like follwing:;stok={STOK}/web/home#router

  2. Access the URL in the browser, you need to replace {STOK} {WIFI_NAME} {PASSWORD} in the URL:;stok={STOK}/api/misystem/extendwifi_connect?ssid={WIFI_NAME}&password={PASSWORD}
    it will return 0

  3. Access the URL in the browser, you need to replace {STOK}:;stok={STOK}/api/xqsystem/oneclick_get_remote_token?username=xxx&password=xxx&nonce=xxx

Now you can access your redmi ax6 via ssh, username is root, you can get default password here:

By the way, don’t forget your router running openwrt, turn on the DHCP function and set the IP to, If you forget, I bet you can never connect to it again unless you reset it


Ok, thanks you very much! And yes, it’s more difficult :grinning_face_with_smiling_eyes:

I copy code but my result is:

{"token":"; sed -i 's\/channel=.*\/channel=\"debug\"\/g' \/etc\/init.d\/dropbear; \/etc\/init.d\/dropbear start;","code":0}

And it doesn't work. When I try open;stok={STOK}/api/misystem/extendwifi_connect?ssid={WIFI_NAME}&password={PASSWORD} i get:

504 Gateway Time-out

What I doing wrong? Any ideas?

Perfect, it worked for me. The only thing is that after HW reset, I need to repeat points 3-5.

I needed this to allow VLAN tagging. My ISP requires VLAN 10 (Fibre - VODAFONE SETUP HERE). Before that, I could not connect to the Internet at all. After changing /etc/config/network to

option ifname 'eth1.10'

in eth1, wan and wan6, it says "connected", blue LED for Internet is on, but I cannot load any page, neither the speed test in the router GUI works. Any idea what it could be?

Thank you very much!

Ahh, got it. It was MTU. The ISP says it should be set on 1500, Redmi AX6 has it natively 1500, but I had to go down with it. Initially, the ping seemed alright at 1472, but Netflix on a TV was still buggy,... All stable at 1462. I hope it is not so bad. The speed is still around some 935-945 through ethernet, so I assume it is fine.

Thank you very much for the guide!

Are you sure you followed the guide? Points 1-3 are on an OpenWrt router, points 3-5 are on Redmi AX6.

Point 4 - you connect with AX6 (PC connected to AX6) to the OpenWrt router (its Wifi name and password).
Point 5 - recalls the tocken on AX6 (PC still connected to AX6) fro the OpenWrt routeer as connected in thee previous step.

yes, i'm sure. Point 3 - " Make sure when you visit you will get result like this" and answer is {"code":0,"token":"; nvram set ssh_en=1; nvram commit; sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear; /etc/init.d/dropbear start;"}
but I've answer with "token" first and "code":0 at end of line {"token":" bla bla bla"; "code":0}

That is alright. The important thing is that it is there. I had it at the end of the line too. Though, I cannot see this part in your answer:

...nvram set ssh_en=1; nvram commit;...

It seems that your previous step might have been wrong. What firmware version of AX6 do you have, btw.?

Commands doesnt matter, I have ssh_en set 1 so i cut off this commands. I need to start dropbear so i left only sed and dropbear start. I tried on 1.0.16 and 1.0.18, but that dosent mattes to because on my old openwrt router always answer is "token":".......;"code":0 insted "code":0,"token":......

Again, I had "code":0 at the very end of the line too, and it worked for me. This is exactly what I get:

ok, thanks. So i try again.

I found couse of my problem. I changed wifi autorisation on openwrt router WPA>WPA2 and now it works. Thanks for help.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.