我有一个我希望用作 NAT 实例的 Ubuntu 机器(除其他外)。我宁愿避免使用 Amazon 提供的 NAT AMI,而是自己配置 NAT。
目前,我的主机只有一个网络接口(如http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html 中所示)。
我是否可以将我的 Ubuntu 主机配置为 Amazon 网络中其他主机的 NAT 实例?
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
5 454 MASQUERADE all -- * eth0 0.0.0.0/0 0.0.0.0/0
Run Code Online (Sandbox Code Playgroud)
我尝试在 Ubuntu 主机 (10.200.0.51) 中配置 NAT 规则。我的第二台主机位于不同的网络 (10.200.10.41/24) 上。所以我写道:
route add -net 10.200.0.0 netmask 255.255.255.0 dev eth0 # So I can reach 10.200.0.51
route add default gw 10.200.0.51
Run Code Online (Sandbox Code Playgroud)
但是机器失去了连接。
我对亚马逊中 NAT 实例和路由的使用有什么误解?