Could not connect Port in Microsoft Azure Vm

2019-05-30 16:28发布

I have created Red Hat VM in Microsoft Azure and able to connect via ssh.

I have started Java server in VM with port 8081 and it started successfully. But I am not able view it in browser. Its doesn't get loaded.

I have tried the following and but all doesn't get loaded:-

host:80
host:8080
host:8081

I have added Inbound security rule in Network security Group and associated subnet to it. Still I am not able view my server in browser.

I have followed this document for inbound security rule

Here is my inbound ruleenter image description here

netstat -tuplen

(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name 
tcp 0 0 127.0.0.1:29131 0.0.0.0:* LISTEN 0 20864 - 
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 13894 - 
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 18132 - 
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 994 19499 - 
tcp6 0 0 :::111 :::* LISTEN 0 13893 - 
tcp6 0 0 :::8081 :::* LISTEN 1000 28721 3212/java 
tcp6 0 0 :::22 :::* LISTEN 0 18143 - 
tcp6 0 0 :::9080 :::* LISTEN 1000 28547 3212/java 
udp 0 0 0.0.0.0:68 0.0.0.0:* 0 16585 - 
udp 0 0 0.0.0.0:111 0.0.0.0:* 0 23825 - 
udp 0 0 127.0.0.1:323 0.0.0.0:* 995 15601 - 
udp 0 0 0.0.0.0:45876 0.0.0.0:* 0 16574 - 
udp 0 0 0.0.0.0:893 0.0.0.0:* 0 23826 - 
udp6 0 0 :::57126 :::* 0 16575 - 
udp6 0 0 :::111 :::* 0 23827 - 
udp6 0 0 ::1:323 :::* 995 15602 - 
udp6 0 0 :::893 :::* 0 23828 - 

ss -tln

State Recv-Q Send-Q Local Address:Port Peer Address:Port 
LISTEN 0 10 127.0.0.1:29131 *:* 
LISTEN 0 128 *:111 *:* 
LISTEN 0 128 *:22 *:* 
LISTEN 0 128 127.0.0.1:27017 *:* 
LISTEN 0 128 :::111 :::* 
LISTEN 0 50 :::8081 :::* 
LISTEN 0 128 :::22 :::* 
LISTEN 0 50 :::9080 :::* 

1条回答
smile是对你的礼貌
2楼-- · 2019-05-30 16:37

According to your screenshot, I notice that your service is listening on tcp6. Based on my knowledge, if the port only provides ipv6 service, you could not use IPv4 address to access.

I notice that you use jetty container, jetty use IPv6 by default. You could allow jetty force to use IPv4. There is a good answer about this.

查看更多
登录 后发表回答