[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 3


ifconfig Command

Purpose

Configures or displays network interface parameters for a network using TCP/IP.

Syntax

ifconfig InterfaceAddressFamilyAddressDestinationAddress  ] ] [  Parameters... ] ]

ifconfig InterfaceProtocolFamily ] Interface ProtocolFamily

ifconfig -a-l ] [  -d ] [  -u ] [ ProtocolFamily ]

Description

You can use the ifconfig command to assign an address to a network interface and to configure or display the current network interface configuration information. The ifconfig command must be used at system startup to define the network address of each interface present on a machine. After system startup, it can also be used to redefine an interfaces address and its other operating parameters. The network interface configuration is held on the running system and must be reset at each system restart. The ifconfig command interprets the IFF_MULTICAST flag and prints its value if it is set.

An interface can receive transmissions in differing protocols, each of which may require separate naming schemes. It is necessary to specify the AddressFamily parameter, which may change the interpretation of the remaining parameters. The address families currently supported are inet, inet6, and ns.

For the DARPA-Internet family, inet, the address is either a host name present in the host name database, that is, the /etc/hosts file, or a DARPA-Internet address expressed in the Internet standard dotted decimal notation.

For the Xerox Network Systems (XNS) family, ns, addresses are net:a.b.c.d.e.f., where net is the assigned network number (in decimals), and each of the 6 bytes of the host number, a through f, are specified in hexadecimal. The host number may be omitted on 10-Mbps Ethernet interfaces, which use the hardware physical address, and on interfaces other than the first interface.

While any user can query the status of a network interface, only a user who has administrative authority can modify the configuration of those interfaces.

The ifconfig function displays the current configuration for a network interface when no optional parameters are supplied.

If a protocol family is specified, ifconfig will report only the details specific to that protocol family.

Only a super user may modify the configuration of a network interface.

Gratuitous ARP is supported for Ethernet, token-ring, and FDDI interfaces. This means when an IP address is assigned, the host sends an ARP request for its own address (the new address) to inform other machines of its address so that they can update their ARP entry immediately. It also lets hosts detect duplicate IP address. If you get a response to the ARP request, an error is logged in /var/adm/ras/errlog which can be viewed using errpt command (or using SMIT interface) for the error ID AIXIF_ARP_DUP_ADDR.

Flags


-a Optionally, the -a flag may be used instead of an interface name. This flag instructs ifconfig to display information about all interfaces in the system.
-d The -d flag displays interfaces that are down.
-l This flag may be used to list all available interfaces on the system, with no other additional information. Use of this flag is mutually exclusive with all other flags and commands, except for -d and -u.
-u The -u flag displays interfaces that are up.
ProtocolFamily This flag specifies protocols such as tcp, udp, tcp6, udp6, icmp, and icmp6.

Parameters


Address Specifies the network address for the network interface. For the inet family, the Address parameter is either a host name or an Internet address in the standard dotted decimal notation.
AddressFamily Specifies which network address family to change. The inet, inet6, and ns address families are currently supported. This parameter defaults to the inet address family.
DestinationAddress Specifies the address of the correspondent on the remote end of a point-to-point link.
Interface Specifies the network interface configuration values to show or change. You must specify an interface with the Interface parameter when you use the ifconfig command. Abbreviations for the interfaces include:
  • at for ATM (Asynchronous Transfer Mode)
  • en for Standard Ethernet (inet, xns)
  • et for IEEE 802.3 Ethernet (inet, xns)
  • tr for Token-Ring (inet, xns)
  • xt for X.25 (inet)
  • sl for serial line IP (inet)
  • lo for loopback (inet)
  • op for serial (inet)
  • vi for Virtual IP Address (inet)

Include a numeral after the abbreviation to identify the specific interface (for example, tr0).

If Interface is not yet loaded, ifconfig Interface loads that interface and netstat -in lists it. In processing a status query for Interface, that interface is loaded (if not already loaded) to complete the query processing.

Parameter Allows the following parameter values:

alias
Establishes an additional network address for the interface. When changing network numbers, this parameter is useful for accepting packets addressed to the old interface.
 

allcast
Sets the Token-Ring interface to broadcast to all rings on the network.

 

