Configures or displays network interface parameters for a network using TCP/IP.
ifconfig Interface [ AddressFamily [ Address [ DestinationAddress ] ] [ Parameter ... ] ]
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.
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:
Include a numeral after the abbreviation to identify the specific interface (for example, tr0 ). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Parameter | Allows the following parameter values:
|
The following are examples using the ifconfig command on a TCP/IP network and an XNS network:
ifconfig sl1In 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
ifconfig lo0 inet 127.0.0.1 up
ifconfig tr0 inet downIn 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.
ifconfig en0 ns 110:02.60.8c.2c.a4.98 upIn 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 -vThe 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.
ifconfig et0 ns 120:02.60.8c.2c.a4.98 upThe 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.
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.10The 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.
/etc/host | Contains the host-name database. |
/etc/networks | Contains network names. |
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.