Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
inbox:toh:askey:rt4230w_rev6 [2022/11/03 06:03] – [Different Revisions] jturn08inbox:toh:askey:rt4230w_rev6 [2024/02/12 08:58] – external edit
Line 11: Line 11:
  
 ===== Hardware Highlights ===== ===== Hardware Highlights =====
----- datatable ---- +<!-- ToH: { 
-cols    ModelVersionsCPU, CPU MHz, Flash MB_mbflashs, RAM MB_mbram, WLAN Hardware, WLAN 2.4GHz, WLAN 5.0GHz, Ethernet Gbit ports_USB ports_ +  "source""json", 
-header  : ModelVersion,SoC,CPU MHz,Flash MB,RAM MB,WLAN Hardware,WLAN2.4,WLAN5.0,Gbit ports,USB +  "dom": "t", 
-align   c,c,c,c,c,c,c,c,c,c,c,c,c +  "paging": false
-filter  : Model~RT4230W +  "rotate"true
-sort    : Model +  "shownColumns"["model""version""cpu""cpumhz""flashmb""rammb""wlanhardware""wlan24ghz""wlan50ghz""ethernet1gports""usbports"]
-----+  "filterColumns"{"model": "^RT4230W$"} 
 +-->
  
 ===== Installation ===== ===== Installation =====
----- datatable ---- 
-cols    : Model, Versions, Supported Current Rel, Firmware OpenWrt Install URL_url, Firmware OpenWrt Upgrade URL_url, Firmware OEM Stock URL_url 
-headers : Model, Version, Current Release, Firmware OpenWrt Install, Firmware OpenWrt Upgrade, Firmware OEM Stock 
-align   : c,c,c 
-filter  : Model=RT4230W 
----- 
-For explanation of different images, see [[docs:guide-user:installation:before.installation|FAQ before installation]] 
  
-==== Method 1Installation using web interface, SSH, and tftp (Only works for RAC2V1K) ==== +OpenWrt firmware[[https://firmware-selector.openwrt.org/?target=ipq806x%2Fgeneric&id=askey_rt4230w-rev6|https://firmware-selector.openwrt.org]]
-Method 1 doesn't require opening the case and works with RAC2V1K models (exserial number beginning with A922 or AD31)+
  
-**This method does NOT work with SAC2V1K** (exrouter has QR code next to serial number sticker and has a serial number beginning with AD70 or AE32)Instead, use installation method 2 that requires disassembling router and using serial access +For explanation of different images, see [[docs:guide-user:installation:before.installation|FAQ before installation]].
  
-//Instructions were tested with (X)ubuntu 22.04 with RAC2V1K with a serial number beginning with AD31 and stock FW version 1.1.161.1.31, 1.2.4//+==== Method 1: Installation over the network without serial access (Only works with non-SAC2V1K firmware) ==== 
 +Method 1 doesn't require opening the case and works with non-SAC2V1K firmware (ex: serial number beginning with A922 or AD31). **This method does NOT work with SAC2V1K firmware** (example of SAC2V1K firmware: router has QR code next to serial number sticker and has a serial number beginning with AD70 or AE32)Insteaduse installation method that requires disassembling the router to access the serial console.
  
-**Follow along at your own risk. There's a chance that the router may soft-brick if you use the wrong bootcmd but as long as you have serial access and u-boot still works you can use installation method 2 to recover. **+**WARNING: If you soft-brick your router, you will need to disassemble it to access the serial console in order to recover. You can use installation method 2 in that case.**
  
-Connect a network cable between your computer and the blue (switchport of the router.+Stock non-SAC2V1K firmware: https://github.com/Lanchon/rt4230w-rev6-stock-firmware 
 +==== Method 1A: Installation using web interface and SSH (only works with non-SAC2V1K firmware==== 
 +This is the recommended install method. It does not require setting up a TFTP server and thus is quick and easy, it produces full backups of the router, and it installs dual OSes: main and recovery. The recovery OS will run automatically if the main OS ever gets corrupted, for example due to an interrupted sysupgrade. It also configures the router to attempt a TFTP boot if both OSes are corrupt.
  
-Login to stock router at ''http://192.168.1.1/'' with the default username and password (ex: admin). Then navigate to **Advanced > Admin > Configuration** page in the stock router web interface. Use **Restore from File** option and upload the corresponding config file from [[https://github.com/lmore377/openwrt-rt4230w/raw/master/RAC2V1K-SSH.zip|RAC2V1K-SSH.zip]] [[https://www.mediafire.com/file/2snxez1bdc5mp3i/RAC2V1K-SSH.zip/file|mirror RAC2V1K-SSH.zip]] file that corresponds to the stock firmware version of the router (from **Advanced > Status > System Information** page).  (If you're firmware is newer than what's in the zip file, just restore the latest file).+Note that this method must be executed under the WSL (Windows Subsystem for Linux) if you are running Windows. 
 + 
 +See instruction here: https://github.com/Lanchon/openwrt-rt4230w-rev6 
 + 
 +==== Method 1B: Installation using web interface, SSH, and TFTP (only works with non-SAC2V1K firmware) ==== 
 +//Instructions were tested on Ubuntu 22.04 with RAC2V1K with a serial number beginning with AD31 and stock FW version 1.1.16, 1.1.31, 1.2.4// 
 + 
 +Download the OpenWrt initramfs and sysupgrade (squashfs) images for your router. Install and set up a tftp server (see [[docs:guide-user:installation:generic.flashing.tftp|install OpenWrt over TFTP]]). 
 + 
 +Connect a network cable between your computer and the blue (switch) port of the router. Configure your computer with static IP address ''192.168.1.2''
 + 
 +Login to stock router at ''http://192.168.1.1/'' with the default username and password (admin, admin). Then navigate to **Advanced > Admin > Configuration** page in the stock router web interface. Use **Restore from File** option and upload the corresponding config file from [[https://github.com/lmore377/openwrt-rt4230w/raw/master/RAC2V1K-SSH.zip|RAC2V1K-SSH.zip]] [[https://www.mediafire.com/file/2snxez1bdc5mp3i/RAC2V1K-SSH.zip/file|mirror RAC2V1K-SSH.zip]] file that corresponds to the stock firmware version of the router (from **Advanced > Status > System Information** page).  (If you're firmware is newer than what's in the zip file, just restore the latest file).
  
 The router automatically reboots. Afterwards, you can ssh into the router with the username for your firmware from the [[https://pastebin.com/raw/ub8Um4ug|Readme]]. You may need to include extra parameters for ssh to work, such as ''ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostKeyAlgorithms=+ssh-rsa technician@192.168.1.1'' The router automatically reboots. Afterwards, you can ssh into the router with the username for your firmware from the [[https://pastebin.com/raw/ub8Um4ug|Readme]]. You may need to include extra parameters for ssh to work, such as ''ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostKeyAlgorithms=+ssh-rsa technician@192.168.1.1''
  
-From ssh, run the following commands:+From ssh, run these commands to configure a booting attempt via TFTP with fallback to stock firmware:
 <code> <code>
-fw_setenv ipaddr 10.42.0.10 #IP of router, can be anything +fw_setenv bootcmd 'set ipaddr 192.168.1.1; set serverip 192.168.1.2; tftpboot recovery.bin && bootm; bootipq
-fw_setenv serverip 10.42.0.1# #IP of tftp server that's set up in next steps +fw_setenv bootdelay 2
-fw_setenv bootdelay 5 +
-fw_setenv bootcmd "tftpboot initramfs.binbootm; bootipq"+
 </code> </code>
  
-Don't reboot the router yetInstall and set up a tftp server on your computerFor instructions, follow [[docs:guide-user:installation:generic.flashing.tftp|install OpenWrt over TFTP]] on this model.\\  +Rename the OpenWrt initramfs image file ''recovery.bin'', and host it with the tftp server.
-->  [[docs:guide-user:installation:generic.flashing.tftp]]+
  
-Configure your computer with a static IP address (needs to be the same as ''serverip'' from ssh commands).+Reboot the router. The router will run as a TFTP client at ''192.168.1.1'' and connect to your computer at ''192.168.1.2'' to download and run the ''recovery.bin'' OpenWrt image from RAM. If you set up everything right, the router LED should switch over to a slow blue glow which means OpenWrt is booted and running in recovery (initramfsmode. The recovery will have default web address ''http://192.168.1.1'' with user root, no password. You can ssh into it by running ''ssh root@192.168.1.1''.
  
-Download the **Firmware OpenWrt Install** imagerename it to ''initramfs.bin'', and host it with the tftp server+After you've confirmed your router is booted to OpenWrt in recovery modedisable your computer's tftp server by running ''sudo ufw deny tftp''
  
-Reboot the router. The router will run as a TFTP client at ''10.42.0.10'' and connect to your computer at ''10.42.0.1'' to download install the ''initramfs.bin'' OpenWrt Install image. If you set up everything right, the router LED should switch over to a slow blue glow which means OpenWrt is booted and running in recovery (initramfsmode.+ssh into OpenWrt and run this command to configure OpenWrt boot (autodetects flash size): 
 +<code> 
 +fw_setenv bootcmd 'set mtdids nand0=nand0; set mtdparts mtdparts=nand0:416M@0x2400000(mtd_ubi); ubi part mtd_ubi && ubi read 0x44000000 kernel && bootm; set mtdparts mtdparts=nand0:220M@0x2400000(mtd_ubi); ubi part mtd_ubi && ubi read 0x44000000 kernel && bootm' 
 +</code>
  
-Configure your computer with a static IP like ''192.168.1.2''then ssh into OpenWrt router using root user with no password by running ''ssh root@192.168.1.1''+Nextuse the OpenWrt sysupgrade image file and upgrade to sysupgrade OpenWrt firmware (using luci, etc.)See [[docs:guide-quick-start:sysupgrade.luci|Upgrading OpenWrt firmware using LuCI]]
  
-After you've confirmed your router is booted to OpenWrt in recovery mode, disable your computer'tftp server by running ''sudo ufw deny tftp''+The router will reboot and, if all went well, you'll now have OpenWrt running. The router will have default address ''http://192.168.1.1'' with user root, no password. 
 + 
 +==== Method 2: Installation using serial access and TFTP (works with all firmware versions) ==== 
 +Method 2: Install with serial access (Do this if something fails and you can't boot after using method 1) 
 +Open the router and connect to the serial console. Instructions can be found here: https://openwrt.org/inbox/toh/askey/rt4230w_rev6#opening_the_case 
 + 
 +Download the OpenWrt initramfs and sysupgrade (squashfs) images for your router. Install and set up a tftp server (see [[docs:guide-user:installation:generic.flashing.tftp|install OpenWrt over TFTP]]). 
 + 
 +Connect a network cable between your computer and the blue (switch) port of the router. Configure your computer with static IP address ''192.168.1.2''
 + 
 +Rename the OpenWrt initramfs image file to ''recovery.bin'', and host it with the tftp server.
  
-Verify your router is a rac2v1k model with a serial number beginning with A922 or AD31 with 512MB flash memory, then ssh into OpenWrt router and run these commands:+Interrupt U-Boot and run these commands to configure OpenWrt boot (autodetects flash size):
 <code> <code>
-fw_setenv bootcmd "setenv mtdids nand0=nand0 && set mtdparts mtdparts=nand0:0x1A000000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm" +set bootcmd 'set mtdids nand0=nand0set mtdparts mtdparts=nand0:416M@0x2400000(mtd_ubi); ubi part mtd_ubi && ubi read 0x44000000 kernel && bootm; set mtdparts mtdparts=nand0:220M@0x2400000(mtd_ubi); ubi part mtd_ubi && ubi read 0x44000000 kernel && bootm' 
-fw_setenv bootdelay 2+set bootdelay 2 
 +saveenv
 </code> </code>
-Next, download the OpenWrt sysupgrade image file and upgrade to sysupgrade OpenWrt firmware (using luci, etc.). See [[docs:guide-quick-start:sysupgrade.luci|Upgrading OpenWrt firmware using LuCI]] 
  
-If all went well, you'll now have OpenWrt running. The router will have default address ''http://192.168.1.1'' with user root, no password  +And run this command to boot once via TFTP: 
-==== Method 2: Installation with serial access (Works with RAC2V1K and SAC2V1K) ==== +<code> 
-Method 2: Install with serial access (Do this if something fails and you can't boot after using method 1) (Works with RAC2V1K and SAC2V1K) +set ipaddr 192.168.1.1; set serverip 192.168.1.2; tftpboot recovery.bin && bootm 
-Open the router and connect to the serial consoleInstructions can be found here: https://openwrt.org/inbox/toh/askey/rt4230w_rev6#opening_the_case+</code>
  
-Install and set up a tftp server+The router will run as a TFTP client at ''192.168.1.1'' and connect to your computer at ''192.168.1.2'' to download and run the ''recovery.bin'' OpenWrt image from RAM. If you set up everything right, the router LED should switch over to slow blue glow which means OpenWrt is booted and running in recovery (initramfs) mode. The recovery will have default web address ''http://192.168.1.1'' with user root, no password. You can ssh into it by running ''ssh root@192.168.1.1''.
  
-Set a static ip on the ethernet interface of your computer+Next, use the OpenWrt sysupgrade image file and upgrade to sysupgrade OpenWrt firmware (using luci, etc.). See [[docs:guide-quick-start:sysupgrade.luci|Upgrading OpenWrt firmware using LuCI]]
  
-Download the initramfs imagerename it to initramfs.binand host it with the tftp server+The router will reboot andif all went wellyou'll now have OpenWrt running. The router will have default address ''http://192.168.1.1'' with user root, no password.
  
-Connect the wan port of the router to your computer+(Originally based on: github.com/lmore377)
  
-Interrupt U-Boot and run these commands: +==== Installation of a recovery OS ==== 
-  setenv serverip 10.42.0.1 (You can use whatever ip you set for the computer) +An secondary recovery OS (an initramfs OpenWrt image) can be installed on this device. The recovery OS will run automatically if the main OS ever gets corrupted, for example due to an interrupted sysupgrade.
-  setenv ipaddr 10.42.0.10 (Can be any ip as long as it's in the same subnet) +
-  setenv bootcmd "setenv mtdids nand0=nand0 && set mtdparts mtdparts=nand0:0x1A000000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm"+
  
-If you have a SAC2V1K router, use this bootcmd instead +See here for detailshttps://github.com/Lanchon/openwrt-rt4230w-rev6#install-a-recovery-image-if-you-installed-openwrt-through-any-other-method
-  setenv bootcmd "setenv mtdids nand0=nand0 && set mtdparts mtdparts=nand0:0xDC00000@0x2400000(firmware) && ubi part firmware && ubi read 0x44000000 kernel 0x6e0000 && bootm" +
-  saveenv +
-  tftpboot initramfs.bin +
-  bootm+
  
-After OpenWrt bootsfigure out a way to flash the sysupgrade file (lucisftpflash drive, etc.)+===== Basic configuration ===== 
 +-> [[docs:guide-user:base-system:start|Basic configuration]] After flashingproceed with this.\\ 
 +Set up your Internet connectionconfigure wirelessconfigure USB port, etc.
  
-The router will reboot and if all went wellyou'll now have OpenWrt running.+===== Specific Configuration ===== 
 + 
 +==== Network interfaces ==== 
 +The default network configuration is: 
 +^ Interface Name ^ Description        ^ Default configuration ^ 
 +| br-lan (eth1.1) | LAN & WiFi         | 192.168.1.1/24        | 
 +| wan (eth0.2)    | WAN                | DHCP client           | 
 +| vlan1 (eth1.1)  | LAN ports (1 to 4) | None                  | 
 +| vlan2 (eth0.2)  | WAN port           | None                  | 
 +| radio0          | WiFi 5G            | Disabled              | 
 +| radio1          | WiFi 2.4G          | Disabled              | 
 + 
 +==== Switch Ports (for VLANs)  ==== 
 + 
 +OpenWrt Switch port number 1 is the physical network port labeled Internet (WAN) on the device, numbers 2-5 are the Ethernet ports labeled 1-4 on the device, and number 0 and 6 are internal connections between the switch chip and the CPU (labeled "CPU" in LuCI). Use these //switch// port numbers when specifying a VLAN's ports via the UCI (i.e.in the ''ports'' option of a VLAN's ''config switch_vlan'' section, in ''/etc/config/network''). 
 + 
 +By default, ''eth0'' is used for traffic to/from the ISP and ''eth1'' is for traffic to/from the local network. 
 + 
 +^ Port             ^ Switch port   ^ 
 +| CPU (eth0)       | 0             | 
 +| WAN              | 1             | 
 +| LAN 1            | 2             | 
 +| LAN 2            | 3             | 
 +| LAN 3            | 4             | 
 +| LAN 4            | 5             | 
 +| CPU (eth1)       | 6             | 
 +==== Performance tuning ==== 
 + 
 +In **Network > Firewall > General Settings**, in section **Routing/NAT Offloading** enable **Software flow offloading**. 
 + 
 +**IMPORTANT:** The information below no longer applies to OpenWrt 23.05 (kernel 5.15.134). 
 + 
 +<hidden> 
 +Recent OpenWrt releases use the ''performance'' governor by default, obviating the need for further configuration and keeping the CPUs always at max frequency: 
 + 
 +<code> 
 +root@OpenWrt:~# cat /sys/devices/system/cpu/cpufreq/policy*/scaling_governor 
 +performance 
 +performance 
 +</code>
  
-credits: github.com/lmore377+(Also, the referenced sysfs files (''/sys/devices/system/cpu/cpufreq/ondemand/*'') no longer exist.)
  
-===== Performance tuning ===== +**OUTDATED INFORMATION FOLLOWS:** 
-Enable **Software flow offloading** in **Network > Firewall > General Settings**.+
  
 This router has the same SoC as the Netgear R7800, so thanks to [[https://forum.openwrt.org/t/r7800-performance/15780/29|this forum post]] and the device page for this: This router has the same SoC as the Netgear R7800, so thanks to [[https://forum.openwrt.org/t/r7800-performance/15780/29|this forum post]] and the device page for this:
Line 112: Line 163:
 echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor     echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor    
 </code> </code>
 +</hidden>
  
 ===== Hardware ===== ===== Hardware =====
  • Last modified: 2024/05/08 05:29
  • by lanchon