Skip to content

Instantly share code, notes, and snippets.

Last active May 25, 2022 16:37
  • Star 20 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Making a wireless router with an ASUS PCE-AC88 and Linux (Ubuntu 18.04 LTS)


This project makes a wifi router out of an ASUS PCE-AC88 wireless adapter and your Ubuntu Linux computer that can exceed top of the line routers.

Instead of buying a gaming grade router or another computer that you install openWRT on, follow this project and put the savings towards upgrading your main computer or modem.

Add Adapter

The adapter needs to be added to a PCI slot and the wireless antenna needs to be connected to the adapter. If your computer does not detect it, you may need to re-seat the adapter in the slot. If you can't detect wireless networks after installing the firmware below then this is probably why.

Install Firmware for Adapter

For your computer to use the wifi adapter you need to add the missing firmware that Asus won't provide.

Place brcmfmac4366c-pcie.bin and brcmfmac4366c-pcie.txt in the /lib/firmware/brcm directory. Restart and NetworkManager should realize you have a wifi adapter.

Change Settings

In the Ubuntu Settings App > Power > Power Saving: Uncheck "Wifi can be turned off to save power."

Setup Variables Used Below

ethernet_id=$(nmcli dev status | awk '{print $1}' | grep 'enp');
wireless_id=$(nmcli dev status | awk '{print $1}' | grep 'wlp');

Test that it worked:

echo $ethernet_id;
echo $wireless_id;

You should see something like: "enp2s0" and "wlp2s0". Make sure you use the echo'd values in the files used below or you will get errors.

The ethernet_id and wireless_id bash variables will only be defined for the length of the terminal window. To make them permanent add them to ~/.bashrc.

Compiling Host Access Point Daemon (Hostapd) from Source

This is the software that will run your wireless adapter as a hotspot with a ssid that your device can connect to.

If you use hostapd from apt install hostapd it will exit with an error if there is anyone else using the same channel when starting with wireless n or ac. This makes it impossible to use in an apartment complex. So let's build a version that doesn't check (like all the other routers around us).

#install required packages first
sudo apt -y install build-essential crda libssl-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev pkg-config libnfnetlink-dev

cd ~
git clone git://
cd ~/hostap/hostapd
git checkout hostap_2_3
cp defconfig .config

# enable 802.11n and 802.11ac
sed -i 's/^#CONFIG_IEEE80211N=y/CONFIG_IEEE80211N=y/g' .config
sed -i 's/^#CONFIG_IEEE80211AC=y/CONFIG_IEEE80211AC=y/g' .config

# enable automatic channel selection
sed -i 's/^#CONFIG_ACS=y/CONFIG_ACS=y/g' .config

sed -i 's/^#CONFIG_DRIVER_NL80211=y/CONFIG_DRIVER_NL80211=y/g' .config
sed -i 's/^#CONFIG_LIBNL32=y/CONFIG_LIBNL32=y/g' .config

make && sudo make install

# check that it worked with
hostapd -v

Hostapd Configuration

Add the contents of this file to sudo vim /etc/hostapd/hostapd.conf.

Test config manually. Fails if hostapd is already running at startup (see next section):

sudo hostapd /etc/hostapd/hostapd.conf

If getting error "rfkill: WLAN soft blocked":

rfkill list all
rfkill unblock wifi
nmcli r wifi on

Start Compiled Hostapd at System Startup

Add the contents of this file to sudo vim /etc/systemd/system/hostapd.service.

sudo systemctl daemon-reload

Test the service with:

sudo service hostapd stop
sudo service hostapd status
sudo service hostapd start
sudo service hostapd status

Then enable your new service at startup:

sudo systemctl enable hostapd.service

DHCP Server & DNS Cache

Dnsmasq is needed to assign ip addresses to connected devices. It will also locally cache dns requests. But don't install dnsmasq. No seriously, don't.

Configure a static ip for wlp2s0 in the file /etc/network/interfaces

auto wlp2s0
iface wlp2s0 inet static

Try sudo service networking restart. When in doubt restart your computer if you are unsure if any of these configurations updated.



Enable dnsmasq at startup

Find out what has been blocking port 53: sudo netstat -ltnp | grep -w '53'

You have systemd-resolved enabled as the local DNS server. It binds to port 53, blocking dnsmasq from doing so at startup.

Disable it by setting the following in /etc/systemd/resolved.conf


Then restart systemd-resolved service: sudo service systemd-resolved restart

Now check if /etc/resolv.conf contains:


This is critical for you to have internet access. If it does not consider disabling systemd-resolved completely and regenerating resolv.conf with NetworkManager.

...NetworkManager also has its own copy of dnsmasq via dnsmasq-base. Let's just use that one with our config.

In /etc/NetworkManager/NetworkManager.conf add:


And restart NetworkManager for the changes to work: sudo service NetworkManager restart

Forwarding and NAT

Your device should be getting an ip address and saying it is connected with no internet. We need to properly relay the internet from our wired ethernet.

sudo sysctl net.ipv4.ip_forward=1
sudo sed -i 's/^#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf

We need to activate NAT in the built-in firewall of Linux to make sure the traffic going out uses the external address as its source address and can be routed back.

sudo iptables -t nat -A POSTROUTING -o $ethernet_id -j MASQUERADE

To make the above command persist between reboots install the following package then follow in-terminal prompts:

sudo apt install iptables-persistent

Testing the Setup

We're interested in the link speed from the wireless device to the wireless router, not your isp's internet speed, so don't use a tool like

When a device, such as your phone, is connected check link speed on your computer via:

sudo iw dev $wireless_id station dump


Use an android app called WiFiAnalyzer (open-source) by VREM Software Development to check link speed on your phone.


The PCE-AC88 wireless adapter is 4x4 so it has a max link speed of 433 * 4 = 1732 Mb/s, on the 5Ghz band, with any device that can keep up. My android phone is 2x2, so it reaches its max speed of 433 * 2 = 866 Mb/s when connected to the new wifi router.

I've been testing the new wifi router for the past 2 weeks. I disabled my combo modem-router's 5Ghz band to limit interference and kept the 2.4Ghz band as a backup network.

However, I haven't needed to use the backup yet as the new router has not gone down and has easily handled Netflix/Hulu streaming while multiple phones were also being used.

There doesn't appear to be any added strain to my desktop computer running the router. If there is, it is negligible.

I'm so pleased with the results that I plan to sell my modem-router and buy a better modem.

This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Copy link

jangrewe commented Dec 8, 2018

The brcmfmac4366c-pcie.bin you have on offer here is for 4366b chips, not 4366c. Interesting that it works for you. My 4366/4 (4366c0) doesn't like it:

brcmfmac: brcmf_pcie_download_fw_nvram: FW failed to initialize

Proper brcmfmac4366c-pcie.bin gets loaded by the kernel module and gives me an interface... just hostapd doesn't play nice, yet.

I'm not sure where you got your firmware from, but maybe you can have a look at my documentation and let me know if the firmware you get from that still works with your hardware revision:

Copy link

How did you know you had 4366c chip?

Copy link

The speed mentioned in conclusion are theoretical. What speeds did you achieve practically?

Copy link

martins-pukitis commented Mar 14, 2019

By the way, brcmfmac4366c-pcie.bin was put to git:// on Nov 7 2018 with comment:

brcm: provide new firmwares for BCM4366 chipset
These firmwares are for the BCM4366 3x3 802.11 ac chipsets, which also
comprise of BCM4366E or BCM43664 devices.

It says BCM4366 is 3x3, but actually it is 4x4.

Copy link

renne commented Apr 4, 2019

Does the PCE-AC88 support simultaneous dual-band in AP mode?

Copy link

Second that: Does the PCE-AC88 support simultaneous dual-band in AP mode?
Thats what I'm looking to configure.

Copy link

etki commented Apr 25, 2020

And, again, what's the real speed? It would be damn frustrating to buy something to find out that there are some obstacles that dwindle possible speedups (speaking as an owner of tp-link that has available bands only within 80 mhz range)

Copy link

But don't install dnsmasq

Why ?

On the other hand the PCE-AC88 as a wifi router is just awesome !

Copy link

hontvari commented Dec 20, 2020

And, again, what's the real speed? It would be damn frustrating to buy something to find out that there are some obstacles that dwindle possible speedups (speaking as an owner of tp-link that has available bands only within 80 mhz range)

kernel: 5.4.0
wawemon displays: freq: 5200, rx rate: 780 Mbit/s, tx rate 390 Mbit/s (I do not know the connection speed): Download: 94.33 Mbps, Upload: 51.59 Mbps

