2.6. Working with and Modifying Network Configuration

The Rocks database holds information that has been discovered about a host and in particular records network interface information including MAC addresses and local device modules. The Rocks command line has several tools to inspect and update entries in the database. Reinstallation of a node will apply the changes to a node. See the following section on Swapping Frontend Ethernet Interfaces.

For the following discussion, a frontend named "jeebs" will be used for illustation. To list the ethernet interfaces do the following:

# rocks list host interface jeebs

SUBNET  IFACE MAC               IP             NETMASK       GATEWAY      MODULE NAME                   
private eth0  00:0e:0c:a7:57:d7 10.1.1.1       255.0.0.0     ------------ e1000  jeebs                  
public  eth1  00:19:b9:21:b8:b6 172.19.119.241 255.255.255.0 172.19.119.1 tg3    jeebs.rocksclusters.org

This describes the two interfaces, eth0 and eth1. Suppose that it is desired to swap these two interfaces. That is is we would want to associate the mac address 00:0e:0c:a7:57:d7 with eth1. To do this we must also associate the correct module. The following will change the information only in the database. This uses the rocks set host interface group of commands.

# rocks set host interface mac jeebs iface=eth1 mac=00:0e:0c:a7:57:d7
# rocks set host interface module jeebs iface=eth1 module=e1000

# rocks set host interface mac jeebs iface=eth0 mac=00:19:b9:21:b8:b6
# rocks set host interface module jeebs iface=eth0 module=tg3

Then the updated database configuration is as follows

# rocks list host interface jeebs
SUBNET  IFACE MAC               IP             NETMASK       GATEWAY      MODULE NAME                   
private eth0  00:19:b9:21:b8:b6 10.1.1.1       255.0.0.0     ------------ tg3    jeebs                  
public  eth1  00:0e:0c:a7:57:d7 172.19.119.241 255.255.255.0 172.19.119.1 e1000  jeebs.rocksclusters.org

Note

After any such database change, always run rocks sync config. This will update service configuration files (like dhcpd). Reinstalling a node will apply these types of changes to the node.

2.6.1. Swapping Interfaces on the Frontend

The previous section described how to swap two interfaces in the database. For compute nodes it is easiest to simply reinstall nodes for the new configuration to be applied properly. For frontends, this is not possible and you should apply the following procedure after you have updated information in the database. This will recreate the appropriate files.

Warning

Before performing this procedure, you must be logged into the frontend's console. Then, you must shutdown the frontend's network by executing:
# service network stop

# sed -i -e '/alias eth/d' -e '/^#/d' /etc/modprobe.conf
# dbreport ifcfg modules jeebs >> /etc/modprobe.conf
# dbreport ifcfg eth0 jeebs > /etc/sysconfig/network-scripts/ifcfg-eth0
# dbreport ifcfg eth1 jeebs > /etc/sysconfig/network-scripts/ifcfg-eth1

# shutdown -r now