Vovida.org STUN server

The STUN (Simple Traversal of UDP through NATs (Network Address Translation)) server is an implementation of the STUN protocol that enables STUN functionality in SIP-based systems. The STUN server tar ball also include a client API to enable STUN functionality in SIP endpoints. In adition ther is a command line UNIX cleint and a graphical windows client that check what type of NAT the user is using.

STUN is an application-layer protocol that can determine the public IP and nature of a NAT device that sits between the STUN client and STUN server.

The current version of the code supports most of RFC 3489 except the ability to get OTPs from the server.

Short instructions on setting up STUN server version 0.94

1. Download and compile the source obtained from the above links.
2. The server binary is known as "server", on the same note the client binary is known as "client".
3. You must have two IPs bound to the machine that you want to setup the STUN server on or, use two different machines. Preferrably, you would setup the STUN server to have the IPs on the local machine through ifconfig.
4. After setting up both IPs, type the following on the command line:

./server -v -h primary-ip -a secondary-ip -b

-v will cause the server to give you verbose output for testing
-b will cause the server to go into the background and not close when you close the shell.

Next, you can test the server by using the client program included called client.

STUN server version 0.94
./server -v -h / -h IP_Address -a IP_Address -p port -o port -m mediaport

If the IP addresses of your NIC are and, run this program with
./server -v -h -a
STUN servers need two IP addresses and two ports, these can be specified with:
-h sets the primary IP
-a sets the secondary IP
-p sets the primary port and defaults to 3478
-o sets the secondary port and defaults to 3479
-b makes the program run in the backgroud
-m sets up a STERN server starting at port m
-v runs in verbose mode

patch to support stund work behind NAT

You can set up STUN server to work on internal network by specifying mapped (natted) external IPs:
-e (patch) sets the primary (e)xternal IP
-s (patch) sets the (s)econdary external IP

Patch also addresses compilation error on x86_64 architecture.

Created by: oej, Last modification: Fri 16 of Sep, 2011 (14:10 UTC) by latv
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+