{"id":231,"date":"2022-04-30T18:30:48","date_gmt":"2022-04-30T15:30:48","guid":{"rendered":"https:\/\/keremgurevin.com\/?p=231"},"modified":"2023-05-01T16:35:58","modified_gmt":"2023-05-01T13:35:58","slug":"how-to-install-openwrt-on-xiaomi-mi-4a-gigabit-edition-router","status":"publish","type":"post","link":"https:\/\/keremgurevin.com\/?p=231","title":{"rendered":"How To Install OpenWRT On Xiaomi Mi 4A Gigabit Edition Router"},"content":{"rendered":"\n<p>Hi, today I will tell you how to install OpenWrt on Xiaomi Mi 4A Gigabit Edition Router. This router has 128 MB of RAM and 16 MB of Flash which is more than enough for OpenWrt.<br>I chose this router because before using this router I had 1 router and a modem because the modem couldn&#8217;t give a good signal after 5-8 meters. Also since it gave a bit of signal the device would not automatically switch to the router that&#8217;s why I needed a better router to disable the WIFI of the main modem, disable the old router, and only use 2 of these routers, mesh them with OpenWrt to a single network and use it like that. But when the router came where once had 5MB down 2 MB up had 15 MB down and 5MB up on a 100\/5 ISP plan with one modem without OpenWrt (With OpenWrt it was even higher)<\/p>\n\n\n\n<p class=\"has-text-align-center\">                           What Is OpenWrt\/Why Choose It<\/p>\n\n\n\n<p class=\"has-text-align-left\"> For the OpenWrt team, it&#8217;s wireless freedom. For me, it&#8217;s making your router\/modem your empire. <br>OpenWrt has features like plugins like AdBlock, ssh, better control over the modem, more customization, <a href=\"https:\/\/openwrt.org\/reasons_to_use_openwrt\">and more<\/a>.<br>It modifies the files for better wifi signals <\/p>\n\n\n\n<p class=\"has-text-align-center\">Starting To Install <\/p>\n\n\n\n<p class=\"has-text-align-center has-vivid-red-color has-text-color has-medium-font-size\">WARNING!!!!!!!! <\/p>\n\n\n\n<p class=\"has-text-align-center has-vivid-red-color has-text-color has-medium-font-size\">Me, anybody, any site mentioned or linked to on this post take no responsibility in any form if something wrong happens<\/p>\n\n\n\n<p>First off when starting to install you need: <\/p>\n\n\n\n<p class=\"has-text-align-left\">  a USB stick that is at least 8 GBs (to install Linux mint on)<br>  an Internet connection<br>  some patience<br>Rufus or balenaEtcher (for writing Linux mint on the USB)<br>a Linux Mint ISO from the official Linux Mint Site  (You can use any other Linux distro if you want. I tried it on only Linux Mint.)<br><\/p>\n\n\n\n<p>To flash the Linux Mint ISO file that you&#8217;ve downloaded open Rufus or Etcher. (If it does have do complete the setup)<br>After that plugin, the USB stick and start flashing (Note that it will delete all the files on the USB stick)<br>After it finished flashing open BIOS (probably press the F2, F11, F12, or the DEl key while turning on the computer) <br>Change the first boot drive to USB then save &amp; exit.<br>When Mint Opens up press the first option (Or live trial etc.)<br>Then open the terminal and type :<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt-get update &amp;&amp; sudo apt-get upgrade -y &amp;&amp; sudo apt-get dist-upgrade -y &amp;&amp; sudo apt-get autoclean -y &amp;&amp; sudo apt-get autoremove -y<\/code> \n\nThis'll update all of the components of Linux Mint to the latest version<\/pre>\n\n\n\n<p>After that&#8217;s complete, type in <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git clone <a rel=\"noreferrer noopener\" href=\"https:\/\/forum.donanimhaber.com\/ExternalLinkRedirect?module=pgdcode16&amp;messageId=135790478&amp;url=https:\/\/github.com\/acecilia\/OpenWRTInvasion.git\" target=\"_blank\">https:\/\/github.com\/acecilia\/OpenWRTInvasion.git<\/a>\ncd OpenWRTInvasion\n\nThis'll download the OpenWrt installer, and go into it's folder\n<code>\nOnce that's done, type <\/code>\npip3 install -r requirements.txt \n\nThis'll install the required stuff for the installer.\n\n<\/pre>\n\n\n\n<p>After that, we run the installer.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 remote_command_execution_vulnerability.py\n\nIt'll ask you for a code, to get this code go to your router's local IP. (Default 192.168.31.1)  and  copy the part in the URl where it says: stok=codecodecodecodecode (without the \/) \n\n<img loading=\"lazy\" decoding=\"async\" width=\"2000\" height=\"532\" class=\"wp-image-251\" style=\"width: 2000px;\" src=\"https:\/\/keremgurevin.com\/wp-content\/uploads\/2022\/04\/ad3b70ca12bc1e1d55a4917e8cef741c.png\" alt=\"\" srcset=\"https:\/\/keremgurevin.com\/wp-content\/uploads\/2022\/04\/ad3b70ca12bc1e1d55a4917e8cef741c.png 1361w, https:\/\/keremgurevin.com\/wp-content\/uploads\/2022\/04\/ad3b70ca12bc1e1d55a4917e8cef741c-300x80.png 300w, https:\/\/keremgurevin.com\/wp-content\/uploads\/2022\/04\/ad3b70ca12bc1e1d55a4917e8cef741c-1024x272.png 1024w, https:\/\/keremgurevin.com\/wp-content\/uploads\/2022\/04\/ad3b70ca12bc1e1d55a4917e8cef741c-768x204.png 768w, https:\/\/keremgurevin.com\/wp-content\/uploads\/2022\/04\/ad3b70ca12bc1e1d55a4917e8cef741c-850x226.png 850w\" sizes=\"auto, (max-width: 2000px) 100vw, 2000px\" \/><\/pre>\n\n\n\n<p>After approx. In 45 seconds you should be able to connect to the router.<br>Type: <code>telnet 192.168.31.1<\/code> and type <code>root<\/code> for both the username and password.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<p>When it&#8217;s connected, type <code>cd \/tmp<\/code> and then curl -L https:\/\/downloads.openwrt.org\/releases\/21.02.3\/targets\/ramips\/mt7621\/openwrt-21.02.3-ramips-mt7621-xiaomi_mi-router-4a-gigabit-squashfs-sysupgrade.bin &#8211;output firmware.bin &#8211;ipv4 -k<\/p>\n\n\n\n<p>To check if the file isn&#8217;t corrupted, type<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/busybox sha256sum firmware.bin\n\nI<code>f both the strings match, then continue. If not, redownload the file.<\/code>\n<\/pre>\n\n\n\n<p>Finally to permanently install OpenWrt, type <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mtd -e OS1 -r write firmware.bin OS1\n\nWe are waiting for it to perform the installation procces and reboot the device. After the process is finished and the device is turned on without any problems, let's get well soon. I recommend that you download the firmware file that we installed on the device above, this time, and after the device boots up, flash it again to the device without checking the Keep settings option from the Flash new firmware image section of the System \u2192 Backup\/Flash Firmware page at 192.168.1.1. This is a recommended event after initial setup. The device is ready for use.\r\n\r\nGood luck with your new router. What happens next is entirely up to you. You can  use it freely for many different purposes. For example; You can install and use many useful programs such as SQM, AdBlock, Wireguard, OpenVPN, DDNS, Multiwan, DNS over TLS, and upnp. You can even write a program of your own choice. You are only limited by your imagination.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hi, today I will tell you how to install OpenWrt on Xiaomi Mi 4A Gigabit Edition Router. This router has 128 MB of RAM and 16 MB of Flash which is more than enough for OpenWrt.I chose this router because before using this router I had 1 router and a modem because the modem couldn&#8217;t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":185,"footnotes":""},"categories":[47,46],"tags":[],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-hardware","category-software"],"_links":{"self":[{"href":"https:\/\/keremgurevin.com\/index.php?rest_route=\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/keremgurevin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/keremgurevin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/keremgurevin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/keremgurevin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=231"}],"version-history":[{"count":6,"href":"https:\/\/keremgurevin.com\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":321,"href":"https:\/\/keremgurevin.com\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions\/321"}],"wp:attachment":[{"href":"https:\/\/keremgurevin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/keremgurevin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/keremgurevin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}