I'm having some trouble with wg set
. It doesn't change peer's endpoint reliably.
I have a working wg tunnel to a VPN provider with peer's endpoint set to server A IP. There's another server B. I can switch to it just fine with uci
or luci. The wg interface is called wgclient
. I want to switch peer endpoint with wg set
. This sometimes works:
wg set wgclient peer server_public_key endpoint server_ip:server_port
When it works the peer endpoint changes just fine. There's a brief interruption in traffic and my tests show that traffic goes through the new endpoint.
However, in most of my attempts, wg
shows endpoint changed for a couple of seconds or not at all and then it starts displaying the old endpoint.
I would prefer to avoid using uci
to achieve this, as I don't need to have this switch be permanent.
Why wg set
doesn't just change the endpoint IP? What can I do to debug this further?
Here's my config:
config interface 'wgclient'
option proto 'wireguard'
option private_key '***'
list addresses '10.0.0.3'
option mtu '1420'
config wireguard_wgclient
option public_key 'server_public_key'
option preshared_key '###'
list allowed_ips '0.0.0.0/0'
option endpoint_host 'server_ip'
option endpoint_port 'server_port'
option persistent_keepalive '15'