# Restart wireguard interface

**URL:** <https://forum.openwrt.org/t/restart-wireguard-interface/58037>\
**Category:** Installing and Using OpenWrt\
**Created:** [March 19, 2020, 4:54pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037 "2020-03-19T16:54:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rwalli](https://forum.openwrt.org/user_avatar/forum.openwrt.org/rwalli/32/34313_2.png) [@rwalli](https://forum.openwrt.org/u/rwalli)\
**Post date:** [March 19, 2020, 4:54pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/1 "2020-03-19T16:54:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![psherman](https://forum.openwrt.org/letter_avatar/psherman/32/6_449c533f586939b6e5f246632a46421f.png) [@psherman](https://forum.openwrt.org/u/psherman)\
**Post date:** [March 19, 2020, 5:18pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/2 "2020-03-19T17:18:10Z")

</div>

> [@rwalli](#):
>
> If I add a peer it could not be used unless restarting the whole network.

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.

---

<div class="post-metadata">

**Author:** ![krazeh](https://forum.openwrt.org/user_avatar/forum.openwrt.org/krazeh/32/21639_2.png) [@krazeh](https://forum.openwrt.org/u/krazeh)\
**Post date:** [March 19, 2020, 5:20pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/3 "2020-03-19T17:20:20Z")

</div>

> [@psherman](#):
>
> but you might be able to "Restart" the wireguard interface via LuCI (Network \> interfaces;

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

---

<div class="post-metadata">

**Author:** ![rwalli](https://forum.openwrt.org/user_avatar/forum.openwrt.org/rwalli/32/34313_2.png) [@rwalli](https://forum.openwrt.org/u/rwalli)\
**Post date:** [March 19, 2020, 5:25pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/4 "2020-03-19T17:25:47Z")

</div>

Thank you for your answer!

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

Thank you anyway,

Robert

---

<div class="post-metadata">

**Author:** ![psherman](https://forum.openwrt.org/letter_avatar/psherman/32/6_449c533f586939b6e5f246632a46421f.png) [@psherman](https://forum.openwrt.org/u/psherman)\
**Post date:** [March 19, 2020, 5:32pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/5 "2020-03-19T17:32:01Z")

</div>

> [@rwalli](#):
>
> I need it for a script so luci is no option...

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?)

---

<div class="post-metadata">

**Author:** ![Borromini](https://forum.openwrt.org/letter_avatar/borromini/32/6_449c533f586939b6e5f246632a46421f.png) [@Borromini](https://forum.openwrt.org/u/Borromini)\
**Post date:** [March 19, 2020, 5:38pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/6 "2020-03-19T17:38:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![trendy](https://forum.openwrt.org/user_avatar/forum.openwrt.org/trendy/32/8800_2.png) [@trendy](https://forum.openwrt.org/u/trendy)\
**Post date:** [March 19, 2020, 6:04pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/7 "2020-03-19T18:04:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rwalli](https://forum.openwrt.org/user_avatar/forum.openwrt.org/rwalli/32/34313_2.png) [@rwalli](https://forum.openwrt.org/u/rwalli)\
**Post date:** [March 19, 2020, 6:20pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/8 "2020-03-19T18:20:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.openwrt.org/uploads/default/original/3X/7/4/740520c71f00039bbf001045c682f0ecb25e905a.png) [@system](https://forum.openwrt.org/u/system)\
**Post date:** [March 29, 2020, 6:20pm UTC](https://forum.openwrt.org/t/restart-wireguard-interface/58037/9 "2020-03-29T18:20:44Z")

</div>

Closed on March 29, 2020, 6:20pm UTC

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