I have an experimental installation of 4 linux (CentOS) machines:

All 4 machines are internally connected using different networks and can ping directly connected interfaces to each other. However, only PC4 has access to the Internet.
I am trying to configure iptable rules that can allow PC1 to access the Internet through PC4, but I do not know how to do this.
I tried adding NAT to the outgoing interface on PC2, PC3 and PC4:
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
However, this will not work, can you give me an idea of how in this setting I can make access to the PC 10.0.0.1 network?
source
share