-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用文档中的 ip forward 但是宿主机不能 ping 通目标网络 #335
Comments
同问 ip route设置好以后 不能访问 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在使用
usage.md
中的 ip forward 时遇到一些问题,系统 Ubuntu Server 23.10,Docker version 24.0.5, build ced0996,使用 cli 版本的镜像。启动容器以及添加透明代理使用的脚本部分内容如下:容器成功启动后,容器内部能够成功 ping 通目标网络,但是宿主机不能正常访问到目标网络。其它的一些宿主机应用是可以通过代理访问的,例如我为 ssh 配置了代理
ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p
是能够成功通过代理连接目标网络的。我不太明白是哪里没有配置对,导致宿主机不能 ping 通目标网络,例如还需要配置 snat 等,还是我对透明代理这种方案的理解有问题。启动时的日志见下:
使用
traceroute
探测目标网络的结果见下:宿主机
iptables -L
的输出见下:sudo iptables -t nat -L -n --line-numbers
命令的输出见下:ping
命令失败的记录见下:对于一次
ping ******** -c 1
,我在宿主机上抓包tcpdump -i any icmp
得到:同样对于一次
ping ******** -c 1
,我在容器内抓包tcpdump -i any icmp
得到:网络地址转换一层套一层,有点绕晕了,没太捋明白问题出在哪里。
The text was updated successfully, but these errors were encountered: