CentOS 7 ip伪装为互联网接入

我的CentOS XYZ有两个networking接口:

iface1 136.136.10.10 is connected to gateway 136.136.10.1 iface2 192.168.10.1 is connected to private network 

XYZ可以通过连接到互联网的网关136.136.10.1访问互联网。

我的另一个CentOS ABC有一个内部networking接口iface(192.168.10.2)。 现在,我如何将ABC连接到互联网?

我试图添加化妆舞会,但无济于事:

在XYZ上:

  # iptables --flush # iptables --table nat --flush # iptables --delete-chain # iptables --table nat --delete-chain # iptables --table nat --append POSTROUTING --out-interface iface1 -j MASQUERADE # iptables --append FORWARD --in-interface iface2 -j ACCEPT # echo 1 > /proc/sys/net/ipv4/ip_forward # systemctl restart network.service 

在ABC上:

  added 192.168.10.1 as gateway 

谢谢,

在我的一个界面中解决了另一个问题之后,问题就解决了。 底线:我遵循的指示是有效的,可以用来连接ABC到互联网。