Gli-net GL-MT300N-V2, connect and disconnect VPN client at commandline

Hello everybody,

First, I posted a message with the same question two days ago on the Gli-net forum but none answer !

I would like to know how to connect and disconnect the VPN client (like in the web interface).

I have tried the following commands with no success:

/etc/init.d/startvpn start
/etc/init.d/startvpn restart
/etc/init.d/openvpn start
/etc/init.d/openvpn restart

If someone on this forum own the same model of router and know how to do that, please, share the trick :exclamation:

Best regards

In OpenWrt the /etc/init.d/openvpn start and /etc/init.d/openvpn stop would do.

Perhaps, but this not the case with this model of router.
The mechanism seems to be different !

From what I can see when I click on the Connect button:

OpenVPN is launched and connected to the server
The firewall rules are updated
The network is restarted (I'm connected to the router by wifi and the connection is cut a few seconds before to be connected again)

When I click on the Disconnect button:
OpenVPN is disconnected form the server and stopped
The firewall rules are updated
Again the network is restarted (lost of connection to the router by wifi a few seconds)

Then I suggest you wait for an answer from GL-iNet, as this is OpenWrt forum.

This is just to increase my chances of getting an answer. :roll_eyes:

Hi
I have tested on my MT300N-V2 in ssh
uci set glconfig.openvpn.enable='1'
uci commit glconfig
/etc/init.d/startvpn restart

and
uci set glconfig.openvpn.enable='0'
uci commit glconfig
/etc/init.d/startvpn stop

It works for me.
The command are all in the script /usr/bin/switchaction

Hi,

Just tried at the moment and it works!

Many thanks to you! :smile:

I just want to write a script for launching or stopping the VPN client by SSH with plink from a remote computer without to have to be logged to the web interface.
Now this is possible.

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