-allcast
Confines the Token-Ring interface to broadcast only to the local ring.

 

arp
Enables the ifconfig command to use the Address Resolution Protocol in mapping between network-level addresses and link-level addresses. The arp value is the default.

 

-arp
Disables the use of the Address Resolution Protocol.

 

authority
Reserved for future use.

 

bridge
Reserved for future use.

 

-bridge
Reserved for future use.

 

broadcast Address
(inet only) Specifies the address to use to broadcast to the network. The default broadcast address has a host part of all 1s.

 

-dad
(inet6 only) Does not perform duplicate IPv6 address address detection.

 

-debug
Disables driver-dependent debug code.

 

delete
Removes the specified network address. This is used when an alias is incorrectly specified or when it is no longer needed. Incorrectly setting an ns address has the side effect of specifying the host portion of the network address. Removing all ns addresses allows you to re-specify the host portion.

 

device dev_name
This parameter applies to ATM Network interface only. It specifies the device name this interface is associated with. Unlike Token Ring or Ethernet, in case of ATM, there is not a one-to-one correspondence between interface and device. In the case of ATM, there can be more than one interface for every device.

 

detach
Removes an interface from the network interface list. If the last interface is detached, the network interface driver code is unloaded. In order for the interface route of an attached interface to be changed, that interface must be detached and added again with ifconfig.

 

down
Marks an interface as inactive (down), which keeps the system from trying to transmit messages through that interface. If possible, the ifconfig command also resets the interface to disable reception of messages. Routes that use the interface, however, are not automatically disabled.

 

eui64
(inet6 only) The real IPv6 address is computed by replacing the last 64 bytes of the given address with the Interface Identifier.

 

first
Puts an IPv6 address at the first place on an interface in order to select it as the source for unbound sockets. The syntax for using this parameter is,

ifconfig interface inet6 first address
 

firstalias
(inet6 only) Same as alias, but sets the address in front of the interface address list in order to select it as the source for unbound sockets.

 

group ID
Adds a group ID to the group ID list for the interface. This list is used in determining the route to use when forwarding packets that arrived on the interface. This parameter only applies to AIX 4.2.1 or later.

 

-group ID
Removes a group ID from the group ID list for the interface. This list is used in determining the route to use when forwarding packets that arrived on the interface. This parameter only applies to AIX 4.2.1 or later.

 

hwloop
Enables hardware loopback. The hardware loopback specifies that locally addressed packets handled by an interface should be sent out using the associated adapter.

 

-hwloop
Disables hardware loop-back. The hardware loop-back specifies that locally addressed packets handled by an interface should be sent out using the associated adapter.

 

ipdst
Specifies an Internet host willing to receive IP packets encapsulating ns packets bound for a remote network. An apparent point-to-point link is constructed, and the specified address is taken as the ns address and network of the destination.

 

ipv6dst
Used to specify an IPv6 node that is willing to receive IPv6 packets encapsulating IPv6 or IPv4 packets through a tunnel. The apparent destination of the point to point tunnel interface may not be the real destination of the packets. At the tunnel endpoint, the decapsulated packets may then be forwarded to their final destination.

 

link [0-2]
Enables special processing of the link level of the interface. These three options are interface-specific. In actual effect, however, they are generally used to select special modes of operation. An example of this is to enable SLIP compression, or to select the connector type for some Ethernet cards. Refer to the manual page for the specific driver for more information.

 

-link [0-2]
Disables special processing at the link level with the specified interface.

 

metric Number
Sets the routing metric of the interface to the value specified by the Number variable. The default is 0 (zero). The routing metric is used by the routing protocol (the routed daemon). Higher metrics have the effect of making a route less favorable. Metrics are counted as addition hops to the destination network or host.

 

mtu Value
Sets the maximum IP packet size for this system. The Value variable can be any number from 60 through 65535, but is media dependent. See "Automatic Configuration of Network Interfaces" in AIX 5L Version 5.1 System Management Guide: Communications and Networks for maximum transmission unit (MTU) values by interface.

 

netmask Mask
Specifies how much of the address to reserve for subdividing networks into subnetworks. This parameter can be used only with an address family of inet.

