Skip to main content
NetApp Knowledge Base

What is the order of commands in the /etc/rc file?

Last Updated:


Applies to

What is the order of commands in the /etc/rc file?


Some commands in /etc/rc file do not get executed.

The /etc/rc file
The commands in the /etc/rc file are run as the system boots to configure the storage system. You can run all the commands in /etc/rc at the command line interface. However, if you want to make a change permanent or to make the commands take effect at boot time, you must update the /etc/rc file. If your storage system is licensed to run CIFS, then for CIFS to be enabled, the /etc/rc file must be present at storage system reboot.

Click here for the /etc/rc file format.

The /etc/rc default contents
See a sample /etc/rc file below. The sample setup session would generate the following /etc/rc file:
#Auto-generated /etc/rc Fri May 30 14:51:36 PST 1997
hostname toaster
ifconfig e0 `hostname`-0
ifconfig e1 `hostname`-1
ifconfig fi0 `hostname`-fi0
ifconfig a5 `hostname`-a5
route add default MyRouterBox
routed on
options dns.domainname
options dns.enable on
options nis.domainname
options nis.enable on
timezone US/Pacific
snap sched 0 2 6@8,12,16,20
exportfs -a
nfs on

Note: No CIFS-specific information is entered in /etc/rc as a result of setup. Do not add CIFS commands in /etc/rc.

Note: Booting without /etc/rc causes the storage system to use only default options settings; disregard all options settings you put in /etc/rc; and disable some services, such as syslog.

The following list explains the sample /etc/rc file line by line:

hostname toaster
Set the storage system's host name.

ifgrp create lacp ifgrp1 -b ip e0b e0c e0d

Create ifgrps. ifgrp create [ single | multi | lacp ] ifgrp_name [ -b {rr|mac|ip|port} ] [ interface_list ]

vlan create ifgrp1 22 38 210

VLAN interfaces allow a single network interface card to participate in multiple broadcast domains supported by a VLAN enabled switch. Individual frames are tagged with a vlanid to distinguish which VLAN the data belongs to.

ifconfig e0 `hostname`-0
ifconfig e1 `hostname`-1
ifconfig f0 `hostname`-f0
ifconfig a5 `hostname`-a5

Sets the IP address for the storage system's Ethernet, FDDI, AND ATM interfaces with a default network mask. (The network mask is set during the setup session.) The arguments in single backquotes expand to 'toaster' if you specify 'toaster' as the host name during setup. The actual IP addresses are obtained from the /etc/hosts file; you might prefer to enter IP addresses directly in /etc/rc. If the specified network interface is not present, ifconfig issues an error message and has no other effect.

The actual interface names and numbers depend on the storage system model. For more information about interface names, refer to Naming Conventions for Network Interfaces.

CAUTION: If you change the storage system's host name, you must modify the /etc/hosts file to substitute the new host name. If you do not, ifconfig fails.

To override the default network mask, explicitly specify the network mask in the ifconfig command after the host name. For example:

ifconfig e1 `hostname`-1 netmask

route add default LocalRouter 1
Specifies the default router. You can add route commands to /etc/rc to set static routes for the storage system. The network address for LocalRouter must be in /etc/hosts.

routed on
Starts the routing daemon. For more information about routing, see Routing.

timezone US/Pacific
Sets the time zone. The argument here specifies which file in the /etc/zoneinfo directory describes the time zone you want.

snap sched 0 2 6@8,12,16,20
Sets the schedule for automatic snapshot creation. The line in the example /etc/rc file is the default setting, which creates and keeps no weekly snapshots, two daily snapshots (created at midnight every night), and six hourly snapshots (created at 8 A.M., 12 noon, 4 P.M., and 8 P.M.).

exportfs -a
Exports all directories specified in the /etc/exports file. This command is included only if the storage system runs NFS.

nfs on
Turns on NFS file service. This command is included even if NFS is not licensed for your storage system. If the storage system runs this command from /etc/rc on a filer without an NFS license, the command fails and these messages appear:

NFS service is not licensed.

(Use the 'license' command to license it.)

NFS server is NOT running.

dns on
Turns on the Domain Name Service.

nis on
Turns on the Network Information System.

Saves the core file from a system panic, if any, in the /etc/crash directory. Core files are created only during the first boot after a system crash.

Additional Information

Add your text here.


NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.