Sign inSign up

skopac/pystun3

By skopac

Updated about 2 years ago

A Python STUN client for getting NAT type and external IP.

Image
Networking
0

379

skopac/pystun3 repository overview

Image

Wrapper for pystun3.

Supports all pystun3 parameters. Supports amd64 and arm64.

Examples:

docker run skopac/pystun3:latest
docker run skopac/pystun3:latest --help
docker run skopac/pystun3:latest -p 30000
docker run --net host skopac/pystun3:latest

Kubectl run

kubectl run pystun3 --image=skopac/pystun3

K8s manifest

apiVersion: apps/v1
kind: Deployment
metadata:
  name: pystun3
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pystun3
  template:
    metadata:
      labels:
        app: pystun3
    spec:
      containers:
        - name: pystun3
          image: skopac/pystun3:latest
          imagePullPolicy: IfNotPresent

Example output

NAT Type: Full Cone
External IP: 34.70.47.115
External Port: 54320

How it works

  1. Request: The STUN client sends a binding request to a STUN server.
  2. Response: The STUN server receives the request and replies with a binding response, which includes the client's public IP address and port as seen by the server.
  3. NAT Type Detection: By comparing the public IP and port with the client's private IP and port, the STUN client can deduce the type of NAT (e.g., full cone, restricted cone, port-restricted cone, or symmetric).

Need Full Cone NAT in EKS?

See here: https://superuser.com/a/1901393/375210

Tag summary

Content type

Image

Digest

sha256:131d6ad05

Size

47.6 MB

Last updated

about 2 years ago

docker pull skopac/pystun3