问题
I set up an Azure ubuntu VM, created the network security group, added port 80 and 8888 rules. firewall is inactive. associated nsg to the subnet of the VM. Not able to remote connect to port 8888, but telnet to port 80 ok, and port 8080 also ok, even though there is no rule allowing 8080. I experimented and removed port 80 inbound rule, but still can access port 80.
netstat -ant | grep 8888 shows one process is listening tcp 0 0 127.0.0.1:8888 0.0.0.0:* LISTEN
It just appears that the access is not following my inbound rules but obeying some default. What can it be doing?
回答1:
As you said, your service is listening on 127.0.0.1
, the service is only accessed inside VM.
You should set your service listen on 0.0.0.0
or VM's private IP.
回答2:
Four reasons:
- Firewall on VM level.
- No application listening on said ip\port.
- Network security group attached to the vm\subnet blocking traffic.
- Azure Firewall (highly unlikely, preview feature).
You appear to be rocking case number 3. How to edit NSG.
来源:https://stackoverflow.com/questions/51413031/can-not-access-azure-vm-thru-port-8888