# Start/stop wireguard by shell

**URL:** <https://forum.gl-inet.com/t/start-stop-wireguard-by-shell/10256>\
**Category:** Router\
**Created:** [March 25, 2020, 7:33am UTC](https://forum.gl-inet.com/t/start-stop-wireguard-by-shell/10256 "2020-03-25T07:33:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![antifascista](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/a/f07891/32.png) [@antifascista](https://forum.gl-inet.com/u/antifascista)\
**Post date:** [March 25, 2020, 7:33am UTC](https://forum.gl-inet.com/t/start-stop-wireguard-by-shell/10256/1 "2020-03-25T07:33:27Z")

</div>

Hi,  
I have a B-1300.  
In shell I run:  
uci set wireguard.@proxy[0].enable=‘0’  
uci commit wireguard  
/etc/init.d/wireguard stop  
Wireguard stopping correctly and in ui I can see the button connect.  
In shell I run:  
uci set wireguard.@proxy[0].enable=‘1’  
uci commit wireguard  
/etc/init.d/wireguard restart  
Wirguard starting but not connecting and in ui I can see error and button abort.  
I have to reboot router to connecting again by wireguard.  
Where is my error?  
Perhaps because I have several wireguard connection profile?  
thanks

---

<div class="post-metadata">

**Author:** ![antifascista](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/a/f07891/32.png) [@antifascista](https://forum.gl-inet.com/u/antifascista)\
**Post date:** [March 25, 2020, 5:32pm UTC](https://forum.gl-inet.com/t/start-stop-wireguard-by-shell/10256/2 "2020-03-25T17:32:21Z")

</div>

This is the output for stopping:  
root@GL-B1300:~# /etc/init.d/wireguard stop  
md5sum: can’t open ‘/etc/os-release’: No such file or directory

- Clearing IPv4 filter table
- Clearing IPv4 nat table
- Clearing IPv4 mangle table
- Clearing IPv4 raw table
- Populating IPv4 filter table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’
  - Rule ‘Allow-DHCP-Renew’
  - Rule ‘Allow-Ping’
  - Rule ‘Allow-IGMP’
  - Rule #7
  - Rule #8
  - Rule ‘guestzone\_DHCP’
  - Rule ‘guestzone\_DNS’
  - Rule ‘safe\_mode\_lan’
  - Rule ‘safe\_mode\_guest’
  - Forward ‘lan’ → ‘wan’
  - Forward ‘guestzone’ → ‘wan’

- Populating IPv4 nat table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Populating IPv4 mangle table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Populating IPv4 raw table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Clearing IPv6 filter table
- Clearing IPv6 mangle table
- Clearing IPv6 raw table
- Populating IPv6 filter table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’
  - Rule ‘Allow-DHCPv6’
  - Rule ‘Allow-MLD’
  - Rule ‘Allow-ICMPv6-Input’
  - Rule ‘Allow-ICMPv6-Forward’
  - Rule #7
  - Rule #8
  - Rule ‘guestzone\_DHCP’
  - Rule ‘guestzone\_DNS’
  - Rule ‘safe\_mode\_lan’
  - Rule ‘safe\_mode\_guest’
  - Forward ‘lan’ → ‘wan’
  - Forward ‘guestzone’ → ‘wan’

- Populating IPv6 mangle table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Populating IPv6 raw table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Set tcp\_ecn to off
- Set tcp\_syncookies to on
- Set tcp\_window\_scaling to on
- Running script ‘/etc/firewall.user’  
uci: Entry not found  
uci: Entry not found  
iptables: No chain/target/match by that name.  
iptables: No chain/target/match by that name.  
ipset v6.24: The set with the given name does not exist
- Running script ‘/var/etc/gls2s.include’  
! Skipping due to path error: No such file or directory
- Running script ‘/usr/bin/glfw.sh’
- Running script ‘/usr/sbin/glqos.sh’  
! Skipping due to path error: No such file or directory
- Running script ‘/var/etc/mwan3.include’
- Flushing conntrack table …  
/etc/rc.common: eval: line 1: =: not found  
Command failed: Not found  
killall: iface-mgr: no process killed  
cat: can’t open ‘/sys/class/net/ath0/address’: No such file or directory  
sh: bad number  
Interface doesn’t accept private ioctl…  
stafwd (8BE0): Invalid argument  
Error for wireless request “Set ESSID” (8B1A) :  
SET failed on device ath0 ; Invalid argument.  
sh: 0: unknown operand  
sh: 0: unknown operand  
OK  
Interface doesn’t accept private ioctl…  
setHwaddr (8BE4): Device or resource busy  
cat: can’t open ‘/sys/class/net/ath1/address’: No such file or directory  
sh: bad number  
Interface doesn’t accept private ioctl…  
stafwd (8BE0): Invalid argument  
Error for wireless request “Set ESSID” (8B1A) :  
SET failed on device ath1 ; Invalid argument.  
sh: 0: unknown operand  
sh: 0: unknown operand  
OK  
Interface doesn’t accept private ioctl…  
setHwaddr (8BE4): Device or resource busy  
Command failed: Not found  
uci: Entry not found  
rm: can’t remove ‘/tmp/dnsmasq.d/resolvfile’: No such file or directory  
cat: can’t open ‘/tmp/resolv.conf.vpn’: No such file or directory  
sh: bad number  
cat: can’t open ‘/tmp/resolv.conf.vpn’: No such file or directory  
cat: can’t open ‘/tmp/resolv.conf.vpn’: No such file or directory  
uci: Entry not found  
uci: Entry not found  
cat: can’t open ‘/tmp/resolv.conf.vpn’: No such file or directory  
uci: Entry not found

This is the outputo for restarting (not working):  
root@GL-B1300:~# /etc/init.d/wireguard restart  
uci: Entry not found  
uci: Entry not found  
uci: Entry not found  
uci: Entry not found  
uci: Entry not found  
uci: Entry not found  
uci: Entry not found

- Clearing IPv4 filter table
- Clearing IPv4 nat table
- Clearing IPv4 mangle table
- Clearing IPv4 raw table
- Populating IPv4 filter table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’
  - Rule ‘Allow-DHCP-Renew’
  - Rule ‘Allow-Ping’
  - Rule ‘Allow-IGMP’
  - Rule #7
  - Rule #8
  - Rule ‘guestzone\_DHCP’
  - Rule ‘guestzone\_DNS’
  - Rule ‘safe\_mode\_lan’
  - Rule ‘safe\_mode\_guest’
  - Forward ‘lan’ → ‘wan’
  - Forward ‘guestzone’ → ‘wan’

- Populating IPv4 nat table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Populating IPv4 mangle table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Populating IPv4 raw table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Clearing IPv6 filter table
- Clearing IPv6 mangle table
- Clearing IPv6 raw table
- Populating IPv6 filter table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’
  - Rule ‘Allow-DHCPv6’
  - Rule ‘Allow-MLD’
  - Rule ‘Allow-ICMPv6-Input’
  - Rule ‘Allow-ICMPv6-Forward’
  - Rule #7
  - Rule #8
  - Rule ‘guestzone\_DHCP’
  - Rule ‘guestzone\_DNS’
  - Rule ‘safe\_mode\_lan’
  - Rule ‘safe\_mode\_guest’
  - Forward ‘lan’ → ‘wan’
  - Forward ‘guestzone’ → ‘wan’

- Populating IPv6 mangle table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Populating IPv6 raw table
  - Zone ‘lan’
  - Zone ‘wan’
  - Zone ‘guestzone’

- Set tcp\_ecn to off
- Set tcp\_syncookies to on
- Set tcp\_window\_scaling to on
- Running script ‘/etc/firewall.user’  
uci: Entry not found  
uci: Entry not found  
iptables: No chain/target/match by that name.  
iptables: No chain/target/match by that name.  
ipset v6.24: The set with the given name does not exist
- Running script ‘/var/etc/gls2s.include’  
! Skipping due to path error: No such file or directory
- Running script ‘/usr/bin/glfw.sh’
- Running script ‘/usr/sbin/glqos.sh’  
! Skipping due to path error: No such file or directory
- Running script ‘/var/etc/mwan3.include’
- Flushing conntrack table …  
/etc/rc.common: eval: line 1: =: not found  
Command failed: Not found  
killall: iface-mgr: no process killed  
cat: can’t open ‘/sys/class/net/ath0/address’: No such file or directory  
sh: bad number  
Interface doesn’t accept private ioctl…  
stafwd (8BE0): Invalid argument  
Error for wireless request “Set ESSID” (8B1A) :  
SET failed on device ath0 ; Invalid argument.  
sh: 0: unknown operand  
sh: 0: unknown operand  
OK  
Interface doesn’t accept private ioctl…  
setHwaddr (8BE4): Device or resource busy  
cat: can’t open ‘/sys/class/net/ath1/address’: No such file or directory  
sh: bad number  
Interface doesn’t accept private ioctl…  
stafwd (8BE0): Invalid argument  
Error for wireless request “Set ESSID” (8B1A) :  
SET failed on device ath1 ; Invalid argument.  
sh: 0: unknown operand  
sh: 0: unknown operand  
OK  
Interface doesn’t accept private ioctl…  
setHwaddr (8BE4): Device or resource busy  
Command failed: Not found  
uci: Entry not found  
rm: can’t remove ‘/tmp/dnsmasq.d/resolvfile’: No such file or directory  
cat: can’t open ‘/tmp/resolv.conf.vpn’: No such file or directory  
sh: bad number  
cat: can’t open ‘/tmp/resolv.conf.vpn’: No such file or directory  
cat: can’t open ‘/tmp/resolv.conf.vpn’: No such file or directory  
uci: Entry not found  
uci: Entry not found  
cat: can’t open ‘/tmp/resolv.conf.vpn’: No such file or directory  
uci: Entry not found

---

<div class="post-metadata">

**Author:** ![antifascista](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/a/f07891/32.png) [@antifascista](https://forum.gl-inet.com/u/antifascista)\
**Post date:** [March 26, 2020, 12:59am UTC](https://forum.gl-inet.com/t/start-stop-wireguard-by-shell/10256/3 "2020-03-26T00:59:30Z")

</div>

I have revolver deleting  
uci set wireguard.@proxy[0].enable=‘0’  
uci set wireguard.@proxy[0].enable=‘1’  
during stop and start wireguard and it’s ok.

---

<div class="post-metadata">

**Author:** ![bruce](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bruce/32/35649_2.png) [@bruce](https://forum.gl-inet.com/u/bruce)\
**Post date:** [October 29, 2025, 4:10am UTC](https://forum.gl-inet.com/t/start-stop-wireguard-by-shell/10256/4 "2025-10-29T04:10:16Z")

</div>


