ZebMcKayhan
Very Senior Member
I can't remember but you might need to enable it from wgm cli:I just installed wgm and can't find gui
Code:
E:Option ==> www mount
It should appear under the addons tab in the gui.
I can't remember but you might need to enable it from wgm cli:I just installed wgm and can't find gui
E:Option ==> www mount
it worked but that's new for me, last time I installed it, gui was on by default,I can't remember but you might need to enable it from wgm cli:
Code:E:Option ==> www mount
It should appear under the addons tab in the gui.
? = About Configuration (WebUI http://://router_ip:/)
? = About Configuration (WebUI http://://router_ip:/user9.asp)
as you are asking this question, I assume you wish to not delete your old peer and import the new? as that would be the most straight forward way.do anyone know how can I update/replace the private key for my client peer?
/opt/etc/wireguard.d/wg11.conf
/opt/etc/wireguard.d/WireGuard.db
nano /opt/etc/wireguard.d/wg11.conf
thanks for your explanation, yes, I don't want to delete the peer and re-import the config to it. The wg config from my service provide valid only 2 hours every time, once the wg tunnel need to reconnect after then I need obtain an new private key. So want to update just the private key of the peer config and remain all others same.as you are asking this question, I assume you wish to not delete your old peer and import the new? as that would be the most straight forward way.
the keys exists in 2 places.
mostly the config used for running the peer will be in:
for wg11.Code:/opt/etc/wireguard.d/wg11.conf
but wgm also keeps it in its sql database
the SQL database is mainly used by WGM when setting up everything around the peer (firewall rules, policy rules et.c)Code:/opt/etc/wireguard.d/WireGuard.db
you can try to stop the peer, exist wgm and update the keys in the config file by, i.e.:
but Im not sure wgm will notice the mismatch and throw some errors. in that case you may need to update the SQL database as well.Code:nano /opt/etc/wireguard.d/wg11.conf
I have sometimes copied the SQL database to my android phone and used "SQLite Editor" to update it and put it back and it works good, its well structured so its obvious what to change and where.
you should probably stop all peers and exit wgm before doing this, and make a safety copy of the database before you start changing it.
Ouch, 2h!The wg config from my service provide valid only 2 hours every time, once the wg tunnel need to reconnect after then I need obtain an new private key.
sorry for my expression not clearly, the key valid for 2h for connection, once connected will persistent keep alive until the link broken and need a new key to rebuild the connection.Ouch, 2h!
I would be concerned about all the hassle I would need to go through to get it working so I would probably not use it.
Perhaps worth your time to write a script that updates both wg11.conf and the sql database - and possibly retrieves a new config file - cron job every 2h.
All bits and pieces about changes to the files are already in wgm script.
I really thought it would be enough with wg11.conf. out of curiosity, what error message did you get?
That's wierd. Are you sure everything turned out correctly?i try to update both wg11.conf and sqldb, but unfortunetely not working as expected. the sympton is 0 bytes transfer.
wg showconf wg11
yes, it's really new key, but transfer 0That's wierd. Are you sure everything turned out correctly?
I know that wgm "builds" a new config, which is basically wg11.conf, with removed stuff that Wireguard itself does not handle, like dns and others, and runs it from /tmp. I did not check if it recreates it on start if it already exists.
When your updated peer is running you could run directly in shell:
Code:wg showconf wg11
It will output the config it's currently using. Compare your keys, are they still the old keys?
You basically only need the keys and endpointyes, it's really new key, but transfer 0
I think it should be something wrong during my update steps, but I don't which is it.
[Interface]
ListenPort = 33922
PrivateKey = xxx <-- new key
[Peer]
PublicKey = XvfaTRG0IMezPQNzNvtW4Vn2T2RTEijsR1NhoM0XPmc=
AllowedIPs = 0.0.0.0/0
Endpoint = 149.88.98.226:51820
PersistentKeepalive = 21
but trasfer 0
interface: wg11 EndPoint=149.88.98.226:51820 172.21.4.129 # N/A
peer: XvfaTRG0IMezPQNzNvtW4Vn2T2RTEijsR1NhoM0XPmc=
transfer: 0 B received, 888 B sent 0 Days, 00:00:30 since Thu Oct 10 16:11:27 2024 >>>>>>
WireGuard® ACTIVE Peer Status: Clients 1, Servers 0
ASUS GUI Peers: Clients 3, Servers 0
checked back wg11.conf
admin@asuswifi:/tmp/home/root# cat /opt/etc/wireguard.d/wg11.conf
[Interface]
PrivateKey=xxx <- same new key
Address=172.21.4.129
DNS=149.88.98.225,149.88.98.227
[Peer]
PublicKey=XvfaTRG0IMezPQNzNvtW4Vn2T2RTEijsR1NhoM0XPmc=
AllowedIPs=0.0.0.0/0
Endpoint=sx0320108-wg.pointtoserver.com:51820
PersistentKeepalive=21
admin@asuswifi:/tmp/home/root#
I found the issue casued by vpn rule of vpn director conflict with wgm, it works when I disable all rulesYou basically only need the keys and endpointort for the handshakes to work. Could this new config be not active? You can test it on your phone/computer to be sure.
Did you check Endpoint and/or port didn't change?
It's either that or some error in editing, some character missing or something?
Yea, putting everything (0.0.0.0/0) to vpn is troublesome and doing it twice is probably just a bad idea.I found the issue casued by vpn rule of vpn director conflict with wgm, it works when I disable all rules
You would need to provide a lot more information about all peer config if we are going to help you.Hello.
Few days ago I set Wireguard connection with my VPS Wireguard server. Connection is ok but I can't get inside my local network from Wireguard tunel. I use this tunel to connect my 2 networks in different locations. So there is VPS with Wireguard server and two routers one with OpenWRT (works ok) and second RT-AC86U 382.14_2 RMerlin. I can ping from this Asus my VPS and OpenWRT. I don't have public IP.
Could someone help with setting this up ?
My Asus is 192.168.100.x and in Wireguard 10.9.0.2
VPS 192.168.1.x and in Wireguard 10.9.0.1
OpenWRT 192.168.11.x and in Wireguard 10.9.0.3
When I turn off firewall in Asus I can ping it from Wireguard tunel.
BTW
This GUI addon isn't working ?
Specifically how did you set this up in wgm?
# mikrus
[Interface]
PrivateKey = My_key ;)
Address = 10.9.0.2/24
ListenPort = 21296
[Peer]
# mikrus
PublicKey = My_key ;)
AllowedIPs = 10.9.0.0/24,192.168.11.0/24,192.168.8.0/24
PersistentKeepalive = 25
Endpoint = fxxxxxxx.us:21296
# mikrus end
admin@RT-AC86U-97C0:/tmp/home/root# wg
interface: wg11
public key: My_key ;)
private key: (hidden)
listening port: 21296
peer: My_key ;)
endpoint: 6x.x.x.x9:21296
allowed ips: 10.9.0.0/24, 192.168.11.0/24, 192.168.8.0/24
latest handshake: 42 seconds ago. (sec:42)
transfer: 73.48 KiB received, 73.08 KiB sent
persistent keepalive: every 25 seconds
admin@RT-AC86U-97C0:/tmp/home/root#
E:Option ==> 3
interface: wg11 EndPoint=6x.x.x.x9:21296 10.9.0.2/24 # mikrus
peer: My_key ;)
latest handshake: 23 seconds ago. (sec:23)
transfer: 86.39 KiB received, 85.88 KiB sent 0 Days, 00:08:26 since Fri Feb 21 19:38:34 2025 >>>>>>
WireGuard® ACTIVE Peer Status: Clients 1, Servers 0
I used a server peer for this in wgm. While it's more messy to setup, it will automatically setup it more proper.I just imported this file in wgm:
Code:# mikrus [Interface] PrivateKey = My_key ;) Address = 10.9.0.2/24 ListenPort = 21296 [Peer] # mikrus PublicKey = My_key ;) AllowedIPs = 10.9.0.0/24,192.168.11.0/24,192.168.8.0/24 PersistentKeepalive = 25 Endpoint = fxxxxxxx.us:21296 # mikrus end
Now I have :
Code:admin@RT-AC86U-97C0:/tmp/home/root# wg interface: wg11 public key: My_key ;) private key: (hidden) listening port: 21296 peer: My_key ;) endpoint: 6x.x.x.x9:21296 allowed ips: 10.9.0.0/24, 192.168.11.0/24, 192.168.8.0/24 latest handshake: 42 seconds ago. (sec:42) transfer: 73.48 KiB received, 73.08 KiB sent persistent keepalive: every 25 seconds admin@RT-AC86U-97C0:/tmp/home/root#
Code:E:Option ==> 3 interface: wg11 EndPoint=6x.x.x.x9:21296 10.9.0.2/24 # mikrus peer: My_key ;) latest handshake: 23 seconds ago. (sec:23) transfer: 86.39 KiB received, 85.88 KiB sent 0 Days, 00:08:26 since Fri Feb 21 19:38:34 2025 >>>>>> WireGuard® ACTIVE Peer Status: Clients 1, Servers 0
What you need more?
10.9.0.x is my VPN
192.168.11.x is my OpenWRT router
192.168.8.x is my LTE modem connected to OpenWRT router
This part works good . I can connect them from my phone or PC using Wireguard app(tunel?).
Yes, please. I totaly noob in this .Would you need help to formulate the rules?
You can try to execute these directly at the shell prompt (exit wgm and amtm) when wg11 is up and running:Yes, please. I totaly noob in this .
iptables -I INPUT -i wg11 -j ACCEPT
iptables -I FORWARD -i wg11 -j ACCEPT
iptables -t nat -D POSTROUTING -s $(nvram get lan_ipaddr)/24 -o wg11 -j MASQUERADE -m comment --comment "WireGuard 'client'"
It works quite good using router IP 192.168.100.1 and it is OK for me but I can't connect using this IP 10.9.0.2 . This isn't important for me.You can try to execute these directly at the shell prompt (exit wgm and amtm) when wg11 is up and running:
Rule to allow incoming connections on wg11 to router itself:
Code:iptables -I INPUT -i wg11 -j ACCEPT
Rule to allow incoming connections on wg11 to lan:
delete masquarade rule:Code:iptables -I FORWARD -i wg11 -j ACCEPT
Code:iptables -t nat -D POSTROUTING -s $(nvram get lan_ipaddr)/24 -o wg11 -j MASQUERADE -m comment --comment "WireGuard 'client'"
Successful execution should not give any output. Do all commands work without error message?
After you executed these, do your access work? Note, if you restart wg11 you may need to re-remove the last rule.
If all works as you want we can look into have them automatically executed when peer starts/stop.
If you are attempting to access router gui it will never work using router wg address, it only listens to the lan ip.It works quite good using router IP 192.168.100.1 and it is OK for me but I can't connect using this IP 10.9.0.2 . This isn't important for me.
I would execute them automatically if you could help .
nano /jffs/addons/wireguard/Scripts/wg11-up.sh
#!/bin/sh
iptables -I INPUT -i wg11 -j ACCEPT
iptables -I FORWARD -i wg11 -j ACCEPT
iptables -t nat -D POSTROUTING -s $(nvram get lan_ipaddr)/24 -o wg11 -j MASQUERADE -m comment --comment "WireGuard 'client'"
chmod +x /jffs/addons/wireguard/Scripts/wg11-up.sh
nano /jffs/addons/wireguard/Scripts/wg11-down.sh
#!/bin/sh
iptables -D INPUT -i wg11 -j ACCEPT
iptables -D FORWARD -i wg11 -j ACCEPT
chmod +x /jffs/addons/wireguard/Scripts/wg11-down.sh
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!