Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lishulongVI/bbd4df1285d8b4103ae424c053d32d60 to your computer and use it in GitHub Desktop.
Save lishulongVI/bbd4df1285d8b4103ae424c053d32d60 to your computer and use it in GitHub Desktop.
同一局域网下,内网无法访问外网的处理办法
内网网段:192.168.1.*
外网可访问的机器 ip:192.168.1.44
iptables -F
iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -j SNAT --to 192.168.1.44
echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf
sysctl -p
登入到无法访问外网的内网
route add default gw 192.168.1.44
@lishulongVI
Copy link
Author

这种情况下,

华为云,同一个vpc 下进行通信是ok的 可访问外网 ,可进行内部通讯

对等连接的情况下,华为云,ping 通,telenet 通,但是 http协议 报文不响应,阻塞

@lishulongVI
Copy link
Author

华为云工程师
您好,您描述的问题已反馈之技术团队分析,建议使用以下方案,在VPC内部添加路由。不要在虚拟机内部系统添加路由。如果在虚拟机内部添加到VPC内部的路由,会影响VPC的功能。
https://support.huaweicloud.com/usermanual-ecs/ecs_03_0705.html

2021/03/27 14:08:31 GMT+08:00

华为云工程师
您好,刚刚通过电话沟通,请您参考以下文档实现同vpc下,ECS通过代理共享上网的方法
https://bbs.huaweicloud.com/blogs/110652

2021/03/27 14:25:26 GMT+08:00

华为云工程师
您好,实以下两个文档都是关于同一VPC下,通过代理共享上网的配置文档。您可以根据您的业务情况,进行配置。
https://bbs.huaweicloud.com/blogs/110652
https://support.huaweicloud.com/usermanual-ecs/ecs_03_0705.html

采用修改路由表的情况下,正常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment