Open apsara2825 opened 4 months ago
Does this help?
这有帮助吗?
Thank you very much for your reply. I have followed your method carefully, but my ECS server can only be assigned one public IPV4, but there can be multiple private 192.168.0.0/16 addresses. Do you need two public addresses to achieve NAT type detection
Does this help? My server is not an elastic ECS. I tried to purchase an elastic public network, but it prompted me that I cannot bind to my ECS instance. This is too regrettable
Groan... I used to know how to do this quite well. But now it appears that Amazon has changed how to setup multi-network instances.
Ok, I see how to do this now. It's not obvious.
In the "Network Settings" panel for the instance configuration before you launch it... click "Edit"
Change the subnet option from "No preference" to an explicit selection.
That should activate the visibility of the "Advanced network configuration" drop down:
At the bottom of that expansion, there's a button for "Add network interface"
I forgot how I did this last year. But it appears that I use one elastic IP address and assigned that to the secondary adapter.
As for the Stunserver code itself. Explicitly use the
--primaryadvertised
and--altadvertised
command line parameter and specify the public ip addresses as each.Then use the
--primaryinterface
and--altinterface
command line parameters to specify which local (private) ip address the code should listen for.Example: