Setting up Wireguard on gl-mt300n-v2


I want to configure Wireguard on my gl-mt300n-v2 router running firmware 3.012.

My vpn provider gave me the following configuration file, but the router doesn’t recognize it, and I’m not sure what exactly I should put in to add the fields manually. Also according to my provider the listen port should be random. Can anyone help with the config? Thanks!

PrivateKey = XXX=
Address =

PublicKey = YYY=
AllowedIPs =, ::/0
Endpoint =
PersistentKeepalive = 25


When you copy and paste the content to the UI (plain text), what does the UI say?

Maybe you can edit the line of AllowedIPs to the following and try again.

AllowedIPs =


I was getting the error “Invalid Port Number”
It looks like the original values for AllowedIPs was fine. I was able to get it working by adding:

ListenPort = 84

to the Interface section. According to my provider, this shoud be blank (or whatever setting makes the port random), but setting it to 84 seems to have worked for now.


@kyson-lok pls check if port number can be removed from parameter check.


It is a bug for old firmware. It had been fixed.


I’m running firmware 3.012. Do you recommend getting the beta of 3.022?


For anyone else who is running into to same problem, the 3.022 firmware did solve the problem of being able to use the config file (having a random port assigned). It also fixed other problems in the wireguard implementation that were causing connection problems with some websites.