question

BILALHANOUCH-0622 avatar image
0 Votes"
BILALHANOUCH-0622 asked ·

Issue with VPS B4MS (Public IP Address)

Hey, i have an issue i cannot use the public ip address within the azure vps. im running centos 6.8 and i have forwarded ALL ports inbound and outbound. i enabled static ip aswell but noone resolved my issues.


ok so. i have my own software written in C and GO and it uses the public IP Address and binds it to a port so i can access it, for example telnet on a custom port. and after i run the compiled software it gives me this error that i have never encountered before on any host providers, this is my first time on azure and i dont know what i can do anymore.


this is the error i get when trying to run the software.
listen tcp MYVPSPUBLICIP:PORT: bind: cannot assign requested address

if i use the local ip: 127.0.0.1 it works fine but i cannot connect to it thru the public ip outside the vps via PuTTy or MobaXTerm.

azure-virtual-machines
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ManuPhilip avatar image
0 Votes"
ManuPhilip answered ·

Hello,

The public IP can't be available to bind from your application running on Azure VM. There is an internal IP (Private IP) address also associated with the VM and Azure should have a Nat established between the internal IP and Public IP. So, when you configure the application to listen on Private IP, things will start work through Public IP too

Thanks,
Manu

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BILALHANOUCH-0622 avatar image
0 Votes"
BILALHANOUCH-0622 answered ·

ok so basically the private ip 10.0.0.5 will work? then i can use the public ip to access it am i right?

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

yes, that should work. Make sure that your firewall rules are active to pass the port traffic

Regards,
Manu

0 Votes 0 ·
BILALHANOUCH-0622 avatar image
0 Votes"
BILALHANOUCH-0622 answered ·

ok thanks!

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.