aliyun ecs iptables nat 上网

使用绑定公网IP的阿里云ECS做网关给其他无公网IP的ECS提供上网服务。
在拥有公网IP的ECS上做iptables规则

iptables -t nat -L -n
SNAT all -- 10.0.0.0/24 0.0.0.0/0 to:10.0.0.56 # 此处为拥有公网IP的ECS的内网地址

aliyun  ecs  iptables nat 上网

阿里云控制台,配置并修改默认路由 指定 0.0.0.0 下一跳为 带公网IP的ECS

aliyun  ecs  iptables nat 上网

猜你喜欢

转载自blog.51cto.com/phospherus/2415977