theinfinityjoe
Occasional Visitor
Ive seen some posts about wireguard around the forums but just wondered if it's usable on RT-AC86U. i'm currently running asus merlin on firmware
386.4
386.4
You will need to use something like the Wireguard Manager add-on. See the Add-On subforum and use the filter option to find more discussion on using Wireguard on the AC series routers. Note: You may need to update your firmware however since 386.4 is almost a year old. Latest version is 386.7_2.Ive seen some posts about wireguard around the forums but just wondered if it's usable on RT-AC86U. i'm currently running asus merlin on firmware
386.4
How did you setup the iptable 'trick' - are there notes on this? Thanks ArchielYou can use iptables and mark the wireguard traffic to be exempt from NAT acceleration (that is what I use). It is unpredictable through as some report that the iptable trick does not work on some newer HND routers. It worked for me both on the AC86U and the AX88U.
How did you setup the iptable 'trick' - are there notes on this? Thanks Archiel
#!/bin/sh
KERNEL=$(uname -r)
WGaddress=10.100.10.1/24
WGport=51006
modprobe xt_set
insmod /lib/modules/${KERNEL}/kernel/net/wireguard/wireguard.ko
ip link del dev wg1 2>/dev/null
ip link add dev wg1 type wireguard
wg setconf wg1 /jffs/addons/wireguard/wg1.conf
ip address add dev wg1 $WGaddress
ip link set up dev wg1
#ifconfig wg1 mtu 1380 # origional set by setup script
ifconfig wg1 mtu 1380
ifconfig wg1 txqueuelen 1000
iptables -t mangle -D PREROUTING -i wg1 -j MARK --set-xmark 0x01/0x7 2>/dev/null
iptables -t mangle -D FORWARD -o wg1 -j MARK --set-xmark 0x01/0x7 2>/dev/null
iptables -t mangle -D FORWARD -i wg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 2>/dev/null
iptables -t mangle -D FORWARD -o wg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 2>/dev/null
iptables -D INPUT -p udp --dport $WGport -j ACCEPT 2>/dev/null
iptables -D INPUT -i wg1 -j ACCEPT 2>/dev/null
iptables -D FORWARD -i wg1 -j ACCEPT 2>/dev/null
iptables -D FORWARD -o wg1 -j ACCEPT 2>/dev/null
iptables -D OUTPUT -o wg1 -j ACCEPT 2>/dev/null
iptables -t nat -D PREROUTING -p udp --dport $WGport -j ACCEPT 2>/dev/null
iptables -t mangle -I FORWARD -o wg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -t mangle -I FORWARD -i wg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -t mangle -I FORWARD -o wg1 -j MARK --set-xmark 0x01/0x7
iptables -t mangle -I PREROUTING -i wg1 -j MARK --set-xmark 0x01/0x7
iptables -I INPUT -p udp --dport $WGport -j ACCEPT
iptables -I INPUT -i wg1 -j ACCEPT
iptables -I FORWARD -i wg1 -j ACCEPT
iptables -I FORWARD -o wg1 -j ACCEPT
iptables -I OUTPUT -o wg1 -j ACCEPT
iptables -t nat -I PREROUTING -p udp --dport $WGport -j ACCEPT
Thanks for this, but it is way above my level of understanding. I am using Wireguard Manager for both 'server' and 'client' (AzireVPN) so ideally I would like to have NAT acceleration engaged, but excluding traffic on wg1 and wg2 - I think I may have a lot a reading up to do in 2023It is the mark directives in my server script below.
Code:#!/bin/sh KERNEL=$(uname -r) WGaddress=10.100.10.1/24 WGport=51006 modprobe xt_set insmod /lib/modules/${KERNEL}/kernel/net/wireguard/wireguard.ko ip link del dev wg1 2>/dev/null ip link add dev wg1 type wireguard wg setconf wg1 /jffs/addons/wireguard/wg1.conf ip address add dev wg1 $WGaddress ip link set up dev wg1 #ifconfig wg1 mtu 1380 # origional set by setup script ifconfig wg1 mtu 1380 ifconfig wg1 txqueuelen 1000 iptables -t mangle -D PREROUTING -i wg1 -j MARK --set-xmark 0x01/0x7 2>/dev/null iptables -t mangle -D FORWARD -o wg1 -j MARK --set-xmark 0x01/0x7 2>/dev/null iptables -t mangle -D FORWARD -i wg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 2>/dev/null iptables -t mangle -D FORWARD -o wg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 2>/dev/null iptables -D INPUT -p udp --dport $WGport -j ACCEPT 2>/dev/null iptables -D INPUT -i wg1 -j ACCEPT 2>/dev/null iptables -D FORWARD -i wg1 -j ACCEPT 2>/dev/null iptables -D FORWARD -o wg1 -j ACCEPT 2>/dev/null iptables -D OUTPUT -o wg1 -j ACCEPT 2>/dev/null iptables -t nat -D PREROUTING -p udp --dport $WGport -j ACCEPT 2>/dev/null iptables -t mangle -I FORWARD -o wg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu iptables -t mangle -I FORWARD -i wg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu iptables -t mangle -I FORWARD -o wg1 -j MARK --set-xmark 0x01/0x7 iptables -t mangle -I PREROUTING -i wg1 -j MARK --set-xmark 0x01/0x7 iptables -I INPUT -p udp --dport $WGport -j ACCEPT iptables -I INPUT -i wg1 -j ACCEPT iptables -I FORWARD -i wg1 -j ACCEPT iptables -I FORWARD -o wg1 -j ACCEPT iptables -I OUTPUT -o wg1 -j ACCEPT iptables -t nat -I PREROUTING -p udp --dport $WGport -j ACCEPT
Thanks for this, but it is way above my level of understanding. I am using Wireguard Manager for both 'server' and 'client' (AzireVPN) so ideally I would like to have NAT acceleration engaged, but excluding traffic on wg1 and wg2 - I think I may have a lot a reading up to do in 2023
wan-event
script on a "connected" event where as the serv er can get started from services-start
.nat-start
as the iptable rules get zapped each time the fire wall service gets restarted by Asus.#!/bin/sh
set -x
KERNEL=$(uname -r)
LocalIP="10.100.20.1"
modprobe xt_set
insmod /lib/modules/${KERNEL}/kernel/net/wireguard/wireguard.ko
ip link del dev wg0 2>/dev/null
ip link add dev wg0 type wireguard
wg setconf wg0 /jffs/addons/wireguard/wg0.conf
ip address add dev wg0 $LocalIP
ip link set up dev wg0
ifconfig wg0 mtu 1380
ifconfig wg0 txqueuelen 1000
ip route add 10.100.20.0/24 dev wg0
ip route add 10.0.0.0/24 dev wg0
iptables -t mangle -D PREROUTING -i wg0 -j MARK --set-xmark 0x01/0x7 2>/dev/null
iptables -t mangle -D FORWARD -o wg0 -j MARK --set-xmark 0x01/0x7 2>/dev/null
iptables -t mangle -D FORWARD -i wg0 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 2>/dev/null
iptables -t mangle -D FORWARD -o wg0 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 2>/dev/null
iptables -D INPUT -i wg0 -j ACCEPT 2>/dev/null
iptables -D FORWARD -i wg0 -j ACCEPT 2>/dev/null
iptables -D FORWARD -o wg0 -j ACCEPT 2>/dev/null
iptables -D OUTPUT -o wg0 -j ACCEPT 2>/dev/null
iptables -I FORWARD -i wg0 -j ACCEPT
iptables -I FORWARD -o wg0 -j ACCEPT
iptables -I OUTPUT -o wg0 -j ACCEPT
iptables -I INPUT -i wg0 -j ACCEPT
iptables -t mangle -I FORWARD -o wg0 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -t mangle -I FORWARD -i wg0 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -t mangle -I FORWARD -o wg0 -j MARK --set-xmark 0x01/0x7
iptables -t mangle -I PREROUTING -i wg0 -j MARK --set-xmark 0x01/0x7
wg0.conf
file is#
# Use this configuration with WireGuard client
#
[Interface]
PrivateKey = {Private Key}
[Peer]
PublicKey = {Peer (server) Public Key}
PresharedKey = {preshare key, if used}
AllowedIPs = 10.100.20.2/32, 10.0.0.0/24
Endpoint = {End Point IP}:{Port}
PersistentKeepalive = 25
Just a note, wireguard and NAT acceleration do not get along, so you must disbale that. You can use iptables and mark the wireguard traffic to be exempt from NAT acceleration (that is what I use). It is unpredictable through as some report that the iptable trick does not work on some newer HND routers. It worked for me both on the AC86U and the AX88U.
You need to select which client to redirect, through VPN Director. This is similar to stock firmware which requires you to configure clients through VPN Fusion.Coming back to this i just bought an AX router and flashed the 388.1 merlin firmware. openvpn works as normal but when I setup wireguard, it says connected but my ip doesn't change at all , any idea what i've done wrong ?
That`s what the Enable switch already does.implement Automatic start at boot time
Makes little sense with WireGuard because WireGuard is not based on a traditional client/server setup, it's more like a tunnel/route setup. If the route doesn't work, then traffic will be dropped by default.nd the killswitch for wireguard
"Strict" does not prevent leaks, you need "Exclusive" mode for that, and that's already what the WG implementation does.is there any way of setting DNS Configuration to strict for wireguard
I would like to try wireguard without having to use a USB stick for entware, amtm, etc.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!