[HOWTO] STUN
Tested on: Fedora Core 2 2.6.5-1.358smp, Vovida stund_0.96
What is STUN?
STUN or Simple Traversal of UDP over NAT is a type of network protocol that helps clients behind NAT to identify their public IP. This is one of the solutions used to overcome the famous VoIP NAT issue.
The STUN server gonna be used is provided by Vovida , it requires two NIC (each NIC with different IP) for the STUN server to work.
1.0 Getting the package
Download stun from here
# mkdir -p /usr/src/stun
# cd /usr/src/stun
# wget http://switch.dl.sourceforge.net/sourceforge/stun/stund_0.96_Aug13.tgz
This is a pretty simple stand alone program, all you need to do is just untar, compile and run it.
# tar zxvf stund_0.96_Aug13.tgz
# cd stund
# make
At this point, there should be two executable files in /usr/src/stun/stund/ name `client` and `server`. `server` is the program going to do translation job whereas, `client` is meant to test if the `server` is working fine.
2.0 Firing up the server
To run the server execute the command below:
# /usr/src/stun/stund/server -b -h [primary ip] -a [secondary ip]
You will probably be annoyed by the * that keeps popping up on the console. What I did was exiting the console and firing it up again.
Replace the primary and secondary IP with the IPs you set in your NICs. Here are some explanation of parameters used in the command above
-b to tell stun server to run on background mode after console closed
-h primary IP
-a secondary IP
For further explanation you can execute --help parameter.
3.0 Is it really working?
You can test whether or not is working with the `client` program you have compile when executing the `make` command. Here is how you should run the `client` program
# /usr/src/stun/stund/client
STUN client version 0.96
Primary: Open
Return value is 0x000001
The result should be as above. If the STUN server ain't running you will get the result below
STUN client version 0.96
Primary: Blocked or could not reach STUN server
Return value is 0x00001c
Alternatives you can use programs like `netstat` and `ngrep` to check the connections to the STUN server. Example:
# netsat -an | grep 3478
This is to check whether the port 3478 ( STUN default port ) is open or not
# ngrep port 3478
This will monitor incoming STUN connections ( Required to install `ngrep`)
What is STUN?
STUN or Simple Traversal of UDP over NAT is a type of network protocol that helps clients behind NAT to identify their public IP. This is one of the solutions used to overcome the famous VoIP NAT issue.
The STUN server gonna be used is provided by Vovida , it requires two NIC (each NIC with different IP) for the STUN server to work.
1.0 Getting the package
Download stun from here
# mkdir -p /usr/src/stun
# cd /usr/src/stun
# wget http://switch.dl.sourceforge.net/sourceforge/stun/stund_0.96_Aug13.tgz
This is a pretty simple stand alone program, all you need to do is just untar, compile and run it.
# tar zxvf stund_0.96_Aug13.tgz
# cd stund
# make
At this point, there should be two executable files in /usr/src/stun/stund/ name `client` and `server`. `server` is the program going to do translation job whereas, `client` is meant to test if the `server` is working fine.
2.0 Firing up the server
To run the server execute the command below:
# /usr/src/stun/stund/server -b -h [primary ip]
You will probably be annoyed by the * that keeps popping up on the console. What I did was exiting the console and firing it up again.
Replace the primary and secondary IP with the IPs you set in your NICs. Here are some explanation of parameters used in the command above
-b to tell stun server to run on background mode after console closed
-h primary IP
-a secondary IP
For further explanation you can execute --help parameter.
3.0 Is it really working?
You can test whether or not is working with the `client` program you have compile when executing the `make` command. Here is how you should run the `client` program
# /usr/src/stun/stund/client
STUN client version 0.96
Primary: Open
Return value is 0x000001
The result should be as above. If the STUN server ain't running you will get the result below
STUN client version 0.96
Primary: Blocked or could not reach STUN server
Return value is 0x00001c
Alternatives you can use programs like `netstat` and `ngrep` to check the connections to the STUN server. Example:
# netsat -an | grep 3478
This is to check whether the port 3478 ( STUN default port ) is open or not
# ngrep port 3478
This will monitor incoming STUN connections ( Required to install `ngrep`)


0 Comments:
Post a Comment
<< Home