WireGuard in the kernel or userspace? Which kernels/builds?

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
kentchristopher
DD-WRT Novice


Joined: 21 Jun 2012
Posts: 33

PostPosted: Fri May 05, 2023 12:15    Post subject: WireGuard in the kernel or userspace? Which kernels/builds? Reply with quote
I have some older travel routers that I'm looking to breathe some life into with WireGuard. I know that performance won't be great on slower processors, but for my purposes, getting 10 Mbps is fine. However I've read that WireGuard running in userspace is much slower (and probably not worth it), so I don't want to experiment with new, untested builds on some of these devices, and risk bricking them if I know in advance that they don't have WireGuard in the kernel.

From extensive reading and searching trying to answer this on my own, I know that WireGuard is in the Linux kernel as of 5.6, and that it can be added to older kernels through backporting.

My questions:

Is WireGuard implemented in the kernel despite even latest DD-WRT builds running Linux kernels below 5.0 (from what I see on new build reports)? If so, was WireGuard backported to specific Linux kernels and DD-WRT builds (and which ones)?

(Note that this info is not found in the DD-WRT WireGuard info page. Maybe it should be.)

Further, how can I tell which Linux kernel is used by a specific DD-WRT build without downloading and installing it?


Last edited by kentchristopher on Fri May 05, 2023 12:48; edited 1 time in total
Sponsor
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5660

PostPosted: Fri May 05, 2023 12:27    Post subject: Reply with quote
Yes, yes, and see build threads. Without router model version or revision, hardware information, would be helpful.
kentchristopher
DD-WRT Novice


Joined: 21 Jun 2012
Posts: 33

PostPosted: Fri May 05, 2023 13:01    Post subject: Reply with quote
I should have phrased that better: I'm asking which specific kernels/builds (edited post to reflect this) have WireGuard in the kernel. I'm assuming it's kernel version dependent (I know different DD-WRT builds use different kernels depending on the hardware).

The hardware is the TP-Link TL-WR703N (Atheros AR9331).
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Fri May 05, 2023 13:08    Post subject: Reply with quote
WireGuard documentation is a sticky in this forum.
So just scroll up Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5660

PostPosted: Fri May 05, 2023 13:25    Post subject: Reply with quote
WireGuard on "some" 4MB routers? (DeviWiki: TP-LINK TL-WR703N v1.0)

"svn.dd-wrt.com/browser/src/router/configs/ar7xxx/.config_wr703"
Line 12: CONFIG_WIREGUARD=y

Should be running a new build (without issues) at this moment is r52369.

WG requirements kernel 3.x or higher enough flash space and configured.
TL-WR703N is 3.10.x, not 2.6.x, and in early February WireGuard enabled.


Last edited by blkt on Fri May 05, 2023 14:06; edited 1 time in total
kentchristopher
DD-WRT Novice


Joined: 21 Jun 2012
Posts: 33

PostPosted: Fri May 05, 2023 14:03    Post subject: Reply with quote
egc wrote:
WireGuard documentation is a sticky in this forum.
So just scroll up Smile


Yes, one of the first things I read. The most relevant line is:

Quote:
WireGuard is usually available on routers with 8 MB Flash RAM or more (there are a few exceptions) and using at least Kernel 3.10 (so not on K2.6 builds).
Some Small target (4 MB flash using Kernel 3.10) also got WireGuard: https://svn.dd-wrt.com/changeset/51596


The WR703N seems to be one of the "small target" exceptions, though the changelog on the same page specifically says "Some Small target (4 MB flash) might get WireGuard" (emphasis mine, hence the uncertainty), which is why I've been trying to figure this out. The changeset number for the "small target" builds is 51596, so I'm assuming (perhaps wrongly) that those changes would be in build number higher than that. So if I want WireGuard on the WR703N, I won't get it with anything less than builds r51617 or higher?

More generally (i.e. for all hardware), it's not clear what build brought in WireGuard (in the kernel). If you search the database for compatible hardware, the latest build that always comes up (on hardware I've searched on) is v3.0 44715 (dated 11/03/2020). That build does list WireGuard in the notes. I'll note that the WireGuard page stickied in this forum starts its changelog with changeset 47259 (August 2021), only referencing a killswitch feature change. So when was WireGuard (in the kernel) actually added to DD-WRT?

