0

I am trying to connect to a webserver that is behind a NAT listening at port 4000.

On my webserver, using pystun (https://github.com/jtriley/pystun) and the command:

$ pystun -p 4000

I have a returned value of

NAT Type: Symmetric NAT External IP: <ip> External Port: 1024

But when I try to access it from http://:1024, I am not able to connet and its always stuck at waiting for response.

Is this the correct way of using STUN?

David C
  • 3,659
  • 5
  • 34
  • 46

1 Answers1

1

Your NAT has opened port (punched hole) only for your STUN server as it has seen outgoing packet for STUN while you have run "pystun". But when you are trying from somewhere else to reach to your webserver, your packet is unknown to the NAT. So NAT is silently discarding all incoming packets.

Note that, event though you are getting an external port from NAT while you are communicating with STUN server, because of it's symmetric type, this port will change to some other random port while the 4 tuple (src-address, src-port, dst-sddress, dst-port) changes.

Khaled
  • 670
  • 6
  • 18