Santivi
Santivi

Reputation: 11

Two Stun servers (coturn) with the same IP but different port

I'm trying to determine the mapping behaviour of a NAT using two STUN servers. I need two stun servers with the same IP but different port. I was wondering if it's possible to set up two coturn stun servers on the same host.

Upvotes: 1

Views: 543

Answers (1)

selbie
selbie

Reputation: 104539

Assuming your host as two or more valid IP addresses. In the examples below, let's assume the host has two public IP addresses: 1.2.3.4 and 1.2.3.5.

stuntman has this option to bind to multiple IP addresses if offered by the same host.

stunserver --mode full --primaryinterface 1.2.3.4 --altinterface 1.2.3.5

And if running in a NAT'd environment with port forwarding (such as AWS), you can specify the IP mappings such that the CHANGED_ADDRESS or (OTHER_ADDRESS) will be correct when it responds to STUN binding requests. Example:

stunserver --mode full --primaryinterface 10.0.0.4 --altinterface 10.0.0.5 --primaryadvertised 1.2.3.4 --altadvertised 1.2.3.5

Where 10.0.0.4 and 10.0.0.5 are the private LAN ip addresses of the host.

coturn appears to have the same option with the -L and -X options

turnserver -L 1.2.3.4 -L 1.2.3.5

With the -X option used to specify the advertised address in a NAT scenario.

Upvotes: 2

Related Questions