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 ]

ifconfig interfacetcp_low_rto rto | -tcp_low_rto ]

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 and inet6.

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.

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.

The ifconfig command calls the ifconfig.ib command. The ifconfig.ib command displays the interface information as shown:
ib0:flags=e3a0063<UP,BROADCAST,NOTRAILERS,RUNNING,ALLCAST,MULTICAST,GROUPRT>
pmtu 2048 qkey 
0x1e qpn 0x48 lid 0x5c hca iba0 port 1 inet 1.2.3.120 netmask 0xffffff00 broadcast 
1.2.3.255 inet6 
fe80::2:c903:1:1e8d/64 tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
The interface now displays the path mtu (pmtu), Queue Key (qkey), Queue Pair Number (qpn), Local ID (lid), Host Channel Adapter (hca), and the port number (port). This information is useful during debugging or performing diagnostics.
Note: Any changes made to the attributes of an interface using the ifconfig command will be lost when the system is rebooted.

Flags

Item Description
-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. You can use the flag only with the -a or -l flag.
-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. You can use the flag only with the -a or -l flag.
protocolfamily This flag specifies protocols such as tcp, udp, tcp6, udp6, icmp, and icmp6.

Parameters

Item Description
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 inet6 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 asynchronous transfer mode (ATM)
  • en for Standard Ethernet (inet)
  • et for IEEE 802.3 Ethernet (inet)
  • gre for generic routing encapsulation tunnel pseudointerface (inet)
  • gif for IPv4-over-IPv6 tunnel pseudointerface (inet)
  • tr for token-ring (inet)
  • 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)
  • ib for IP over InfiniBand (inet)
  • tap for TAP pseudo-Ethernet

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.
 
anycast
(inet6 only) Adds the specified anycast address.
 
-anycast
(inet6 only) Deletes the specified anycast address.
 
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 1's.
 
checksum_offload
Enables the flag to indicate that the transmit TCP checksum will be offloaded to the adapter. The command will also reset the per-interface counter that determines whether TCP should dynamically enable or disable offloading of checksum computation.
 
-checksum_offload
Disables transmit TCP checksum offloading.
 
create
(TAP only) Creates a network interface. You can either create a specific interface, such as tap0 or specify the tap option to create the next available TAP interface, such as ifconfig tap create.
 
-dad
(inet6 only) Does not perform duplicate IPv6 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 specify the host portion again.
 
destroy
(TAP only) Destroys a network interface. The ifconfig command removes the specified network interface from the list of interfaces. It also removes the interface and any associated TAP network device from the Object Data Manager (ODM).
 
device dev_name
(ATM network interface only). Specifies the device name that this interface is associated with. Unlike token ring or Ethernet, in case of ATM, there is not a one-to-one correspondence between an interface and a 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. 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 the reception of messages. Routes that use the interface, however, are not automatically disabled.
 
eui64
(inet6 only) Computes real IPv6 address 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 to select it as the source for unbound sockets. The syntax for using this parameter is as follows:
ifconfig interface inet6 first address
 
firstalias
Same as alias, but sets the address in front of the interface address list 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.
 
-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.
 
hwloop
Enables hardware loopback. The hardware loopback specifies that locally addressed packets handled by an interface are sent out by 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 that can 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 can receive IPv6 packets encapsulating IPv6 or IPv4 packets through a tunnel. The apparent destination of the point-to-point tunnel interface might not be the real destination of the packets. At the tunnel endpoint, the decapsulated packets might then be forwarded to their final destination.
 
largesend
Enables one LPAR to send large data in a single packet to another LPAR. It works similarly to largesend over real adapters except in this case no TCP segmentation is done. If the SEA on VIOS supports largesend, the LPAR can transmit large data, which gets segmented by the real adapter on SEA. Use the chdev command to enable the largesend attribute on SEA.
 
