In this section, we describe some common networking configurations and how to use Rocks commands to set up various networking scenarios.
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 18.104.22.168/255.255.255.0 and the default gateway for that network is 22.214.171.124, the following set of commands define the second interface of a compute to have address 126.96.36.199 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=188.8.131.52 # 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 184.108.40.206 netmask=0.0.0.0 # rocks sync config # rocks sync host network compute-0-0
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.
When adding a second (public) interface on nodes, it is sometimes desireable to change the default route or gateway. Suppose that your gateway=220.127.116.11, the the following will set gateway on a particular host
rocks add host route compute-0-0 0.0.0.0 18.104.22.168 netmask=0.0.0.0 rocks sync host network compute-0-0
the 22.214.171.124 address must be directly reachable (Same LAN) from one of the host's ethernet interfaces.