Reputation: 383
I'm hoping someone can help with this.
I have an existing Azure Virtual Machine which has been running fine for ages. It has a single NIC with both a static Private and static Public IP Address.
I have been hosting a site in IIS for a long time bound to the (only) private IP Address on the machine, and everything has been dandy.
However, I wanted to add a second site, and because I'm using SSL and different certificates I wanted to use an alternative public IP Address.
I have created a new Public IP (static private and public address) and associated it with a new NIC. I have then added that NIC to my virtual machine.
I ALSO added Inbound rules on the Virtual Machine Networking settings to accept inbound traffic on ports 80 and 443 for BOTH NICs.
When I login to the VM I can see the new network adapter, and IPCONFIG is showing it has the correct static private IP address which I specified. So I setup the new IIS site, and added the bindings. For this "Hello World" proof of concept I have left the hostname and SSL bindings out. I just basically have it bound to the Private IP Address on Port 80.
Note - the "site" itself at this point is just a static "Hello World" HTML page. There is no managed code or any server-side or client-side funkiness of any kind.
So I basically have the following setup:
NIC 2
IIS Site 1
IIS Site 2
I can happily access BOTH sites locally on the machine (using http://10.0.1.4 and http://10.0.1.5 respectively).
However, accessing from the internet (i.e. from my home or work computers) if I try to access the original site on http://X.X.X.X it works fine.
But trying to access http://Y.Y.Y.Y just times out. I never get any kind of response.
I have tried using host name binding (with local HOSTS entries) but still get the same problem.
Phew .. ok I know that was a long(ish) post but is there some secret setting I'm missing somewhere? Or being stupid about this?
I always assumed that for a single NIC that the Public IP would route directly to the corresponding Private IP. Is this not the case??
Thanks in advance!!
EDIT Moving the public IP to a second IP Configuration on the first NIC seemed to do the trick.
As I don't have any real need to have more than one NIC this did the trick, although it did require me to manually add both fixed IP addresses to the IPv4 configuration of the network adapter in Windows
Upvotes: 2
Views: 2775
Reputation: 13954
Here a article about assign multiple IP addresses to VM, please refer to it.
Follow this article step by step, you can use two public IP addresses to RDP that VM.
Here is the screenshot of that VM, I can RDP that VM with two public IPs:
Maybe you can use this to achieve it.
Upvotes: 3