With this knowledge in hand, here’s what you do to start a VPN when the machine boots: This should give you a file called rktools.exe, which when executed will install the tools on your hard disk, including the three files you need which are mentioned in the KB article referenced above. You can download it from by searching for “Windows Server 2003 Resource Kit Tools”, which may or may not still be available at when you read this blog entry. The utility is described at, and although that article doesn’t mention Windows XP, it works just fine for XP as well. The key to the second part, getting Windows XP to run a batch file during reboot, is a utility called AutoExnt that Microsoft distributes for free but doesn’t include with Windows. If you run “rasdial connection-name username password” from the command line or a batch file, the specified connection will be started with the specified username and password. The key to the first part, starting a VPN from a batch file, is a Windows command-line tool called “rasdial”. I couldn’t find one I doubt there is one.Īfter that, I considered setting the “Set as Default Connection” checkbox for the connection, but I couldn’t find any documentation of exactly what that would do, and I was worried that another user of the machine might muck with that setting, perhaps with good reason.Īll I could think of at this point was to write a batch file that would start the VPN and then tell Windows to run that batch file on reboot. The first thing I tried was to look for a property I could set on the VPN network connection to tell Windows that I wanted this connection to start automatically when the machine boots. I eventually managed to assemble bits and pieces of information floating around the net into a working solution to the problem, but it wasn’t completely addressed in any single location, so I thought I’d stick the details in my blog for other people to Google and use (if you found this blog entry useful, please add a comment and let me know!). Reboot and test if it is working by checking the external IP.I recently needed to figure out how to make a Windows XP machine connect to a particular VPN automatically on reboot, before anyone logged into the machine. Start the OpenVPN service: sudo service start Reload the daemons: sudo systemctl daemon-reload ovpn file to ‘nf’: sudo mv /etc/openvpn/confyg.ovpn /etc/openvpn/nfĮnable the service with the following command: sudo systemctl enable In the ‘/etc/openvpn’ folder, create a text file called pass: sudo nano /etc/openvpn/passĪnd enter your VPN Account ID on the first line and VPN passwordon the 2nd line, then press Ctrl+ O followed by Enter to save the changes and Ctrl+ X to exit the text editor.Ĭhange the permissions on the pass file to protect the credentials: sudo chmod 400 /etc/openvpn/pass ovpn file you copied in the previous step and change the line ‘auth-user-pass’ to ‘auth-user-pass pass’: sudo nano /etc/openvpn/confyg.ovpn ovpn file with the desired server location to the ‘/etc/openvpn’ folder: sudo cp /location/whereYouDownloadedConfigfilesTo/confyg.ovpn /etc/openvpn/Įdit the. Then press Ctrl+ O followed by Enter to save the changes and Ctrl+ X to exit the text editor.Ĭopy the. Run the command: sudo nano /etc/default/openvpnĪnd uncomment, or remove, the “#” in front of AUTOSTART="all" In order to configure OpenVPN to autostart using systemd, complete the following steps:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |