网络无法访问,但ping 工作

分享于 

4分钟阅读

互联网

  繁體

问题:


64 bytes from 172.26.64.176: icmp_seq=0 ttl=61 time=408.030 ms


64 bytes from 172.26.64.176: icmp_seq=1 ttl=61 time=275.114 ms


64 bytes from 172.26.64.176: icmp_seq=2 ttl=61 time=274.193 ms


64 bytes from 172.26.64.176: icmp_seq=3 ttl=61 time=274.785 ms


^C


--- 172.26.64.176 ping statistics ---


4 packets transmitted, 4 packets received, 0.0% packet loss


round-trip min/avg/max/stddev = 274.193/308.031/408.030/57.736 ms


HW15670:~ root#


HW15670:~ root# nc -v 172.26.64.176 80


nc: connectx to 172.26.64.176 port 80 (tcp) failed: Network is unreachable


HW15670:~ root# nc -v 172.26.64.176 80


nc: connectx to 172.26.64.176 port 80 (tcp) failed: Network is unreachable```



**On the target node Firewall is disabled and port 80 is listening.**



[root@asoksat-openstack bin]# systemctl status firewalld


● firewalld.service - firewalld - dynamic firewall daemon


 Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)


 Active: inactive (dead) since Sat 2021-01-09 19:54:31 UTC; 9h ago


 Docs: man:firewalld(1)


 Main PID: 896 (code=exited, status=0/SUCCESS)



Jan 09 19:48:57 asoksat.novalocal firewalld[896]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w -t nat -D OUTPUT' failed: i...ain?).


Jan 09 19:48:57 asoksat.novalocal firewalld[896]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w -t filter -X DOCKER' failed...links.


Jan 09 19:48:57 asoksat.novalocal firewalld[896]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w -t filter -X DOCKER-ISOLATI...links.


Jan 09 19:48:57 asoksat.novalocal firewalld[896]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w -t filter -F DOCKER-ISOLATI... name.


Jan 09 19:48:57 asoksat.novalocal firewalld[896]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w -t filter -X DOCKER-ISOLATI... name.


Jan 09 19:48:57 asoksat.novalocal firewalld[896]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w -D FORWARD -i docker0 -o do...ain?).


Jan 09 19:48:58 asoksat.novalocal firewalld[896]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w -D FORWARD -i docker0 -o do...ain?).


Jan 09 19:48:58 asoksat.novalocal firewalld[896]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w -D FORWARD -i br-252667b83f...ain?).


Jan 09 19:54:30 asoksat.novalocal systemd[1]: Stopping firewalld - dynamic firewall daemon...


Jan 09 19:54:31 asoksat.novalocal systemd[1]: Stopped firewalld - dynamic firewall daemon.


Hint: Some lines were ellipsized, use -l to show in full.


[root@asoksat-openstack bin]# sestatus


SELinux status: disabled


[root@asoksat-openstack bin]# netstat -tulnp | grep 80


tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 15463/docker-proxy



**Further below are curl outputs port 22 is working but 80 is not**



HW15670:~ root# curl -v telnet://172.26.64.176:80


* Rebuilt URL to: telnet://172.26.64.176:80/


* Trying 172.26.64.176...


* TCP_NODELAY set


* Connection failed


* connect to 172.26.64.176 port 80 failed: Network is unreachable


* Failed to connect to 172.26.64.176 port 80: Network is unreachable


* Closing connection 0


curl: (7) Failed to connect to 172.26.64.176 port 80: Network is unreachable


HW15670:~ root# curl -v telnet://172.26.64.176:22


* Rebuilt URL to: telnet://172.26.64.176:22/


* Trying 172.26.64.176...


* TCP_NODELAY set


* Connected to 172.26.64.176 (172.26.64.176) port 22 (#0)





答案1:

执行以下步骤来识别问题。

  • 尝试以正确的方式curl:curl -vvv 172.26.64.176
  • 尝试使用telnet端点:telnet 172.26.64.176 80
  • 使用:检查通信路由:route -n

希望它能解决你的问题。



相关文章