我的CentOS XYZ有两个网络接口:
iface1 136.136.10.10 is connected to gateway 136.136.10.1
iface2 192.168.10.1 is connected to private networkXYZ可以通过连接到internet的网关136.136.10.1访问internet。
我的另一个CentOS ABC有一个网络接口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在美国广播公司:
added 192.168.10.1 as gateway谢谢,
发布于 2015-09-29 18:31:49
当我在我的一个接口中修复了另一个问题之后,这个问题就解决了。底线:我遵循的说明是有效的,可以用来连接ABC和互联网。
https://serverfault.com/questions/724203
复制相似问题