Linux系统测试端口连通性的方法
2017-12-19 21:03
519 查看
Linux系统测试端口连通性的方法
有四种常用方法:
1. telnet 方法
2. wget 方法
3. ssh 方法
4. curl 方法
下面一一介绍。
1. telnet
用法: telnet ip port
(1)连接不存在的端口
telnet 1.1.1.1 8
Trying 1.1.1.1...
telnet: connect to address 1.1.1.1: Connection timed out
(2)连接存在的端口
telnet 1.1.1.1 8000
Trying 1.1.1.1...
Connected to 1.1.1.1.
Escape character is '^]'.
Connection closed by foreign host.
2. wget
用法: wget ip:port
(1)连接不存在的端口
wget 1.1.1.1:8
--2017-01-24 11:38:34-- http://1.1.1.1:8/ Connecting to 1.1.1.1:8...
failed: Connection timed out. Retrying.
(2)连接存在的端口
wget 1.1.1.1:8000
--2017-01-24 11:39:03-- http://1.1.1.1:8000/
Connecting to 1.1.1.1:8000... connected.
HTTP request sent, awaiting response... 200 OK
3. ssh
用法: ssh -v -p port username@ip
-v 调试模式(会打印日志)
-p 指定端口
这里没有给出测试,留给读者自己测试。
4. curl
用法: curl ip:port
(1)连接不存在的端口
没有结果。
(2)连接存在的端口
curl 1.1.1.1:8000
<!DOCTYPE html>
<html>
<head>xxx</head>
<body>
......
</body>
</html>
有四种常用方法:
1. telnet 方法
2. wget 方法
3. ssh 方法
4. curl 方法
下面一一介绍。
1. telnet
用法: telnet ip port
(1)连接不存在的端口
telnet 1.1.1.1 8
Trying 1.1.1.1...
telnet: connect to address 1.1.1.1: Connection timed out
(2)连接存在的端口
telnet 1.1.1.1 8000
Trying 1.1.1.1...
Connected to 1.1.1.1.
Escape character is '^]'.
Connection closed by foreign host.
2. wget
用法: wget ip:port
(1)连接不存在的端口
wget 1.1.1.1:8
--2017-01-24 11:38:34-- http://1.1.1.1:8/ Connecting to 1.1.1.1:8...
failed: Connection timed out. Retrying.
(2)连接存在的端口
wget 1.1.1.1:8000
--2017-01-24 11:39:03-- http://1.1.1.1:8000/
Connecting to 1.1.1.1:8000... connected.
HTTP request sent, awaiting response... 200 OK
3. ssh
用法: ssh -v -p port username@ip
-v 调试模式(会打印日志)
-p 指定端口
这里没有给出测试,留给读者自己测试。
4. curl
用法: curl ip:port
(1)连接不存在的端口
没有结果。
(2)连接存在的端口
curl 1.1.1.1:8000
<!DOCTYPE html>
<html>
<head>xxx</head>
<body>
......
</body>
</html>
相关文章推荐
- linux 测试机器端口连通性方法
- 【转载】linux 测试机器端口连通性方法
- 测试Linux端口的连通性的四种方法
- linux 测试机器端口连通性方法
- Linux系统下怎么测试端口的连通性
- linux 测试机器端口连通性方法
- 查找linux系统下的端口被占用进程的两种方法
- linux系统打开telnet端口的方法
- 部门、测试-一个直观感性的方法认识linux的系统驱动架构-by小雨
- linux系统打开telnet端口的方法
- Linux 操作系统测试远程端口是否可达或本机端口是否打开方法
- 查找linux系统下的端口被占用进程的两种方法
- linux端口连通性测试【telnet、wget、ssh、curl】
- 在Linux系统下使用SSH实现端口映射的方法
- 查找linux系统下的端口被占用进程的两种方法 【转】
- 查找linux系统下的端口被占用进程的两种方法
- 通过Linux系统下iptables防火墙开启/关闭指定端口方法
- 在Linux系统下使用tespeed应用测试网速的方法
- 查找linux系统下的端口被占用进程的两种方法