OpenWrt support for TP-Link Deco M4R

So is the new eth0.2 interface a bridge or what? And what device for interface do you select?

Ok I’m seriously lost. I’m going isp modem>decom4r>wificlient(aka my oculus and pc and phone) my isp cable modem can not have a router connecting with static ip. It has to be dhcp. And I need the deco to be it’s own dhcp server for the Wi-Fi clients. I need pictures guys I’m lost and frustrated.

(Important for people with a Deco V3 or V4 that find this howto: There is no additional switch chip in those devices. The CPU has two Ethernet ports. So anything I explain here doesn't apply to V3 or V4 and only applies to V1 and V2. V3 and V4 should have the WAN interface bound to eth0 and the LAN interface bound to eth1).

You're not going to get any pictures. And yes, what you're asking for is a standard router setup. Nobody said anything about static IPs.

I'm going to try writing this down. If it doesn't suffice for you then I have to say that here is the wrong place to ask for a network setup. This post is for getting OpenWrt installed on Deco M4Rs. For network setup questions the right place to ask is https://forum.openwrt.org/c/general/network-and-wireless-configuration/12 because this has nothing to do with the specific device you're using. It's all OpenWrt.

Now, when you go to Network->Interfaces, what interfaces do you see? Do you have a LAN interface? You should. Is it green? That should be the case too. And the little icons below the "LAN" label should give you tooltips "Type: Bridge, Device: br-lan..." and "Type: Software VLAN, Device: eth0.1..." when you hover over them.

If it's not green then click on "Edit" on the right of the LAN interface. Then click on the "Firewall Settings" tab and there you can select a green "lan" firewall-zone.

The "DHCP Server" tab should be populated. You're getting an IP from the Deco when connecting to it via Ethernet cable. If not then there should be a green "Set up DHCP Server" button. Is that the case? I'm guessing not.

That means the LAN interface is ready to go.

Now for the WAN interface:

There is no WAN interface. Means you have to add a new one. Go to Network->Interfaces and click on "Add new interface...".

The name should obviously be "WAN". And you want to get an IP from your modem, so the Protocol should be "DHCP client".

Now open the dropdownbox for the Device and if you don't see any 'Switch VLAN: "eth0.2"' to select then go to the very bottom where it says "-- custom --" and there you type in "eth0.2". Of couse without the quotes. And hit Enter. After that click on "Create interface".

Then go to the "Firewall Settings" tab and select the red "wan" firewall-zone. Don't touch anything else. Click on "Save".

You now have a WAN interface.

Now go to Network->Switch. There should be a VLAN with ID "1" that is "tagged" for the CPU(eth0) and untagged for LAN 1 and LAN 2.

See that "CPU(eth0)"? Your Deco's CPU only has one Ethernet port named "eth0". And that is connected to a separate switch chip that is also on the board of the device. Remember how the LAN interface uses the device "eth0.1"? That means that the LAN interface uses that one Ethernet port named "eth0" but tags all packets with VLAN ID "1". So currently any packets coming in from the LAN 1 or LAN 2 port that don't already have a VLAN tag (= are "untagged") will get tagged for VLAN "1" and those are then sent to your LAN interface. In the other direction any packets sent out from the LAN interface are tagged for VLAN "1" and thus will be sent untagged out vial LAN 1 or LAN 2.

We're now making the decision that LAN 1 should be used for WAN traffic and LAN 2 should be used for LAN traffic.

First make sure that your Ethernet cable is plugged in to LAN 2.
Then you're going to open that dropdownbox for VLAN "1" for LAN 1 and select "off". Then click "Save & Apply". LAN 1 should now be dead for LAN traffic but you should still be able to access the device via LAN 2.

Now I don't know if the standard config added any other VLANs. If it did then delete all of them with their respective "Delete" buttons. But obviously don't delete VLAN "1".

Then click on "Add VLAN". You should now have a second VLAN with ID "2". If not then change the ID to "2". The WAN interface is connected to "eth0.2", so it expects tagged traffic on VLAN "2". Means that you have to select "tagged" in the CPU column. The LAN 1 column should read "untagged" and the LAN 2 column should read "off". If so then click on "Save & Apply".

You should now have a working router with an IPv4 WAN interface.

If you need an IPv6 WAN interface too then add another interface and set it up the same way you did the IPv4 WAN interface but as "Protocol" you select "DHCPv6 client". But if that interface doesn't work then you really need to ask that in the Network and Wireless Configuration sub-forum, because I've got no clue about setting up any special IPv6 things.

Edit: I forgot the wireless connection. If there aren't any set up already called "OpenWrt" for the 2.4GHz and 5GHz radio then set them up like this:

Go to Network->Wireless. If you want to have one wifi called "my_great_wifi" on both 2.4GHz and 5GHz you will have to add the same SSID to both radios. I'm going to explain it for the 2.4GHz and then you need to do the same for the 5GHz radio.

Click on "Add" for radio1. Click on the "Advanced Settings" tab and select your country. That ensures that your Deco doesn't transmit with more strength than is allowed in your country.

At the bottom in the "General Setup" tab the Mode should be "Access Point", the ESSID is "my_great_wifi" and for Network you select the LAN interface.

On the "Wireless Security" tab you should at least select WPA2-PSK (PSK means "pre-shared key"). Better would be WPA3, but all of the devices connected to that SSID need to support it too. And then add a strong Key. For a basic SSID setup that's all you need to do. For everything else there are countless how-tos on the internet or ask in the appropriate sub-forum.

Now click "save" and then click "Save & Apply".

You might also have to click on "Enable" for that SSID if it isn't enabled automatically.

1 Like

Hello to all,

Only today I was able to test flashing my Deco P9 v2.0 with the instructions provided by @KinteLiX and @bobthebuilder.
Just have to thank you all, becaise everything went like a charm and is working perfectly setted up as Dumb APs.

Thanks again for your work and help.

Best regards.

1 Like

Went back to factory firmware due to speeds on mesh as the difference was significant.
Interesting though, is the fact that I have more speed, but I also seem to have a higher latency compared to OpenWRT firmware.

Hi bob, thank you for this, I was able to flash mine using @KinteLiX method. I have also setup WAN and LAN interface successfully, now the problem I'm facing is that whenever I reboot the Deco it acts as an Access Point to my Mikrotik instead of a router, my setup is ISP-->Mikrotik as core router-->Deco. Its getting DCHP from my Mikrotik then distributes the IP to the device connected to the Deco. What I want to achieve is for Deco to become a router even after a reboot.

Does the Deco not store any changes when it reboots?

The setup remains the same, my LAN and WAN is still up, DHCP in DECO is still up. its just after reboot the Deco acts as a dumb AP

Did you flash the ramfs image instead of the sysupgrade image?

Because the ramfs image can be flashed but will only ever use the RAM for settings and those vanish if you reboot.

I did followed this guide OpenWrt support for TP-Link Deco M4R - #51 by KinteLiX and flashed the sysupgrade.bin

Then first go to "System->Backup/Flash Firmware" and click on "Flash image..." and flash the newest sysupgrade, just to make sure that this isn't some problem with the version you flashed or the way you flashed it:

https://downloads.openwrt.org/releases/22.03.3/targets/ath79/generic/openwrt-22.03.3-ath79-generic-tplink_deco-m4r-v1-squashfs-sysupgrade.bin

But if that doesn't solve your problem then I'm out of ideas. If the problem persists then you might go to "Status->System Log" and copy your Kernel Log to www.pastebin.com so we can have a look if it contains anything obvious.

Okay I'm gonna try doing that.

Hi @bobthebuilder, I successfully flashed it, the Deco did not reset. However looking at the logs I saw this.

Fri Feb  3 13:51:05 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.2.12 00:90:9e:9d:05:ec
Fri Feb  3 13:51:05 2023 daemon.info dnsmasq-dhcp[1]: DHCPNAK(br-lan) 192.168.2.12 00:90:9e:9d:05:ec wrong network

After rebooting while the LAN interface is still connected to my PC it requested the DHCP from my mikrotik even though it promt as wrong network. However, after pulling the cable out then inserting it back again my computer then again got the DCHP from my Deco as shown in this log

Fri Feb  3 13:57:23 2023 kern.info kernel: [  541.616548] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 5 is down
Fri Feb  3 13:57:28 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.68.142 00:90:9e:9d:05:ec
Fri Feb  3 13:57:28 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.68.142 00:90:9e:9d:05:ec Admin-PC
Fri Feb  3 13:57:28 2023 kern.info kernel: [  546.816176] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 5 is up

And I think I'm good with this, I'll use this as my wifi anyways. Anyways, thank you for your time and patience @bobthebuilder. God bless.

Im a bit confused. I thought you wanted the Deco to act as a router and give out IP addresses and to NOT act as a dumb AP?

Edit: I guess I'm mainly confused about the deco not rebooting after flashing.

After rereading what you wrote, it seems like everything is now working as you expected.

Hi, does it worth to upgrade my Deco M4R to openwrt? My problem with the deco software is that I can't force clients to use a specific device. For example I have a small ESP, which a smaill soldered panel antenna, which always connects to the furthest deco unit, instead of the one which is just 1 meter from the client. I can't force this device to use the closest one. This drives me crazy.
Does openwrt supports all the featues what deco does? For example parental controls? What about the performance? Is it really better with openwrt? Thanks!

For example I have a small ESP, which a smaill soldered panel antenna, which always connects to the furthest deco unit, instead of the one which is just 1 meter from the client.

I'm using ESP8266s with ESPEasy as a firmware and that will initially connect to the strongest signal and then stick with that BSSID. If that specific BSSID vanishes then the ESP will try the next strongest BSSID and stick with that.

You could with OpenWrt kick off a specific wifi device. But I'm not sure if that device would then try to connect to another BSSID since it still sees the one it was connected to prior.

But you can disconnect specific clients, so you can definitely try it.

Does openwrt supports all the featues what deco does?

There are different packages that should cover all of the functionality the Decos bring with them. But it's a different story if they work as you'd want them or as good as the original firmware.

For example parental controls?

Likely. You should google that. Because at the end of the day those are mostly just firewall rules.

What about the performance? Is it really better with openwrt?

A lot of people report worse wifi performance with the ath10k-ct drivers that come with openwrt. You can however install non-ct drivers.

I've got ct drivers on all of my 8 devices that use the same cpu and radios as the deco m4r v2 and so far nobody is complaining. But I use all of them as dumb APs. No clue about mesh performance.

1 Like

Yeah, about the mesh performance I wonder if it's firmware related or config related.
I really want to use OpenWrt but the mesh performance is not on par, so I installed the firmware with telnet enabled and started poking around, and there are some weird (my knowledge is limited :slight_smile: ) things in configs that might explain what's missing to have the same performance (or not).

On /etc/ we have an athx100.conf which has the following content

ap_scan=1
ctrl_interface=/var/run/wpa_supplicant
wps_cred_processing=1
network={
        ssid="Atheros XSpan Network"
        scan_ssid=1
        proto=WPA
        pairwise=TKIP
        key_mgmt=WPA-PSK
        psk="12345678"
}

Could this be an additional hidden network that is used between Decos as a mesh backhaul ?

Every mesh setup needs a mesh network that all APs are part of. So that network isn't additional but essential.

TP-Link chose to make their mesh network hidden (and probably everyone else does this too) so that their customers wouldn't ask them what that weird additional network was or how to connect to it.

But that doesn't solve the problem that the ath10k drivers for OpenWrt aren't that great.

1 Like

@bobthebuilder its possible to use the deco M4 as repeater with open wrt ? I have an Archer Ax10 V1.20 (that the wifi experience is about double the speed) that I would like to use as a main router and wifi and use the decos now as repeater only is that possible with openwrt ? With the stock software it only allows to use it as AP and you need to have at least one deco via cable :melting_face:

This is not specific to the Deco M4. Just google "openwrt repeater".

1 Like