使用 curl 进行端口测试的方法
</html>[root@LAPTOP-CHOA4ICV ~]# curl -v 192.168.31.171:81
* About to connect() to 192.168.31.171 port 81 (#0)
* Trying 192.168.31.171...
* Connected to 192.168.31.171 (192.168.31.171) port 81 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 192.168.31.171:81
> Accept: */*
>
[root@LAPTOP-CHOA4ICV ~]
* About to connect() to 192.168.31.171 port 81 (
* Trying 192.168.31.171...
* Connection refused
* Failed connect to 192.168.31.171:81; Connection refused
* Closing connection 0
curl: (7) Failed connect to 192.168.31.171:81; Connection refused
[root@LAPTOP-CHOA4ICV ~]