My CentOS XYZ has two network interfaces:
iface1 136.136.10.10 is connected to gateway 136.136.10.1
iface2 192.168.10.1 is connected to private network
XYZ can access the internet through gateway 136.136.10.1 which is connected to the internet.
My other CentOS ABC has one network interface iface (192.168.10.2) that is internal. Now, how do I connect ABC to the internet?
I tried to add masquerade but with no avail:
On 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
on ABC:
added 192.168.10.1 as gateway
Thanks,