stunserver icon indicating copy to clipboard operation
stunserver copied to clipboard

Install guide

Open ph4t0o0o0om opened this issue 6 years ago • 3 comments

how to install

ph4t0o0o0om avatar Nov 08 '18 07:11 ph4t0o0o0om

Like most Linux and Unix source code distributions, "installation" is an administrative task that is typically considered external to the code itself. But I'm sure most folks new to Linux administration would appreciate some hints so they can get their job done.

Typical steps are the following

  1. Download the code and build it. Follow the instructions in the README file.
  2. After building, copy stunserver and stunclient binaries to /usr/bin
  3. This next step varies widely between Linux distros. Make it so that the stunserver runs on reboot - add a script to /etc/rc.local. For example, this is the script on stun.stunprotocol.org for rc.local:
#!/bin/sh -e
/usr/bin/stunserver --configfile /etc/stun.conf &
exit 0

jselbie avatar Nov 08 '18 19:11 jselbie

how to install on windows?

ph4t0o0o0om avatar Nov 09 '18 03:11 ph4t0o0o0om

Download the pre-compiled Windows binaries from www.stunprotocol.org.

Unzip the download package to a local directory. (e.g. c:\stunserver)

Open a console window and cd to the directory in which stunserver.exe is located (where you unzipped to.

Run "stunserver.exe --help" from the command line. You'll see it document all the options for itself.

Now run "stunserver.exe" with no command line options. You'll think the program is actually hung, but in fact, it's running. Run "stunclient.exe localhost" from another console window to validate the server is running.

Make sure the Windows firewall is configured to allow traffic. If the firewall dialog didn't prompt to open a port the first time you ran stunserver.exe, do the following. From the Windows Firewall in Control Panek, set an explicit rule to allow UDP ports 3478 and 3479. Or just a rule that enables "stunserver.exe" to have a global firewall exception (this is the preferred option).

Now after you get comfortable with starting and stopping the server program in a console window, you probably want to run stunserver.exe as a windows service such that it doesn't require logging in or manually starting. You can Google "run any program as a windows service" for utilities that will convert any console application to install and run as a Windows service.

Here's a link with some good suggestions: https://stackoverflow.com/questions/3582108/create-windows-service-from-executable

I think I've had success with NSSM before.

jselbie avatar Nov 09 '18 05:11 jselbie