# VPN Switch Script Fix?

**URL:** <https://forum.gl-inet.com/t/vpn-switch-script-fix/2091>\
**Category:** Router\
**Created:** [April 28, 2017, 6:59pm UTC](https://forum.gl-inet.com/t/vpn-switch-script-fix/2091 "2017-04-28T18:59:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsmith1985](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/j/838e76/32.png) [@jsmith1985](https://forum.gl-inet.com/u/jsmith1985)\
**Post date:** [April 28, 2017, 6:59pm UTC](https://forum.gl-inet.com/t/vpn-switch-script-fix/2091/1 "2017-04-28T18:59:27Z")

</div>

I’ve spent quite a while trying to get a VPN enable / disable working with the switch on the MT300N (BTN\_0) but I’m struggling.

I’ve done this by modifying the AR150 scripts posted in this thread (removing customisations to dhcp & network, and updating it for BTN\_0 for the MT300N).

The UI shows the vpn as connected but it won’t load any content (presumably due to setvpnfirewall). This instructions on [this post](https://www.gl-inet.com/forums/topic/vpn-switch/#post-50171) state to replace setvpnfirewall removing – from --force etc but this worked intermittently and also stopped the VPN from being enabled / disabled from the UI which likely relies on --.

I was wondering if there was a way to force VPN, which appears to run delete\_all\_forwarding & set\_vpn\_config commands, from the up script without interfering with setvpnfirewall or if any one has any better way to get a VPN switch working?

I’ve attached the files and setvpnfirewall below (You can test by copying / extracting VPN to root, chmod +x /vpn/config.sh then cd /vpn/ and ./config.sh)

---

<div class="post-metadata">

**Author:** ![alzhao](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@alzhao](https://forum.gl-inet.com/u/alzhao)\
**Post date:** [April 29, 2017, 9:57am UTC](https://forum.gl-inet.com/t/vpn-switch-script-fix/2091/2 "2017-04-29T09:57:27Z")

</div>

I still think it is the problem of setvpnfirewall. The correct syntax is as following. You didn’t add - - to disable.

Anyway, an updated firmware will be published soon and you can configure this in the UI directly.

```
setvpnfirewall --force
setvpnfirewall --disable
```

---

<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, 2:36am UTC](https://forum.gl-inet.com/t/vpn-switch-script-fix/2091/3 "2025-10-29T02:36:19Z")

</div>