I'm really trying to make sense of all this. Hopefully I've made clear that the documentation isn't itself particularly clear.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5660

PostPosted: Fri May 05, 2023 14:17    Post subject: Reply with quote
Please ignore the router database, there is nothing that can be done about this and completely out of our control.
First added does not matter, especially TL-WR703N it was February 8. Old builds not recommended, or supported.
Documentation is for new builds anyway also there are so many supported models but few can be recommended.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Tue May 09, 2023 8:47    Post subject: Reply with quote
@kentchristopher can you confirm that WireGuard is indeed working on your router?
Latest and recommended build is 52459

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6410
Location: UK, London, just across the river..

PostPosted: Tue May 09, 2023 9:17    Post subject: Reply with quote
I always had a believe, WG is made to work on kernel space...and there is where its advantage comes from..no idea how its gonna be efficient if, its placed in user space, its the first time i hear about such a question... like that.. kernel space or user space ? Rolling Eyes Question Laughing Laughing
_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Tue May 09, 2023 9:22    Post subject: Reply with quote
There are different versions made to run in user space but the whole point of WireGuard is that it is fast because it is running in Kernel space.

See: https://www.wireguard.com/xplatform/

But it can only run in Kernel space if it has at least Kernel 3.10

DDWRT only uses the in Kernel space WireGuard.

You can download the user space implementation (WireGuard-Go) via Entware

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kentchristopher
DD-WRT Novice


Joined: 21 Jun 2012
Posts: 33

PostPosted: Sat Dec 16, 2023 20:50    Post subject: Reply with quote
egc wrote:
@kentchristopher can you confirm that WireGuard is indeed working on your router?
Latest and recommended build is 52459


Sorry for the late reply. I either missed or didn't get notifications of replies.

I haven't found WireGuard options in the GUI, and I even just upgraded to the latest build for the TL-WR703n (54517 dated 12/15/2023) to confirm. There's no Tunnels tab at all (where I've found WireGuard settings on other routers with DD-WRT), nor anything under Services -> VPN (only option is PPTP server and client - no OpenVPN).

It does appear to be in the kernel though, as the 'wg' command is responsive in telnet. Not ideal, but it's there. I haven't tested it.

On the bright side, the latest build seems to run without issues so far - at least for the purpose as a travel router (using "Station" radio mode; still getting used to the new radio mode names).

For reference, this build's kernel info:

Code:
Linux 3.10.108-d11 #147818 Fri Dec 15 06:45:32 +06 2023 mips.
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1899

PostPosted: Sat Dec 16, 2023 21:12    Post subject: Reply with quote
4MB flash, 32MB RAM, unlikely that WG is on this device, despite being k3x.

https://wikidevi.wi-cat.ru/TP-LINK_TL-WR703N_v1.0

Clear browser cache, reset and try again?

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Sat Dec 16, 2023 21:17    Post subject: Reply with quote
kentchristopher wrote:
egc wrote:
@kentchristopher can you confirm that WireGuard is indeed working on your router?
Latest and recommended build is 52459


Sorry for the late reply. I either missed or didn't get notifications of replies.

I haven't found WireGuard options in the GUI, and I even just upgraded to the latest build for the TL-WR703n (54517 dated 12/15/2023) to confirm. There's no Tunnels tab at all (where I've found WireGuard settings on other routers with DD-WRT), nor anything under Services -> VPN (only option is PPTP server and client - no OpenVPN).

It does appear to be in the kernel though, as the 'wg' command is responsive in telnet. Not ideal, but it's there. I haven't tested it.

On the bright side, the latest build seems to run without issues so far - at least for the purpose as a travel router (using "Station" radio mode; still getting used to the new radio mode names).

For reference, this build's kernel info:

Code:
Linux 3.10.108-d11 #147818 Fri Dec 15 06:45:32 +06 2023 mips.


Clear browser cache

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum