Using ifconfig to configure an interface

About the ifconfig command

The /etc/rc file in the root volume contains ifconfig commands to configure network interfaces, including virtual interfaces, at system boot. You can also manually use the ifconfig command when the system is operating.

The ifconfig command syntax

The ifconfig command syntax is as follows:

ifconfig <interface>
    [ [ alias | -alias ] <address> ] [ up | down ]
    [ netmask <mask> ] [ broadcast <address> ]
    [ mtusize <size> ] [ mediatype <type> ]
    [ trusted | untrusted ] [ wins | -wins ]
    [ partner | -partner <address> ]

Reasons to use the ifconfig command

You use the ifconfig command for the following purposes:

Changing the interface's IP address, network mask, or broadcast address

The following examples show configuring an Ethernet interface and a virtual interface on a filer:

ifconfig e1 292.9.299.6
ifconfig e2 netmask 255.255.0.0
ifconfig e3 broadcast 292.9.299.255

The interface names on your system might be different, depending on your filer model. For information about interface naming conventions, refer to "Naming conventions for network interfaces."

Setting the media type on an Ethernet interface

The following example show configuring an Ethernet interface on a filer:

ifconfig e1 mediatype tp

The media types you can use depend on the type of Ethernet card. The possible types you can enter in the ifconfig command are the same as those you can select when running setup. They are described in the following table.

Media type Description
100tx 100Base-T
100tx-fd 100Base-T, full-duplex
tp 100Base-T
tp-fd 10Base-T, full-duplex
auto 100Base-T/100Base-TX Ethernet using Auto-Negotiation
1000fx Gigabit Ethernet

Setting the maximum transmission unit (MTU)

The following example shows setting the MTU for an FDDI interface:

ifconfig f0 mtusize 1500 

The following table lists the default MTU sizes.

Interface Default MTU size
FDDI 4352
Ethernet 1500
Gigabit Ethernet 1500
ATM 9188

Use a smaller MTU value for an interface if a bridge or router on the attached network cannot break large packets into fragments.

To view the current setting of the MTU value, use the following command:

netstat -i 

Configuring the interface up or down

The following example illustrates how to configure interfaces up and down:

ifconfig e1a up
ifconfig f1 down
ifconfig virt_interface up

Specifying the partner IP address in a cluster

Within a cluster, each filer must have one or more interfaces configured with its partner's IP address. The filer uses the interface configured with its partner IP address to serve data while in takeover mode. The following terms relate to IP addresses in clusters.

Term Definition
partner IP address One or more IP addresses assigned to a clustered filer's partner, if the interface is a physical interface.
partner name One or more partner names assigned to a clustered filer's partner, if the interface is a virtual interface.
dedicated standby interface An interface in a clustered filer that is dedicated to a partner IP address. This interface is idle when the cluster is operating in normal mode. It becomes active when the filer in which it is installed takes over for its partner.
shared interface An interface in a clustered filer that is shared by the IP addresses of the filer in which it is installed and a partner IP address. The partner IP address is idle when the cluster is operating in normal mode. It becomes active when the filer in which it is installed takes over for its partner.

Partner IP addresses can be configured to use dedicated standby interfaces, or they can be configured to shared interfaces.

Partner IP addresses must be configured to use interfaces on the same subnetwork as the partner.

Dedicated interface example

The following example shows how to configure two filers to assume each other's identities during takeovers using dedicated interfaces.

Filer 1 Filer 2
Name: Toaster1 Name Toaster2
Interface e1 address: 198.9.200.28 Interface e1 address: 198.9.200.38
Interface e2 partner address: 198.9.200.38 Interface e2 partner address: 198.9.200.28

The following commands entered on the toaster1 console do the following tasks:

The following commands entered on the toaster2 console do the following tasks:

Shared interface example

The following example shows how to configure two filers to assume each other's identities during takeovers using shared interfaces.

Filer 1 Filer 2
Name: Toaster1 Name Toaster2
Interface e1 address: 198.9.200.28 Interface e1 address: 198.9.200.38
Interface e1 partner address: 198.9.200.38 Interface e1 partner address: 198.9.200.28

The following commands entered on the toaster1 console do the following tasks:

The following commands entered on the toaster2 console do the following tasks:

Edit /etc/rc file to make changes persistent after reboot

If you want changes made with ifconfig to remain in effect after a reboot, include the ifconfig commands in the /etc/rc file.

Viewing interface configuration information

The following table illustrates examples of how to use the ifconfig command to view interface configuration information.

Description Syntax
Show the current configurations of all network interfaces. ifconfig -a
Show the current configuration of a specific network interface. ifconfig interface
Example
Enter the following command to show the current configuration of interface e0: ifconfig e0

na_ifconfig man page has more information

For more information about the ifconfig command, refer to the na_ifconfig(1) man page.


Copyright © 1999, Network Appliance, Inc. All rights reserved.

Part No. 210-02334
File: net5.htm
Last updated: 04/26/99 08:11:18