-largesend
Disables largesend over virtual Ethernet. This is the default.
 
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 Serial Line Internet Protocol (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. 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 additional hops to the destination network or host.
 
monitor
Enables the underlying adapter to notify the interface layer of link status changes. The adapter must support link status callback notification. If multipath routing is used, alternate routes are selected when a link goes down.
 
-monitor
Disables monitoring of the adapter link status.
 
mtu Value
Sets the maximum IP packet size for this system. The Value variable can be a number in the range 60 - 65535, but is media dependent. See Automatic configuration of network interfaces in AIX® Version 7.1 Networks and communication management for the 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 1's for the bit positions reserved for the network and subnet parts and contains 0's for the bit positions that specify the host. The mask contains at least the standard network portion, and the subnet segment is contiguous with the network segment.

 
pvc
(ATM network interface only). Specifies that this interface will support Permanent Virtual Circuit (PVC) types of virtual connections only.
 
pktchain
Enables the flag to indicate that this interface can handle multiple packets chained together on the output path.
 
-pktchain
Disables the flag that indicates that this interface can handle multiple packets chained together on the output path.
 
svc_c server_addr
(ATM Network interface only). Specifies that this interface supports both switched virtual circuit (SVC) and PVC types of virtual connections. It further specifies that this interface is an ARP client. The server_addr is the list of 20 byte ATM addresses of the ARP servers that this client uses. 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 be separated by a comma.
 
site6
Sets the IPv6 site number (default is 0). This should be used only with site-local addresses on a multiple-site node.
 
svc_s
(ATM network interface only). Specifies that this interface supports both SVC and PVC types of virtual connections. It further specifies that this interface is 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_low_rto
Enables the use of lower retransmission timeouts (RTO) for TCP connections on a low latency, fast network, such as gigabit ethernet and 10 gigabit ethernet). If the networks experience packet drops, the respective TCP connections use the rto value for RTO. The rto values are in the range of 0 - 3000 ms. This runtime option must be set in the if_isno flags field. The use_isno option must also be set for this flag to be effective.
 
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.
 
-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. 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 CPUs running the kernel threads (improved pipelining). For some workloads, this parameter increases the per packet overhead, due to thread scheduling overhead, resulting in higher CPU utilization and possibly lower throughput. This parameter only applies to AIX 4.3.3 or later.
 
-thread
(inet only) Disables kernel thread support that has been configured with the thread parameter. This parameter only applies to AIX 4.3.3 or later.
 
tunnel
Configures a dedicated tunnel for the trusted communication. A tunnel establishes a virtual link between two trusted nodes for transmitting data packets as payloads of other packet headers. A tunnel can be one of the following types:
Generic routing encapsulation (GRE) tunnel
Expects the source and destination IPv4 addresses of the tunnel endpoint as arguments that are followed by the tunnel parameter value. A tunnel is created between the two endpoints.
IPv4 over IPv6 tunnel (GIF tunnel)
Expects the source IPv6 address of the tunnel. The address is followed by a destination IPv4 address and a destination IPv6 address that are separated by a comma. For one-to-many tunnels, each target is separated by a comma.
 
transfer tointerface
Transfers an address and its related static routes from interface to tointerface. For IPv6, this works only for addresses added using the ifconfig command.

ifconfig interface addressfamily address transfer tointerface

 
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 issuing an ifconfig down command.
 
vipa_iflist
Adds the interfaces to the list of interfaces that must use this vipa parameter as the source address in the outgoing packets.
 
-vipa_iflist
Removes the interfaces from the list of interfaces that are configured to use this vipa as the source address in the outgoing packets.
 
scope addrscope zone zoneid
Moves the interface into the topological zone specified by zoneid at the address scope that is specified by the addrscope. IPv6 zones are defined in RFC 4007. The parameter is applicable to only inet6.
rto Specifies the retransmission timeout in milliseconds. The range for this value is 0 - 3000.

Requirement: You must set the timer_wheel_tick value of the no command before setting the rto value using the ifconfig command. The rto value that you specify must be equal to or a multiple of 10 times the timer_wheel_tick value that is set.

