File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 && \
Original file line number Diff line number Diff 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
100115docker 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接口配置
105121ifconfig tun0
106- curl --proxy http://localhost:8000 https://ipinfo.io/ip
122+
123+ # 示例:检查代理服务状态
124+ netstat -tuln | grep $SQUID_PORT
107125```
108126
109127
You can’t perform that action at this time.
0 commit comments