The Mask variable includes both the network part of the local address and the subnet part, which is taken from the host field of the address. The mask can be specified as a single hexadecimal number beginning with 0x, in standard Internet dotted decimal notation, or beginning with a name or alias that is listed in the /etc/networks file.

In the 32-bit address, the mask contains 1s (ones) for the bit positions reserved for the network and subnet parts and 0s for the bit positions that specify the host. The mask should contain at least the standard network portion, and the subnet segment should be contiguous with the network segment.


 

pvc
This parameters applies to ATM Network interface only. It specifies that this interface will support PVC (Permanent Virtual Circuit) types of virtual connections only.

 

svc_c server_addr
This parameter applies to ATM Network interface only. It specifies that this interface will support both SVC (Switched Virtual Circuit) and PVC types of virtual connections. It further specifies that this interface will be an ARP client. The server_addr is the list of 20 byte ATM address of the ARP servers that this client will use. The addresses are specified in the form of xx.xx....xx. The first entry is considered the Primary ARP server and the rest are considered Secondary ARP servers. The list of 20 byte ARP server addresses must separated by a comma.

 

site6
Sets the IPv6 site number (default is zero). This should be used only with site-local addresses on a multi-sited node.

 

svc_s
This parameter applies to ATM Network interface only. It specifies that this interface will support both SVC and PVC types of virtual connections. It further specifies that this interface will be the ARP server for this Logical IP Subnetwork (LIS).

 

security
Reserved for future use.

 

snap
Reserved for future use.

 

-snap
Reserved for future use.

 

tcp_nocksum
Disables verification of the checksum of TCP data for local traffic to the subnet attached to the interface. Checksum verification of TCP, UDP and IP headers continues. Checksum verification of TCP data read or written from this interface from or to remote networks also continues. This parameter only applies to AIX 4.2 or later.

 

-tcp_nocksum
Enables verification of the checksum of TCP data for local traffic to the subnet attached to the interface. This is the default.

 

thread
(inet only) Configures dedicated kernel threads for an interface. This parameter can only be used on SMP machines that have multiple CPU's. This parameter causes input packets to be queued to a kernel thread after processing by the device driver and input demuxer. The input packet is processed in IP and TCP or UDP by the thread instead of directly on the interrupt level. Setting this parameter can improve throughput when high speed adapters bottleneck on a single CPU during interrupt processing by allowing the input packets to be processed on other CPU's running the kernel threads (improved pipelining). For some work loads, this parameter increases the per packet overhead, due to thread scheduling overhead, resulting in higher CPU utilization an possibly lower throughput. This parameter only applies to AIX 4.3.3 or later.

 

-thread
(inet only) Configures Disables kernel thread support that has been configured with the thread parameter. This parameter only applies to AIX 4.3.3 or later.

 

up
Marks an interface as active (up). This parameter is used automatically when setting the first address for an interface. It can also be used to enable an interface after an ifconfig down command.

In AIX 4.3.3 and later versions, the following network options, commonly known as ISNO (Interface Specific Network Options), can be configured on a per interface basis:

rfc1323 [0 | 1]
Enables or disables TCP enhancements as specified by RFC 1323, TCP Extensions for High Performance. A value of 1 specifies that all TCP connections using this interface will attempt to negotiate the RFC enhancements. A value of 0 disables rfc1323 for all connections using this interface. The SOCKETS application can override this ISNO and global behavior on individual TCP connections with the setsockopt subroutine.

-rfc1323
Removes the use of ISNO for rfc1323 for this network. A SOCKETS application can override the global behavior on individual TCP connections using the setsockopt subroutine.

tcp_mssdflt Number
Sets the default maximum segment size used in communicating with remote networks. If communicating over this interface, a socket uses Number as the value of the default maximum segment size.

-tcp_mssdflt
Removes the use of ISNO for tcp_mssdflt. The global value, manipulated via /usr/sbin/no, is used instead.

tcp_recvspace Size
Specifies the default socket buffer Size for interface sockets receiving data. The buffer size affects the window size used by TCP. (See the no command for more information.)

-tcp_recvspace
Removes the use of ISNO for tcp_recvspace. The global value is used instead.

tcp_sendspace Size
Specifies the default socket buffer Size for interface sockets sending data. The buffer size affects the window size used by TCP. (See the no command for more information.)

