Skip to content

Commit 95c6427

Browse files
committed
feat(Dockerfile): 增加网络诊断工具并更新文档
在Dockerfile中添加iputils-ping、nmap和mtr工具用于网络诊断 更新README.md文档,详细说明各网络工具的使用方法和示例
1 parent b9b36bc commit 95c6427

2 files changed

Lines changed: 24 additions & 6 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apt update && \
88
iproute2 \
99
socat \
1010
squid \
11-
curl net-tools dnsutils tcpdump \
11+
curl net-tools dnsutils tcpdump iputils-ping nmap mtr \
1212
ca-certificates && \
1313
# 清理缓存
1414
apt clean && \

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,33 @@ curl --proxy http://localhost:18080 https://ipinfo.io/ip
9595

9696
### 容器内网络诊断
9797

98-
容器内置网络工具包:
98+
容器内置以下网络工具包,可用于诊断和调试网络连接:
99+
100+
| 命令 | 功能描述 | 所属软件包 | 使用示例 |
101+
|------|----------|----------|
102+
| ping | 测试网络连通性 | iputils-ping | `ping 8.8.8.8` |
103+
| ifconfig | 查看/配置网络接口 | net-tools | `ifconfig tun0` |
104+
| netstat | 查看网络连接状态 | net-tools | `netstat -tuln` |
105+
| dig | DNS查询工具 | dnsutils | `dig google.com` |
106+
| nslookup | DNS域名解析 | dnsutils | `nslookup google.com` |
107+
| tcpdump | 网络抓包工具 | tcpdump | `tcpdump -i tun0` |
108+
| curl | HTTP客户端工具 | curl | `curl --proxy http://localhost:8000 https://ipinfo.io/ip` |
109+
| mtr | 网络连通性和路由跟踪工具 | mtr | `mtr 8.8.8.8` |
110+
| nmap | 网络扫描工具 | nmap | `nmap -sS 8.8.8.8` |
111+
112+
113+
使用方法:
99114
```bash
100115
docker exec -it vpn-proxy bash
101116

102-
# 诊断命令示例
103-
ping 8.8.8.8
104-
nslookup google.com
117+
# 示例:测试与目标服务器连通性
118+
ping $RDP_TARGET
119+
120+
# 示例:查看VPN接口配置
105121
ifconfig tun0
106-
curl --proxy http://localhost:8000 https://ipinfo.io/ip
122+
123+
# 示例:检查代理服务状态
124+
netstat -tuln | grep $SQUID_PORT
107125
```
108126

109127

0 commit comments

Comments
 (0)