ifconfig Command

Purpose

Configures or displays network interface parameters for a network by 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 system. 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 might require separate naming schemes. It is necessary to specify the addressfamily parameter, which might change the interpretation of the remaining parameters. The address families that are 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 that is 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 reports only the details specific to that protocol family.

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

Gratuitous ARP is supported for Ethernet, token-ring, and FDDI interfaces. This support means when an IP address is assigned, the host sends an ARP request for its own address (the new address) to inform other systems 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 by using errpt command (or by 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 that are made to the attributes of an interface by using the ifconfig command are lost when the system is rebooted.

When the detach command is specified with the ifconfig command, all other options are ignored. Specifying the detach command prevents the garbage character in the ipconfig command from causing any error. For example, the ifconfig en3 garbage detach command runs properly even when with the bad option.

Flags

Item Description
-a Optionally, the -a flag can 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 can 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 IP 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 that are 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 also resets the per-interface counter that determines whether TCP must 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 command 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 lets you 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 specified 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 that are 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 that are handled by an interface must be sent out using the associated adapter.
 
ipdst
Specifies an Internet host that can receive IP packets encapsulating ns packets that are 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 value is the default.
 
link [0-2]
Enables special processing of the link level of the interface. These 3 options are interface-specific. In actual effect, however, they are used to select special modes of operation. An example of the usage is to enable Serial Line Internet Protocol (SLIP) compression, or to select the connector type for some Ethernet cards. For more information, see the manual page of the specific driver.
 
-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, alternative 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 Networks and communication management for the maximum transmission unit (MTU) values by interface.
 
netmask Mask
Specifies how much of the address must be reserved for subdividing networks into subnetworks. This parameter can be used only with the inet address family.

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

In the 32-bit address, the Mask variable contains 1s for the bit positions that are reserved for the network and subnet parts, and Mask variable contains 0s for the bit positions that specify the host. The Mask variable contains at least the standard network portion. The subnet segment is contiguous with the network segment.

If the netmask parameter is used without specifying the IP address, the netmask value of the first IP address of the specified interface is updated.

 
pvc
(ATM network interface only). Specifies that this interface supports 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 command must 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 that is 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 value is the default.
 
thread
(inet only) Configures dedicated kernel threads for an interface. This parameter can be used only SMP systems 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 load, due to the thread scheduling load, resulting in higher CPU utilization, and possibly lower throughput.
 
-thread
(inet only) Disables kernel thread support that has been configured with the thread parameter.
 
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 2 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 command works only for addresses added by using the ifconfig command.

ifconfig interface addressfamily address transfer tointerface

Note: If you want to transfer an IP address from one interface to another, and if the destination interface is not part of the virtual LAN (VLAN) to which the IP address belongs, you must add the VLAN to the adapter on which the destination interface is configured.
 
up
Marks an interface as active (up). This parameter is used automatically when you set the first address for an interface. It can also be used to enable an interface after you issue 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 that is 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 you set the rto value by 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.

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 by 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 you communicate 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, which is 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 that is used by TCP. (For more information, see the no command.)
-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 that is used by TCP. (For more information, see the no command.)
-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 by using TCP over this interface follow the Nagle algorithm when you send 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 that 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 Security. For a list of privileges and the authorizations that are 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 result:
    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 interfaces 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 3 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.