IP forwarding for compute nodes
In order to enable the nodes to have internet or LAN access from its private network, we need to forward the internet traffic on its private network eth0 to public network eth1 on the master node
Master node
On the master, allow IP forwarding for IPv4:
Uncomment the net.ipv4.ip_forward=1 line in /etc/sysctl.conf. This is the same change as above, but makes it persistent. Make this change with your favorite editor, or with sed on the command line:
Add the following rules to iptables and make them persistent:
The above should be tested to ensure it survives a reboot. Anytime you add new rules to iptables manually, you will need to save them as per above for them to be persistent.
Compute nodes
On each compute node, set default routing through the eth0 network connection, using the master node as the gateway:
This can be done using pdsh.
You will also need to make this change permanent, which can be done by adding
to /etc/network/interfaces.d/eth0.
Last updated