不使用telnet进行端口测试的方法
不使用telnet进行端口测试的方法
- 测试通过样例
-
[root@ip203 ~]# curl -v 10.0.0.210:8082 * About to connect() to 10.0.0.210 port 8082 (#0) * Trying 10.0.0.210... * Connected to 10.0.0.210 (10.0.0.210) port 8082 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.29.0 > Host: 10.0.0.210:8082 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: text/html < Cache-Control: no-cache < Content-Length: 938 < <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0, and the EPL 1.0 (https://h2database.com/html/license.html). Initial Developer: H2 Group --> <html><head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title>H2 Console</title> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> <script type="text/javascript"> location.href = 'login.jsp?jsessionid=08bd1aad6963961c7539fc4478a282a9'; </script> </head> <body style="margin: 20px;"> <h1>Welcome to H2</h1> <h2>No Javascript</h2> If you are not automatically redirected to the login page, then Javascript is currently disabled or your browser does not support Javascript. For this application to work, Javascript is essential. Please enable Javascript now, or use another web browser that supports it. </body></html> * Connection #0 to host 10.0.0.210 left intact [root@ip203 ~]#
-
- 测试不通过样例
-
[root@ip203 ~]# curl -v 10.0.0.210:8888 * About to connect() to 10.0.0.210 port 8888 (#0) * Trying 10.0.0.210... * 拒绝连接 * Failed connect to 10.0.0.210:8888; 拒绝连接 * Closing connection 0 curl: (7) Failed connect to 10.0.0.210:8888; 拒绝连接 [root@ip203 ~]#
原创文章,转载请说明出处,谢谢合作