-tcp_sendspace
Removes the use of ISNO for tcp_sendspace. The global value is used instead.

tcp_nodelay [0 | 1]
Specifies that sockets using TCP over this interface follow the Nagle algorithm when sending data. By default, TCP follows the Nagle algorithm.

-tcp_nodelay
Removes the use of ISNO for the tcp_nodelay option.

Note: ISNO parameters set by ifconfig are lost at the next reboot. Use the chdev command to change the ODM database for each interface if you wish to make the ISNOs permanent. Use lsdev -E -l [interface] to see the interface attributes and chdev -l -a [attribute=value] to change the desired attribute. For example:

   lsattr -E -l en0
   chdev -l en0 -a tcp_sendspace=65536

Examples

The following are examples using the ifconfig command on a TCP/IP network and an XNS network:

Inet Examples

  1. To query the status of a serial line IP interface, enter the command in the following format:

    ifconfig  sl1
    

    In this example, the interface to be queried is sl1. The result of the command looks similar to the following:

    sl1:  flags=51<UP,POINTOPOINT,RUNNING>
                inet  192.9.201.3  -->  192.9.354.7  netmask  ffffff00
    
  2. To configure the local loop-back interface, enter the command in the following format:

    ifconfig  lo0  inet  127.0.0.1  up
    
  3. To mark the local Token-Ring interface as down, enter the command in the following format:

    ifconfig  tr0  inet  down
    

    In this example, the interface to be marked is token0.

    Note: Only a user with root user authority can modify the configuration of a network interface.
  4. To turn rfc1323 off for all connections over en5 (assuming that the global value is 1), enter:

    ifconfig en0 rfc1323 0
    

XNS Examples

  1. To configure a Standard Ethernet type interface for XNS, enter the command in the following format:

    ifconfig  en0  ns  110:02.60.8c.2c.a4.98  up
    

    In this example, ns is the XNS address family, 110 is the network number and 02.60.8c.2c.a4.98 is the host number, which is the Ethernet address unique to each individual interface. Specify the host number when there are multiple Ethernet hardware interfaces, as the default may not correspond to the proper interface. The Ethernet address can be obtained by the commands:

    ifconfig  en0
    netstat  -v
    

    The XNS address can be represented several ways, as shown in the following examples:

    The XNS address in the first example is in decimal format. The address in the second example is broken into groups of three digits, with each group separated by a - (minus sign). The 0x and H addresses are in hex format. Finally, the 0 in front of the last address indicates that the number is in octal format.

  2. To configure an IEEE Ethernet 802.3 type interface for XNS, enter the command in the following format:

    ifconfig  et0  ns  120:02.60.8c.2c.a4.98  up
    

    The en0 and et0 interfaces are considered as separate interfaces even though the same Ethernet adapter is used. Two separate networks can be defined and used at the same time as long as they have separate network numbers. Multiple Ethernet adapters are supported.

    Note: The host number should correspond to the Ethernet address on the hardware adapter. A system can have multiple host numbers.
  3. To configure an Internet encapsulation XNS interface, enter the command in the following format:

    ifconfig  en0  inet  11.0.0.1  up
    ifconfig  en0  ns  110:02.60.8c.2c.a4.98  up
    ifconfig  en0  ns  130:02.60.8c.34.56.78  ipdst  11.0.0.10
    

    The first command brings up the Internet with the inet address 11.0.0.1. The second command configures the en0 interface to be network 110 and host number 02.60.8c.2c.a4.98 in the ns address family. This defines the host number for use when the XNS packet is encapsulated within the Internet packet. The last command defines network 130, host number 02.60.8c.34.56.78, and destination Internet address 11.0.0.10. This last entry creates a new network interface, nsip. Use the netstat -i command for information about this interface.

Files


/etc/host Contains the host-name database.
/etc/networks Contains network names.

Related Information

The netstat command.

The hosts file format, networks file format.

TCP/IP Network Interfaces, Understanding Protocols, TCP/IP Routing, Subnet Addresses in AIX 5L Version 5.1 System Management Guide: Communications and Networks.

Xerox Network Systems (XNS) Overview for Programming in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]