Linksys AC Series Router Configuration Tips for OpenWRT: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 37: | Line 37: | ||
*opkg update | *opkg update | ||
*opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3 | *opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3 | ||
<br /> | |||
== Multiple IP Addresses assigned to an interface, AKA Aliases in OpenWRT == | |||
The OpenWRT article on [https://openwrt.org/docs/guide-user/base-system/basic-networking Basic Networking] and [https://openwrt.org/docs/guide-user/network/network_interface_alias Aliases] includes a lot of information. But they leave out a few interesting details that would be nice to know; | |||
* Bridge / Switch: The br-lan name (seen when using the ifconfig command) is not explicitly assigned. Instead, if an interface defined in the /etc/config/network file is ''option type 'bridge'<nowiki/>'' then "br" with a hyphen ( br- ) is prepended to the name of the interface ( ''interface 'lan''' ) in the /etc/config/network file | |||
* Make sure each new "Interface" is include in the firewall setting (GUI: Interface, Firewall Settings, Assign Firewall Zone OR File: /etc/config/firewall, config zone (lan), option network, add the name of the interface) | |||
* OpenWRT examples tend to vacillate between one of two different syntax in their examples, for instance; | |||
** option 'type' 'bridge' OR option type 'bridge' (the latter seems to reflect how the actual configuration files are done) | |||
* The ''option ifname'' item should be set to the above mentioned br-lan OR br-lan1 name ( ''option ifname 'br-lan1''' ), not eth0.1 as examples give and the configuration file might imply. IE, the br-lan OR br-lan1 interface name doesn't exist in the /etc/config/network file, so how is one supposed to know? Well, as mentioned in the bullet point, this was discovered after a bit of experimenting. Thus the initial comment about the OpenWRT documentation leaving out a key detail to actually making things function. | |||
Note: Items in the above bullet points noted in italic represent configuration statements in a file. | |||
=== Example; === | |||
A.B.C.D and W.X.Y.Z are place holders for an IP Address<syntaxhighlight lang="text"> | |||
# When using IFCONFIG, this interface will be displayed as br-lan1 and eth0.1 will not | |||
# have an IP Address | |||
config interface 'lan1' | |||
option type 'bridge' | |||
option ifname 'eth0.1' | |||
option proto 'static' | |||
option netmask '255.255.255.0' | |||
option ip6assign '60' | |||
option ipaddr 'A.B.C.D' | |||
config interface 'lan2' | |||
option proto 'static' | |||
option ipaddr 'W.X.Y.Z' | |||
option netmask '255.255.255.0' | |||
# The ifname needs to be set to the br-lan1 name, not eth0.1 | |||
option ifname 'br-lan1' | |||
</syntaxhighlight>...and don't forget to type the following command for settings to take effect: service network reload | |||
==OpenVPN== | ==OpenVPN== |
Revision as of 20:30, 25 July 2020
Most of this article is focused on the OpenWRT Firmware / OS (Operating System) and the WRT1900ACS and WRT3200ACM routers. The WRT32X is essentially the same as the WRT3200ACM and is not mentioned specifically in this article. The WRT1900AC series is older and because the price difference between it and the WRT1900ACS is negligible, along with better hardware specification for the WRT1900ACS, it is recommended to purchase the ACS, thus the AC model is not fully covered here. The information below does work for the most part on the WRT1900AC and WRT32X.
See WRT1900AC, WRT1900ACS, and WRT3200ACM Routers, SoS (CPU), and Hardware for information about hardware specifics.
Firmware Installation
REMEMBER: The AC Series of routers has dual boot partitions, so if you're installing firmware it will flash it to the non-active flash partition. So if one happens to be running OpenWRT on one partition and DD-WRT or the stock Linksys firmware on the other partition, if installing from the OpenWRT / LUCI GUI, it will overwrite the other partition. Use the OpenWRT Install / Factory image in this instance.
When upgrading the OpenWRT Firmware the LUCI GUI interface and firmware package will also flash the other partition, so set the other boot partition as active or use the OS in the other partition to perform the upgrade. Use the OpenWRT Upgrade / SysUpgrade image in this instance.
See the Switching Boot Partitions section of this article for the commands to view or change the boot partition.
WRT1900AC
There are two hardware versions of the WRT1900AC (v1 and v2, v1 will not appear on the label, it is used here to differentiate between v1 and v2) so check the label on the bottom of the router and get the right firmware.
WRT1900ACS
There are two hardware versions of the WRT1900ACS (v1 and v2, v1 will not appear on the label, it is used here to differentiate between v1 and v2), but unlike the WRT1900AC, both versions of the router use the same firmware.
WRT3200ACM
As of the writing of this article on 7.2020, there is only one version of the WRT3200ACM
Package Installation with OPKG
opkg is the package management utility on OpenWRT.
Dual Booting
This allows for rebooting to the alternate partition;
- opkg update
- opkg install luci-app-advanced-reboot
Remember: When attempting to utilize this within the LUCI GUI (if already logged in and connected), refresh the browser windows (CTRL Key plus Refresh Button in Firefox).
USB Flash Drives
Believe it or not, the stock installation of OpenWRT does not come with the capability to access USB or eSATA devices. Considering how prevalent a USB port is on routers these days, that's a bit baffling. Plus it's really frustrating for so many web sites that refer to the LuCI, System, Mount Point menu that doesn't exist unless the previously mentioned items are installed. Big woof on this one.
The following allows for ext2, ext4, and ntfs partitions to be recognized via USB and includes the LUCI GUI Interface (Under System, Mount Points);
- opkg update
- opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3
Multiple IP Addresses assigned to an interface, AKA Aliases in OpenWRT
The OpenWRT article on Basic Networking and Aliases includes a lot of information. But they leave out a few interesting details that would be nice to know;
- Bridge / Switch: The br-lan name (seen when using the ifconfig command) is not explicitly assigned. Instead, if an interface defined in the /etc/config/network file is option type 'bridge' then "br" with a hyphen ( br- ) is prepended to the name of the interface ( interface 'lan' ) in the /etc/config/network file
- Make sure each new "Interface" is include in the firewall setting (GUI: Interface, Firewall Settings, Assign Firewall Zone OR File: /etc/config/firewall, config zone (lan), option network, add the name of the interface)
- OpenWRT examples tend to vacillate between one of two different syntax in their examples, for instance;
- option 'type' 'bridge' OR option type 'bridge' (the latter seems to reflect how the actual configuration files are done)
- The option ifname item should be set to the above mentioned br-lan OR br-lan1 name ( option ifname 'br-lan1' ), not eth0.1 as examples give and the configuration file might imply. IE, the br-lan OR br-lan1 interface name doesn't exist in the /etc/config/network file, so how is one supposed to know? Well, as mentioned in the bullet point, this was discovered after a bit of experimenting. Thus the initial comment about the OpenWRT documentation leaving out a key detail to actually making things function.
Note: Items in the above bullet points noted in italic represent configuration statements in a file.
Example;
A.B.C.D and W.X.Y.Z are place holders for an IP Address
# When using IFCONFIG, this interface will be displayed as br-lan1 and eth0.1 will not
# have an IP Address
config interface 'lan1'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr 'A.B.C.D'
config interface 'lan2'
option proto 'static'
option ipaddr 'W.X.Y.Z'
option netmask '255.255.255.0'
# The ifname needs to be set to the br-lan1 name, not eth0.1
option ifname 'br-lan1'
...and don't forget to type the following command for settings to take effect: service network reload
OpenVPN
For some reason if one installs OpenVPN via opkg install openvpn, the mbedTLS version is installed as opposed to the OpenSSL. Hint: Use the OpenSSL. Why?
To install OpenVPN with OpenSSL and the LUCI GUI for it (under VPN)
- opkg update
- opkg install openvpn-ssl luci-app-openvpn
Telnet
Telnet is supported (and works) on DD-WRT, but OpenWRT has essentially discontinued use of telnet in the name of security. It is possible to build a custom version of the OpenWRT software that supports telnet.
Swap Partitions / Files
Most references to Swap Partitions or Files indicate performance is quite poor. But this may have been written during the USB 2.0 period and doesn't reflect the performance of USB3 or eSATA devices in 2020. That said, "Virtual RAM" is slower no matter what. The AC Series comes with an astounding amount of RAM (512 MB), so this may not be an issue.
If a Swap Partition is added, it can will potentially consume an entire USB Flash drive.
A Swap File may be a good alternative.
Switching Boot Partitions
Commands for OpenWRT
- To determine which boot partition is active: /usr/sbin/fw_printenv -n boot_part
- To change which boot partition is active: /usr/sbin/fw_setenv boot_part 1 OR /usr/sbin/fw_setenv boot_part 2
Commands for DD-WRT
- To determine which boot partition is active:ubootenv get boot_part
- To change which boot partition is active: ubootenv set boot_part 1
Power Switch
Per this site: https://community.linksys.com/t5/Wireless-Routers/WRT1900AC-May-have-bricked-it/td-p/811096
- Reset the router by holding the reset button in until the PWR light starts to flash, appx. 15 seconds.
- Once the power light stops flashing, you can power off the router with the power switch.
- Turn the power back on and the PWR light will light. As soon as any other light turns on, power off the router with the power switch.
- Turn the power back on and the PWR light will light. As soon as any other light turns on, power off the router with the power switch.
- Turn the power back on and the PWR light will light. As soon as any other light turns on, power off the router with the power switch.
- Turn the power back on and the PWR light will light. This time just let the router power all the way up. It should now be on the alternate
Per this site: https://forum.archive.openwrt.org/viewtopic.php?id=70202
- Start with the power switch off, then switch on. Watch the power LED:
- Power LED: on (a few seconds)
- Power LED: off (a second or two)
- Power LED: on (immediately when the power light turns on, flip the power switch off)
- That is 1 cycle of the 3 required to revert to the other partition. Repeat the above procedure two more times, making sure to flip the switch off as soon as the power LED comes on the second time.
- The fourth time you turn the power switch on you can let the device boot and it should boot into the other partition.