New router

As I'm looking a replacement for my now-EOL RT-AX56U, I found Flint 2 and immediately tempted for it particularly because of it's OpenWrt support (it's firmware is based on OpenWrt) which allows endless tinkering possibilities. Out of my curiosity, I found the price on their Taobao store is much less (~100 USD) compared to their global store (~160 USD, although it comes with free shipping). However even with shipping cost added (as I need to use third party forwarder as there is no direct shipping to my country) it's still a bit cheaper if I buy from Taobao.

One limitation is that any GL.iNet devices sold on their Taobao store are China/CN version which have their VPN section in Admin Panel hidden. This is done to comply with local regulation.

GL.iNet router admin panel (v4.5.5) showing the Internet page with a "No cable detected in WAN port" warning. The side navigation menu lacks a VPN section, displaying only Internet, Wireless, Clients, Applications, Network, and System options.

Fortunately, there is a guide to convert GL.iNet routers to Global version. This router version is determined by country_code variable stored in eMMC that will be read by the Admin Panel app. This post is mostly inspired from that guide, but I will add some additional context based on my findings with Flint 2.

Let's cook!

Please note the following action may cause damage to your device. Please proceed carefully.

Preparation

Before we start, please enable SSH in the router. In addition, it's recommended to use public key auth for SSH which is explained with more details in OpenWrt docs.

Check where country code variable is stored

The country_code variable may stored differently between router model. To check where the country_code variable is stored, we can get the data from router's devicetree.

hexdump -C /sys/firmware/devicetree/base/gl-hw/factory_data/country_code
Terminal showing hexdump of GL-MT6000's country_code file: the first line reveals the partition path (/dev/mmcblk0p2) storing the data, while the second line shows byte offset "x88" where the data is stored.
  • Line 1 (0x00 - 0xff): partition that stores country_code -> /dev/mmcblk0p2

  • Line 2 (0x10 - 0x13): byte offset of country_code in the partition -> x88

Verify variable partition

Check the content of the partition based on previous step (/dev/mmcblk0p2). As it may contains hundreds of lines, I recommend to pipe the output to a pager or text editor which in this case I use vim.

hexdump -C /dev/mmcblk0p2 | vim -
Hex editor view of the GL-MT6000 router's factory data partition, with the "CN" country code highlighted at offset 0x88, confirming the device is region-locked to China which disables VPN features in the admin interface.

Check the variable value based on the byte offset from previous step (x88). Currently the value is CN. We may proceed to update the country code.

Update country code value

Adjust the dd options based on previous step.

echo "US" | dd of=/dev/mmcblk0p2 bs=1 seek=136
sync
reboot
  • bs=1: write 1 byte at a time

  • seek=136: seek to position 136 (x88 converted to decimal) before write

  • Refs: dd man page

Verify result

If it's successful, the Admin Panel should no longer shows CN badge and the VPN section should appear.

GL.iNet admin panel (v4.5.5) after modifying the router's country code. The VPN section now appears in the sidebar with full options including VPN Dashboard, OpenVPN Client/Server, WireGuard Client/Server, and Tor, which were previously hidden due to the China region lock.

However, I recommend to install vanilla OpenWrt instead, which is what I use now :D