Setting Up a STUN Server for Using with Brekeke SIP Server (C) 2002-2007, Brekeke Software, Inc. All rights reserved. Date: January 12, 2007 1. Introduction ~~~~~~~~~~~~~~~~~~~~~~ This document introduces an example of setting up a STUN server for use with the Brekeke SIP Server. 2. Installing a STUN server on a Linux Server ~~~~~~~~~~~~~~~~~~~~~~ (1) Visit http://sourceforge.net/projects/stun/. Download a Vovida Stun server (The package name is "stun") on a Windows PC. (2) Extract stund_0.XX_XXXXX.tgz file on a Windows PC. (Current version is stund_0.96_Aug13) (3) Open the "stund" folder and send the following files to the directory on the Linux Server where you want to install the STUN server (Ex. /var/stund). client.cxx Makefile server.cxx stun.cxx stun.h tlsServer.cxx udp.cxx udp.h (4) Go to the directory on the Linux Server (/var/stund) and issue the command #make After the compilation is finished, make sure that an executable file "server" is created. (5) Start a STUN server a) If the machine has two public IP addresses (2 NICs), issue the command #./server -h IP_address_1 -a IP_address_2 -b b) If the machine has only one public IP address, issue the command #./server -h IP_address -b Note: It is better to have two IP addresses (2 NICs) on the server so that UAs can know the NAT type correctly that they use. But having only one IP address seems to be enough for the UAs to know its global IP address and port number that the NAT opens for them. 2. Installing a STUN server on a Windows PC (1) Visit http://sourceforge.net/projects/stun/. Download a Vovida Stun server server.exe (The package name is "stun-win32") on a Windows PC and place it in some directory. (2) Open a command window and go to the directory where the server.exe resides. (3) Execute a command as follows a) If the machine has two public IP addresses (2 NICs), issue the command >server -h IP_address_1 -a IP_address_2 b) If the machine has only one public IP address, issue the command >server -h IP_address Note: It is better to have two IP addresses (2 NICs) on the server so that UAs can know the NAT type correctly that they use. But having only one IP address seems to be enough for the UAs to know its global IP address and port number that the NAT opens for them. 3. Testing with a UA (X-Lite) and Brekeke SIP Server (1) We assume your SIP Server is located in a public domain, either on the same machine as your STUN server or on the different machine, and your X-Lite (www.xten.com) resides in a LAN behind a NAT. (2) Open X-lite Menu -> [System Settings] -> [Network] Set [Primary STUN Server] = YOUR_STUN_SERVER_IP_ADDRESS (3) Open X-lite Menu -> [System Settings] -> [SIP Proxy]->[Defaults] [Username] = any_user_name [Domain/Realm] = Brekeke_SIP_Server_IP_address [SIP Proxy] = Brekeke_SIP_Server_IP_address Set also [Authorization User] and [Password] if authorization is set to "on" at Brekeke SIP Server. (4) Register your X-lite with Brekeke SIP Server. (5) Open Brekeke SIP Server Admintool. Go to [Registered] list. Please make sure if the UA's Contact URI is registered with a public IP address. If so, STUN server is working fine with the UA. (6) You can also check if the STUN server is working by capturing STUN packets using Ethereal on the machine that the UA is installed on.