Restart wireguard interface

Hello!
How can I restart a wireguard interface?
If I add a peer it could not be used unless restarting the whole network.

Thank you in advance,
Robert

Yes, I believe that this is still an issue even with the latest versions (as of this writing). I just issue the command /etc/init.d/network restart or I restart the whole router. I haven't tried it recently, but you might be able to "Restart" the wireguard interface via LuCI (Network > interfaces; I don't know if this also just calls the same network restart, or if it is a unique interface specific action, I don't know what equivalent CLI command(s) would be invoked here.

I have been able to restart wireguard with changes to peer configs using this method.

1 Like

Thank you for your answer!

I need it for a script so luci is no option...

Thank you anyway,

Robert

Fair enough. Hopefully someone knows exactly what is invoked when that button is pressed. In theory, every standard action in LuCI can be directly mapped to CLI command(s), so it should be possible to put that into a script once the specifics are known (maybe its s just an ifdown/ifup script?)

1 Like

I thought with newer OpenWrt versions (19.07+) just an ifdown/ifup on the interface was enough.

1 Like

I think too that the ifup WG_IF_NAME is enough, no need for ifdown first.

2 Likes

I've just tested ifup WG_IF_NAME on 19.07.2 and it works...
I really thought I tested it some time ago.
Maybe there was a bug on that version i tested before or my brain got weak.

Sorry for that again!

Robert

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.