azurecloudazure-virtual-machineinbound-security-rule

Accessing Azure VM port from Outside of VM


As we know there are simple steps to give access to any VM-port from outside.

Here is the steps I have already covered :

  1. Open VM instance and run the server on port 80 and checked the localhost is running in the local browse,
  2. added port 80 in the inbound of Network security group,
  3. turned off all three types of firewall from the VM windows.

enter image description here

Still the public ip is not accisible from the outside. Ping ... is resulting "Request timeout" or the port "80" is not accessible from the browser using public IP.

Edit : Surprisingly i have found a Deny tag in the report ! Does it matter ?


Solution

  • Normally, add port 80 to NSG inbound rules and turn off VM's windows firewall, we will access website from outside.

    In your scenario, maybe we should check web site work on IPv4 or IPv6 or both? We can use this command to check it:

    C:\Users\jason>netstat -ant
    Active Connections
    
      Proto  Local Address          Foreign Address        State           Offload State
    
      TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       InHost
      TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       InHost
      TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       InHost
      TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING       InHost
      TCP    [::]:80                [::]:0                 LISTENING       InHost
      TCP    [::]:135               [::]:0                 LISTENING       InHost
      TCP    [::]:445               [::]:0                 LISTENING       InHost
      TCP    [::]:3389              [::]:0                 LISTENING       InHost
    

    We can find web service listen on port 80 and work on IPv4 and IPv6, so we can use IPv4(public IP address) and port 80 to access this web site.

    We should make sure web service work on IPv4.

    ==========================

    Update:

    Please check your Vnet-->subnet, does this subnet associated with a NSG, if yes, we should modify this NSG's inbound rules, add port 80 to this NSG.

    It seems a issue with node server for angular cli, more information please refer to this link below: https://github.com/angular/angular-cli/issues/1793