Issue with VPS B4MS (Public IP Address)

BILAL HANOUCH 21 Reputation points
2020-05-15T19:38:21.327+00:00

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
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,202 questions
0 comments No comments
{count} votes

Accepted answer
  1. Manu Philip 16,991 Reputation points MVP
    2020-05-16T11:20:41.94+00:00

    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


0 additional answers

Sort by: Most helpful