前言
https://www.v2ex.com/t/264386#reply9
大概就是我买了个 vultr 的 vps 跑 ss ,别人安利了我个 finalspeed
我想在 docker 里跑它,折腾了一下,发现外网访问不了那个端口
➜ finalspeed docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c6b81467255c finalspeed "/bin/bash" 20 minutes ago Up 19 minutes 0.0.0.0:5006->150/tcp, 0.0.0.0:5006->150/udp finalspeed
iptable 的 nat 规则如下
➜ finalspeed sudo iptables -nL -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DOCKER all -- 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DOCKER all -- 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 172.17.0.0/16 0.0.0.0/0
MASQUERADE tcp -- 172.17.0.2 172.17.0.2 tcp dpt:150
MASQUERADE udp -- 172.17.0.2 172.17.0.2 udp dpt:150
Chain DOCKER (2 references)
target prot opt source destination
RETURN all -- 0.0.0.0/0 0.0.0.0/0
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5006 to:172.17.0.2:150
DNAT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:5006 to:172.17.0.2:150
iptable 的规则如下
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5006
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:5006
=================================
本机 telnet 实测没什么问题
外网环境 Connection failed.
请大家帮我看一下,有可能是什么情况!谢谢