Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If I use the external IP the binding test fails : What am I doing wrongly? How to correctly obtain Mapped Address from Stunman Server? #41

Open
raphael10-collab opened this issue Jul 22, 2021 · 4 comments

Comments

@raphael10-collab
Copy link

I compiled in Ubuntu 20.04 stunserver.
Now I'm trying to understand how to make it properly work.

If I use the IP of the local network, then the binding test succeed.

(base) raphy@pc:~/stunserver$ ./stunclient --mode behavior 192.168.1.7 --verbosity 9
Resolved 192.168.1.7 to 192.168.1.7:0
config.fBehaviorTest = true
config.fFilteringTest = false
config.timeoutSeconds = 0
config.uMaxAttempts = 0
config.addrServer = 192.168.1.7:3478
socketconfig.addrLocal = 0.0.0.0:0
Sending message to 192.168.1.7:3478
Got response (56 bytes) from 192.168.1.7:3478 on interface 192.168.1.7:38521
Binding test: success
Local address: 192.168.1.7:38521
Mapped address: 192.168.1.7:38521
Behavior test: success
Nat behavior: Direct Mapping

If I use the external IP , then the binding test fails :

(base) raphy@pc:~/stunserver$ ./stunclient --mode behavior 109.116.136.120 --verbosity 9
Resolved 109.116.136.120 to 109.116.136.120:0
config.fBehaviorTest = true
config.fFilteringTest = false
config.timeoutSeconds = 0
config.uMaxAttempts = 0
config.addrServer = 109.116.136.120:3478
socketconfig.addrLocal = 0.0.0.0:0
Sending message to 109.116.136.120:3478
Continuing to wait for response...
Continuing to wait for response...
Continuing to wait for response...
Continuing to wait for response...
Continuing to wait for response...
Sending message to 109.116.136.120:3478
Continuing to wait for response...
Continuing to wait for response...
Continuing to wait for response...
Continuing to wait for response...
Continuing to wait for response...
Binding test: fail
Behavior test: fail

What am I doing wrongly? How to correctly obtain Mapped Address from Stunman Server?

@jselbie
Copy link
Owner

jselbie commented Jul 23, 2021 via email

@raphael10-collab
Copy link
Author

Hi @jselbie ! Thank you for your kind prompt reply and interesting explanation.

Actually, what I'm trying to do, is to "simulate" and "emulate" in a local environment, what I will then deploy in a larger mixed, local + cloud, environment.
I've created within my local Ubuntu 20.04 a Linux Container, that I called "ubuntuone" with Ubuntu 20.04 as well.
Within this Linux Container I installed stunserver :

(base) raphy@pc:~$ lxc exec ubuntuone -- /bin/bash
root@ubuntuone:~# cd stunserver/
root@ubuntuone:~/stunserver# ./stunserver 

root@ubuntuone:~/stunserver# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.65.116.195  netmask 255.255.255.0  broadcast 10.65.116.255
        inet6 fe80::216:3eff:fe5b:de10  prefixlen 64  scopeid 0x20<link>
        inet6 fd42:2159:3d69:bcae:216:3eff:fe5b:de10  prefixlen 64  scopeid 0x0<global>
        ether 00:16:3e:5b:de:10  txqueuelen 1000  (Ethernet)
        RX packets 18298  bytes 9488015 (9.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20985  bytes 10002524 (10.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 27  bytes 2537 (2.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27  bytes 2537 (2.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@ubuntuone:~/stunserver# 

If I "call" from the outer system the contained stunserver I do not get any errors :

(base) raphy@pc:~/stunserver$ ./stunclient --mode behavior 10.65.116.195 --verbosity 9
Resolved 10.65.116.195 to 10.65.116.195:0
config.fBehaviorTest = true
config.fFilteringTest = false
config.timeoutSeconds = 0
config.uMaxAttempts = 0
config.addrServer = 10.65.116.195:3478
socketconfig.addrLocal = 0.0.0.0:0
Sending message to 10.65.116.195:3478
Got response (56 bytes) from 10.65.116.195:3478 on interface 10.65.116.1:33876
Binding test: success
Local address: 10.65.116.1:33876
Mapped address: 10.65.116.1:33876
Behavior test: success
Nat behavior: Direct Mapping

Does this sound correct to you, or am I making things more complicated than they could be, keeping in mind that my objective is to emulate and simulate locally what I will deploy in a broader environment?

@jselbie
Copy link
Owner

jselbie commented Jul 25, 2021

This is one of those things where I would really need to see a complete picture or diagram of your network topology before I could give a correct answer. It might be a simple command line switch or network configuration change. But it's rather unusual what you are doing.

What are you really trying to do?

@raphael10-collab
Copy link
Author

raphael10-collab commented Jul 26, 2021

I sketched a representation of the network I have in mind.

Doing it, I actually realized that trying to simulate locally what it is not by its nature, is not that clever and even possible.

NetworkRepresentation

So, even if I'm departing from my original issue's subject, I ask you: based on your experience, how would you test, may be using cloud services providers (AWS, Azure,...) this kind of network topology?
Thank you in advance for your kind help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants