[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 3

ifconfig Command

Purpose

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

Syntax

ifconfig InterfaceAddressFamilyAddressDestinationAddress ] ] [ Parameter ... ] ] 

Description

The ifconfig command can be used from the command line either to assign an address to a network interface or 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. It can also be used at a later time to redefine an interface's address or 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 the value of this flag 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 and ns.

For the DARPA-Internet family, inet, the address is either a host name present in the hostname 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 decimal), 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.

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 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 (Automated 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)

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

Parameter Allows the following parameter values:
alias Establishes an additional network address for the interface. When changing network numbers, this 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. This flag is in effect by 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 1's.
debug Enables driver-dependent debug code.
-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 respecify 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.
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 Version 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 Version 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 loopback. The hardware loopback 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.
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 4096, depending on the network interface. See "Automatic Configuration of Network Interfaces" in AIX Version 4.3 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.

The mask contains 1's (ones) for the bit positions in the 32-bit address that are reserved for the network and subnet parts, and 0's 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 20 byte ATM address of the ARP server that this client will use. The address is specified in the form of xx.xx....xx.
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 Version 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.
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.

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 loopback 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.

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 by several means, as can be seen in the following examples: The first example is in decimal format, and the second example, using - (minus signs), is separated into groups of three digits each. The 0x and H examples are in hex format. Finally, the 0 in front of the last example 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 Version 4.3 System Management Guide: Communications and Networks.

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


[ Previous | Next | Contents | Glossary | Home | Search ]