Thursday, November 22, 2012

Editing NetApp's RC File



I've been setting up a new NetApp filer at work and recently ran into an issue with network access on the filer. Apparently the System Manager (2.0.2) has issues editing the network settings so I was attempting to edit the network settings from the command line. This is something I hadn't done before so it was a learning experience.

I needed to setup a vif interface for the iscsi interface. First I worked out the network settings from the command line:

ifgrp create lacp iscsi-top -b ip e0a e0b e0c

The ifgrp command creates the virtual interface called iscsi-top. I have it assigned to interfaces e0a, e0b, e0c. 

I then added the command:

ifconfig iscsi-top 172.16.4.100 mediatype auto netmask 255.255.255.0 mtusize 9000

The ifconfig sets the ip address and because this interface is going to be used for iscsi, jumbo packets are setup.

So everything is working till I reboot the filer. All of a sudden the network settings for the iscsi were gone. I found that setting from the command line were not saved and that to save the configuration we had to edit the  rc file. The rc file is located in the /etc directory.

The command wrfile can be used to write a file. If you use wrfile -a you can append to a file. So I was able to append my command to the rc file to save the network settings. However I made a mistake in the command (didn't add the jumbo frames command - mtusize 9000). I couldn't directly edit the file and couldn't append the change to the file.

What to do? From the command line:

rdfile /etc/rc

This will read the entire file into the screen. You can then select the text from your screen (in this case putty). Copy the selected text into notepad and then make needed changes. Before saving the changes back to the rc file, make a backup of the rc file:

mv /etc/rc /etc/rc.bak

Then:

wrfile /etc/rc

Select the edited text and paste them into putty screen. Then press Ctrl + C to save the file.