In AIX 4.3.3 and later versions, the following network options, commonly known as Interface Specific Network Options (ISNO), 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 by 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 by using the setsockopt subroutine.
tcp_mssdflt Number
Sets the default maximum segment size that is 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 the tcp_mssdflt option. The global value, manipulated through /usr/sbin/no, is used instead.
tcp_recvspace Size
Specifies the default socket buffer size for interface sockets that are 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 the tcp_recvspace option. The global value is used instead.
tcp_sendspace Size
Specifies the default socket buffer size for interface sockets that are 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 the tcp_sendspace option. 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.
Tip: Parameters that you set by using the ifconfig command are lost the next time you restart your system. Use the chdev command to change the Object Data Manager (ODM) database for each interface to make parameter changes permanent. Use the lsattr -E -l [interface] command to view the interface attributes and use the chdev -l [interface] -a [attribute=value] command to change the attribute. For example:
   lsattr -E -l en0
   chdev -l en0 -a tcp_sendspace=65536

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To query the status of a serial line IP interface, enter the following command:
    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 following command:
    ifconfig  lo0  inet  127.0.0.1  up
  3. To mark the local token-ring interface as down, enter the following command:
    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 the following command:
    ifconfig en0 rfc1323 0
  5. To configure a list of interfaces to use a vipa, enter the following command:
    ifconfig vi0 vipa_iflist en0,en1,tr0
  6. To remove interface(s) that are configured to use vipa, enter the following command:
    ifconfig vi0 -vipa_iflist en1,tr0
  7. To find out which interfaces are configured to use a vipa, say vi0, enter the following command:
    ifconfig vi0
  8. To enable link status monitoring, enter the following command:
    ifconfig en0 monitor
    If the link status on adapter ent0 changes to down, the adapter notifies the interface layer, which causes the interface to also be marked as down.
  9. To configure a Generic Routing Encapsulation (GRE) tunnel between the interfaces of two nodes, enter the following command:
    ifconfig gre0 tunnel 9.3.149.70 9.3.149.121
    This creates a GRE tunnel between the local interface 9.3.149.70 and the remote interface 9.3.149.121. The local end of the tunnel is identified by gre0.
  10. To associate an IP address with the newly created interface, enter the following command:
    ifconfig gre0 10.10.10.1
  11. To configure NAT on a GRE tunnel, enter the following command:
    ifconfig gre0 nat toaddr 127.0.0.1 fromport 80 toport 8080 
    In this example, the original destination port of the GRE packet is 80 and the command changes the destination port to 8080 and the destination address to 127.0.0.1.
  12. To configure a GIF tunnel between one-to-many endpoints (one-to-many tunnel), enter the following command:
    ifconfig gif0 10.10.10.1 netmask 255.255.255.0 tunnel  2000::4612:6995:6c4a:fa6e 
    10.10.10.10,2000::4612:6995:6c4a:fa6a 10.10.10.11,2000::4612:6995:6c4a:
    fa6b 15.15.15.1,2000::4612:6995:6c4a:f777
    The command creates a one-to-many tunnel between the source (2000::4612:6995:6c4a:fa6e) and the following three targets:
    • 2000::4612:6995:6c4a:fa6a
    • 2000::4612:6995:6c4a:fa6b
    • 2000::4612:6995:6c4a:f777
    The command also configures the 10.10.10.1 IP address to the GIF interface.
  13. To configure a one-to-one GIF tunnel between two endpoints, enter the following command:
    ifconfig gif0 10.10.10.1 netmask 255.255.255.0 tunnel  2000::4612:6995:6c4a:fa6e 
    10.10.10.10,2000::4612:6995:6c4a:fa66
    The command creates a GIF tunnel between the source (2000::4612:6995:6c4a:fa6e) and the target (2000::4612:6995:6c4a:fa66).
  14. The command also configures the 10.10.10.1 IP address to a GIF interface.

Files

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