I had a firmware crash after about an hour:

[ 4391.691972] ieee80211 phy0: brcmf_fw_crashed: Firmware has halted or crashed
[ 4391.692054] brcmfmac 0000:01:00.0: brcmf_pcie_bus_console_read: CONSOLE: 0: wlc_lq_chanim_update: WLC_CHANIM upd blocked scan/detect
[ 4391.692116] brcmfmac 0000:01:00.0: brcmf_pcie_bus_console_read: CONSOLE: 031121.039 wl0: wlc_watchdog: WLC_CHANIM upd fail -25
[ 4391.692133] brcmfmac 0000:01:00.0: brcmf_pcie_bus_console_read: CONSOLE: 031121.618 
[ 4391.692155] brcmfmac 0000:01:00.0: brcmf_pcie_bus_console_read: CONSOLE: FWID 01-d2cbb8fd
[ 4391.692172] brcmfmac 0000:01:00.0: brcmf_pcie_bus_console_read: CONSOLE: flags 130005
[ 4391.692189] brcmfmac 0000:01:00.0: brcmf_pcie_bus_console_read: CONSOLE: 031121.618 

Copy link

etki commented Dec 30, 2020

@hontvari Thank you!

Just for the heads up / anyone who will end up here like me: things have changed a bit since this gist was published and there are some cheap and fast routers on the market, though not many and they may come with some restrictions in your country (i've tried chinese versions of huawei ws7200, 500mbit down, more than 700mbit up, and xiaomi ax6, 1.2 gbit down, 800mbit up when using iperf3 inside apartment - up speed is not so cool when using speedtest, probably there's small tcp window). I've tried to bring up home router using AX200, but Intel's linux drivers support access points only on 2.4Ghz. So there's still both a plenty of space to play with (and I guess you can already build home router under 50$, if not less) and decent equipment for reasonable price, though you should probably wait till there are many Wi-Fi 6E (same as Wi-Fi 6, but with additional 6GHz band) devices.

Copy link

Hello picchietti,

I have made a wireless router following

All is working great except I have some disconnections and the wifi is not very stable.

I have the following messages in dmesg on the client side (Ubuntu) :

[sam. mars 5 18:12:06 2022] wlp2s0: AP 2c:fd:a1:cf:c5:28 changed bandwidth, new config is 5180.000 MHz, width 2 (5190.000/0 MHz)
[sam. mars 5 18:12:06 2022] wlp2s0: AP 2c:fd:a1:cf:c5:28 changed bandwidth in a way we can't support - disconnect
[sam. mars 5 18:12:06 2022] wlp2s0: failed to follow AP 2c:fd:a1:cf:c5:28 bandwidth change, disconnect
[sam. mars 5 18:12:08 2022] wlp2s0: authenticate with 2c:fd:a1:cf:c5:28
[sam. mars 5 18:12:08 2022] wlp2s0: send auth to 2c:fd:a1:cf:c5:28 (try 1/3)
[sam. mars 5 18:12:08 2022] wlp2s0: authenticated
[sam. mars 5 18:12:08 2022] wlp2s0: associate with 2c:fd:a1:cf:c5:28 (try 1/3)
[sam. mars 5 18:12:08 2022] wlp2s0: RX AssocResp from 2c:fd:a1:cf:c5:28 (capab=0x11 status=0 aid=1)
[sam. mars 5 18:12:08 2022] wlp2s0: associated
[sam. mars 5 18:12:08 2022] wlp2s0: Limiting TX power to 23 (23 - 0) dBm as advertised by 2c:fd:a1:cf:c5:28

How can I fix this error ? changed bandwidth in a way we can't support - disconnect

Can you help me please ?

Best regards,

Copy link

olivierb91 commented Mar 17, 2022


I post here the solution i founded for everyone would have the same problem.

I run my wireless router on Ubuntu Desktop, not server edition, because I want to have a browser and vlc.

I have disabled NetworkManager and wpa_supplicant and no more problems.

Hostapd is now very stable at it's highest speed.

No more deauthenticated while associating (Reason: 6=CLASS2_FRAME_FROM_NONAUTH_STA) and (Reason: 2=PREV_AUTH_NOT_VALID) and no more failed to follow AP bandwidth change, disconnect.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment