What's new

Console cmd to Start/Stop/Restart OpenVpn/PPTP VPN server

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

svkviz

Occasional Visitor
Hi all,

can someone help me with console commands to start/stop/restart/status OpenVPN server and PPTP VPN server service? I am not familiar with it and service pptpd_start is not working :/ No luck with google also :/

Thank you
 
Hi all,

can someone help me with console commands to start/stop/restart/status OpenVPN server and PPTP VPN server service? I am not familiar with it and service pptpd_start is not working :/ No luck with google also :/

Thank you

First of all, what firmware are you running? The answer is completely different depending on whether you run stock, Asuswrt-Merlin, Tomato, DD-WRT, Padavan's, ...
 
my bad :/

sorry for that, of course it is different.
it is your latest released firmware 376.47 merlin build in RT-N66U device.

thx for your help.
 
OpenVPN server 1 (change the number for the second instance):
Code:
service stop_vpnserver1
service start_vpnserver1

PPTPD:
Code:
service stop_pptpd
service start_pptpd
 
Could you pls check one more time that code for start/stop pptp vpn server below is ok? When i check status at web gui after service start_pptpd, pptp vpn server is still stopped and i can not connect to it. When i start it from web gui, i havo no problem with connection. Code for start/stop OpenVpn server is working fine.

PPTPD:
Code:
service stop_pptpd
service start_pptpd

thanks.
 
Could you pls check one more time that code for start/stop pptp vpn server below is ok? When i check status at web gui after service start_pptpd, pptp vpn server is still stopped and i can not connect to it. When i start it from web gui, i havo no problem with connection. Code for start/stop OpenVpn server is working fine.

If the service is disabled then you won't be able to start it this way. You have to enable it first:

Code:
nvram set pptpd_enable=1
nvram commit
 
Well, i`ve tried to enable the service first:

Code:
nvram set pptpd_enable=1
nvram commit

and then start the service

Code:
service pptpd_start

the result is that, i still cannot connect to pptp server while the VPN SERVER TAB is indication that PPTP server IS running. VPN STATUS TAB is showing that PPTP server IS NOT running. When i reenable PPTP server on VPN SERVER TAB, i can connect normally. Maybe some other settings must be enabled???

thank`s for help.
 
Well, i`ve tried to enable the service first:

Code:
nvram set pptpd_enable=1
nvram commit

and then start the service

Code:
service pptpd_start

the result is that, i still cannot connect to pptp server while the VPN SERVER TAB is indication that PPTP server IS running. VPN STATUS TAB is showing that PPTP server IS NOT running. When i reenable PPTP server on VPN SERVER TAB, i can connect normally. Maybe some other settings must be enabled???

thank`s for help.

Read the command you typed, and re-read my post. You didn't type it correctly.
 
What are the commands for starting/stopping a VPN client on the stock firmware(3.0.0.4.380_7378)? I've tried:

Code:
service start_vpnclient5

But this yields the following in the logs:

Code:
Apr 12 11:13:12 rc_service: service 1786:notify_rc start
Apr 12 11:13:17 rc_service: service 1787:notify_rc start
Apr 12 11:13:26 rc_service: service 1790:notify_rc start_vpnclient5
Apr 12 11:13:27 openvpn[1804]: OpenVPN 2.3.2 arm-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [eurephia] [MH] [IPv6] built on Mar 15 2017
Apr 12 11:13:27 openvpn[1804]: ERROR: username from Auth authfile 'up' is empty
Apr 12 11:13:27 openvpn[1804]: Exiting due to fatal error

I noticed that when activating the VPN via the web gui, an /etc/openvpn directory is created with the vpnclient5 info, including an 'up' file and the client.ovpn file, etc. Once I deactivate it, that directory seems to go away. So I'm guessing I need to run a few more commands to mimic this behavior.

Thanks!
 
I would recheck the configuration, especially the username/password for that client. Running start_vpnclient5 will take care of populating the appropriate directories within /etc/openvpn/ .
 
I would recheck the configuration, especially the username/password for that client. Running start_vpnclient5 will take care of populating the appropriate directories within /etc/openvpn/ .

When I create the client profile in the router, I specify my username and password along with uploading my .ovpn file. Once uploaded, I notice that the vpn_client5_username and vpn_client5_password variables are empty in nvram. Should that be the case? They are populated when I activate the profile from the GUI, but not when I start from the command line. When I edit the client profile in the router, the username and password are persisted in the gui.

I tried to set these variables manually before starting via command line and that gets me a bit further in the logs, but I ultimately get the following. I'm guessing that there is also some other information pertinent to authentication that may be missing.

Regarding my OpenVPN configuration, I have the auth-user-pass directive set in my .ovpn.

Code:
Apr 12 14:17:21 openvpn[4636]: AUTH: Received control message: AUTH_FAILED
 
Last edited:
When I create the client profile in the router, I specify my username and password along with uploading my .ovpn file. Once uploaded, I notice that the vpn_client5_username and vpn_client5_password variables are empty in nvram. Should that be the case? They are populated when I activate the profile from the GUI, but not when I start from the command line. When I edit the client profile in the router, the username and password are persisted in the gui.

I tried to set these variables manually before starting via command line and that gets me a bit further in the logs, but I ultimately get the following. I'm guessing that there is also some other information pertinent to authentication that may be missing.

Regarding my OpenVPN configuration, I have the auth-user-pass directive set in my .ovpn.

Code:
Apr 12 14:17:21 openvpn[4636]: AUTH: Received control message: AUTH_FAILED

Maybe Asus's implementation works differently from mine them. While Asus originally reused my code, they did a few changes to it as they added it to the original firmware, so our implementations are slightly different now.
 
Maybe Asus's implementation works differently from mine them. While Asus originally reused my code, they did a few changes to it as they added it to the original firmware, so our implementations are slightly different now.

Thanks RMerlin, perhaps I'll flash yours back and try again. I originally had your firmware loaded (I love the selective routing), but I was having some issues with the OpenVPN client profile info (like OpenVPN IP Address) persisting despite deleting and loading new profiles (with different OpenVPN IP addresses). I'll post a new thread if I see the same behavior.

Thanks again!
 
Code:
service stop_vpnserver1
service start_vpnserver1

Firmware 380.69_2 on RT-AC68. Functionally, this has been working for me when used through ssh, but the UI of the VPN Server tab gets out of sync. Turning on the VPN, the UI updates to correctly reflect the new state. But when turning the VPN off, the VPN Server tab will still display it as ON. There is also a message...
Code:
"Initialinzing the settings of OpenVPN server now, please wait a few minutes to let the server to setup completed before VPN clients establish the connection"
... but this does now go away and persists after logout/login. Oddly, the VPN Status tab always shows the correct status.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top