4.6. Networking Configuration Examples

In this section, we describe some common networking configurations and how to use Rocks commands to set up various networking scenarios.

4.6.1. Adding a public IP address to the second ethernet adapter on a compute node

Often, owners want the second ethernet adapter to be on the public network and for the default routing to be in the public network. Assuming that the public network is 1.2.3.0/255.255.255.0 and the default gateway for that network is 1.2.3.1, the following set of commands define the second interface of a compute to have address 1.2.3.25 with name mypublic.<public domain of frontend> update all required configuration files on the frontend, update all required configuration files on the node compute-0-0 and restart the network on compute-0-0.

# rocks set host interface ip compute-0-0 iface=eth1 ip=1.2.3.25 
# rocks set host interface name compute-0-0 iface=eth1 name=mypublic
# rocks set host interface subnet compute-0-0 eth1 public
# rocks add host route compute-0-0 0.0.0.0 1.2.3.1 netmask=0.0.0.0
# rocks sync config
# rocks sync host network compute-0-0 

4.6.2. Adding an IP network for local message passing.

Often, users will want to use the second ethernet device for messaging passing. In this example, we illustrate creating a named subnet and then scripting the IP assignment for a rack of 32 nodes with IP range of 192.168.1.10 ... 192.168.1.41.

rocks add network fast subnet=192.168.1.0 netmask=255.255.255.0
IP=10
NNODES=32
NODE=0
while [ $NODE -lt $NNODES ]; do \
	rocks set host interface ip compute-0-$NODE iface=eth1 ip=192.168.1.$IP; \
	rocks set host interface subnet compute-0-$NODE iface=eth1 subnet=fast; \
	rocks set host interface name compute-0-$NODE iface=eth1 name=compute-fast-0-$NODE; \
	let IP++; \
	let NODE++; \
done
rocks sync config
rocks sync host network compute

The above will add the named subnet called "fast", assign IP addresses sequentially, name the eth1 interface on each node, rewrite the DNS configuration (sync config) and finally rewrite and restart the network configuration on each compute appliance. This additional network configuration is persistent across re-installation of nodes.

4.6.3. Setting the Default Gateway on a Node

When adding a second (public) interface on nodes, it is sometimes desireable to change the default route or gateway. Suppose that your gateway=1.2.3.4, the the following will set gateway on a particular host

rocks add host route compute-0-0 0.0.0.0 1.2.3.4 netmask=0.0.0.0 
rocks sync host network compute-0-0

Warning

the 1.2.3.4 address must be directly reachable (Same LAN) from one of the host's ethernet interfaces.