IFCONFIG Command
- 1 This operand can be used to change previously defined devices.
- 2 For virtual devices coupling to an existing guest LAN or VSWITCH, the default is the transport type of that guest LAN or VSWITCH.
- 3 PATHMTU is the default when the PATHMTU operand is specified on the ASSORTEDPARMS statement in the TCP/IP configuration file. Otherwise, NOPATHMTU is the default.
Purpose
Use the IFCONFIG command to configure network interfaces for the z/VM® TCP/IP stack or to display the current configuration. It can be used instead of, or in conjunction with, the existing NETSTAT and OBEYFILE commands.
IFCONFIG does not make permanent changes to the network configuration, but it can provide data for this purpose that is compatible with the TCP/IP server configuration file.
Options
- -All
- Displays the status of all TCP/IP interfaces.
- -DEBUG
- Provides information for diagnosing problems associated with the use of this command, in consultation with the IBM® TCP/IP support group.
- -Force
- Bypasses the device consistency verification logic that is used by IFCONFIG when a new device is defined. The device is added to the z/VM TCP/IP configuration.
- -Help
- -?
- Provides help information about the IFCONFIG command. You cannot specify the HELP parameter on the IFCONFIG command line with other parameters.
- -Mdiskpw password
- Specifies the read password, if required, of the first read/write minidisk on which an obey file generated by IFCONFIG is to reside. IFCONFIG uses the OBEYFILE command to facilitate network interface configuration changes, and in so doing creates a temporary obey file for this purpose.
- -Remove
- Removes the interface from the configuration. The option detaches
a real device or destroys a virtual device. The interface must be
inactive before -Remove is specified. Note: -Remove cannot be specified with any command operands.
- -Show
- Displays the TCP/IP server
configuration file statements that are required to change an existing
or define a new interface, but does not change the running system.
These statements are device-specific and limited in scope. Before
using this information to apply permanent changes to the TCP/IP server configuration,
make sure all of the data that is needed for a given statement is provided.
If no interface is specified with the -Show option, information about all known, active interfaces is displayed.
- -TCP userid
- Applies this instance of the IFCONFIG command to a specific z/VM TCP/IP stack virtual
machine. The IFCONFIG command communicates with the TCP/IP stack identified
by any one of the following:
- The user ID specified with the -TCP option
- The TCPIPID C environment variable (established via the command):
GLOBALV SELECT CENV SETL TCPIPID userid - The TcpipUserid value from the TCPIP DATA file
- User
TCPIP
- -Verbose
- Displays any CP or NETSTAT commands that are used while changing the running system. To obtain a complete picture of what commands and TCP/IP configuration file statements are required to manually configure z/VM TCP/IP, the -Verbose option can be combined with the -Show option, but then no changes are made to the running system.
Operands
- interface
- Specifies the name of a network interface assigned to
a particular TCP/IP virtual
machine. This interface name is limited to 16 characters and cannot
begin with a dash (-), end with a colon (:), or contain a semicolon
(;).
The interface name corresponds to the link name that is defined on a LINK statement in PROFILE TCPIP.
- ipv4_address
- The primary IPv4 address of the interface.
- masklength
- The number of bits used to represent the subnet mask of the interface.
Example: 192.168.0.12/24 indicates that a subnet mask of 255.255.255.0 is to be used with an IPv4 address of 192.168.0.12.
If the ipv4_address/masklength format is used rather than simply the ipv4_address format, then the NETMASK or MASK operand cannot be used.
Note: The masklength must be between /1 and /30. The IP address must not be the subnet address or broadcast address for the network described by the IPv4 address/masklength pair (that is, it cannot be the first or last address in the subnet's range). For point-to-point links, a masklength of /30 is recommended. - ipv6_address/prefixlength
- The primary IPv6 address of the interface, followed by the number
of bits used to identify the prefix associated with the address.
Example: fe80:0:0:0:210:a4ff:fee3:956/64 indicates that a prefix of FFFF:FFFF:FFFF:FFFF:0:0:0:0 is to be used with an IP version 6 address of fe80:0:0:0:210:a4ff:fee3:956.
- ADD ipv4_address/masklength
- ADD ipv6_address/prefixlength
- Adds an IPv4 address and subnet mask pair or IPv6 address and prefix pair to the home list of the interface.
BUFFERS minbuffers-maxbuffers
BUFFERS number
Specifies a number or a range of input buffers to be allocated for an EQDIO connection.
For a range, specify two numbers separated by a single hyphen (-) with no blank spaces — for example:
x-y, where x is less than y.
Note: Due to internal device architecture, minbuffers, maxbuffers, or both values might be rounded to an approximate value. For example, if 3000-65000 is specified, the minbuffers and maxbuffers values implemented might be 3008-64992. Likewise, a single value such as 50000 might result in a value of 49984 being used.
- CPU nn
- Specifies the virtual processor to be used to run the device driver for the interface. nn must be an integer between 0 and 6.
- CTC rdevno
- Defines a real channel-to-channel interface.
- DELete ipv4_address/masklength
- DELete ipv6_address/prefixlength
- Removes an IPv4 address and subnet mask pair or IPv6 address and prefix pair from the home list of the interface.
- ETH rdevno routertype
Defines an
EQDIO
or QDIO Ethernet interface. ETH supports IPv4 and IPv6 router interface types.
For IPv4, routertype can be PRImary, SECondary, or NONrouter.
For IPv6, routertype can be IPV6PRImary, IPV6SECondary, or IPV6NONrouter.
Only one IPv4 primary router interface (PRImary) can be defined for a QDIO device and only
one IPv6 primary router interface (IPV6PRImary) can be defined for a QDIO device.
While they can be the same interface, the QDIO devices do not have to be the same interface.
If the router type is specified for an
EQDIO
interface, the specification is ignored.

- HIPersockets rdevno
- HS rdevno
- Defines a real HiperSockets connection.
- IP
- ETHERNET
- Indicates whether the transport for the link is ETHERNET or IP. An ETHERNET link operates at the
Layer 2 level of the OSI model while an IP link operates at Layer 3. This operand can be specified
only for real or virtual
QDIO Ethernet devices. Note: Router type is not supported for Layer 2.
- IUCV userid
- Defines an IUCV interface.
- MASK mask
- NETMASK mask
- Defines or changes the subnet mask that is associated with the
interface. When defining an interface, the default value for the subnet mask is determined by the value of the first octet of the IP address:The default subnet mask applies only when defining an interface. Unless you use the mask option, changing the IP address of an existing interface leaves the mask unchanged.
If the value of the first octet is: The default subnet mask is: 0-127 255.0.0.0 128-191 255.255.0.0 192-223 255.255.255.0 Note: The mask must be between 128.0.0.0 and 255.255.255.252. The IP address must not be the subnet address or broadcast address for the network described by the IPv4 address/mask pair (that is, it cannot be the first or last address in the subnet's range). For point-to-point links, a subnet mask of 255.255.255.252 is recommended. - MTU mtusize
- Defines or changes the maximum transmission unit (MTU) size that is to be used on the interface.
To determine the recommended MTU size, refer to the hardware documentation associated with the
device.
If you specify 0 or omit this option, the TCP/IP stack selects an intelligent default. See Intelligent Default MTU Values Based on the Device and Link Type.
- NOFORWARD
- NOFWD
- Specifies that packets received on this link are not to be forwarded to another host (that is, packets destined for a foreign host are to be discarded) and that packets transmitted on this link must originate from the local host. Packets received for another host on this link are to be dropped, as are packets received for another host on any link and forwarded through this one. If you do not specify this option, packets received or transmitted on the link can be forwarded to another host.
- PATHMTU
- NOPATHMTU
- Specifies the use of path MTU discovery on IPv4 routes for a given link. PATHMTU is the default when the PATHMTU operand is specified on the ASSORTEDPARMS statement in the TCP/IP configuration file. Otherwise, NOPATHMTU is the default. These operands have no effect on IPv6 routes. Path MTU discovery is always enabled for IPv6 and cannot be disabled.
- POINTOPOINT ipv4_address
- PTP ipv4_address
- P2P ipv4_address
- Defines or changes the IP address associated with the other end of a point-to-point interface.
- PORTNAme portname
- Specifies the Queued Direct I/O (QDIO) port name when it is being defined to be used by this interface. The portname is limited to a maximum of 8 characters and is optional. If you specify a port name, all TCP/IP stacks that share a QDIO device must specify the same port name. The port name is optional in all supported levels of the real or virtual OSA-Express adapters.
- PORTNUmber nn
- Specifies the physical port or adapter number on the device when
it is being defined to be used by this interface. This number depends
on the device type:
- For Channel-to-Channel (CTC) connections, specify 0 or 1.
- For IBM Open Systems Adapter-Express operating in QDIO mode, specify a decimal number in the range 0-15. The value of the port number depends on how many ports the OSA-Express adapter supports. If the port number is not specified, it will default to port 0.
- Do not specify a port number for other devices.
- UP
- DOWN
- Starts or stops the interface.
- VCTC vdevno1 userid vdevno2
- Defines a virtual channel-to-channel interface. A virtual CTC is defined and coupled to the specified user's virtual device.
- VETH vdevno ownerid lanname
- Defines a
virtual Ethernet
connection to the named guest LAN or virtual switch.
If EQDIO virtual NICs are supported, an EQDIO VNIC will be defined. Otherwise, a QDIO VNIC will be defined.
If a VSWITCH name is specified, ownerid must be SYSTEM.
If no guest LAN or VSWITCH exists with the specified ownerid/lanname combination, a QDIO guest LAN will be created.
ownerid and lanname are limited to a maximum of 8 characters each.
- VHIPersockets vdevno ownerid lanname
- VHS vdevno ownerid lanname
- Defines a virtual HiperSockets connection on the named guest LAN. If no guest LAN exists with the specified ownerid and lanname combination, a HiperSockets guest LAN will be created. The ownerid and lanname are limited to a maximum of 8 characters each.
- VLAN ipv4vlan [ipv6vlan]
- Specifies the identifier for a Virtual Local Area Network (VLAN). ipv4vlan and
ipv6vlan are values from 1 to 4094. VLAN can be specified on QDIO
Ethernet devices and HiperSockets devices.
For a QDIO Ethernet device, two VLANs can be specified. VLAN ipv4vlan specifies the IPv4 VLAN ID. You can optionally specify a separate VLAN ID for your IPv6 network by using ipv6vlan. If ipv6vlan is not specified, ipv4vlan is also used for the IPv6 network.
For a HiperSockets device, only one VLAN ID, ipv4vlan, can be specified.
Examples
- To define an interface to a real HiperSockets adapter, enter the
following:
where:ifconfig hsi0 10.1.0.1 mask 255.255.255.240 hs 3904 portname hs5aNote: A default maximum transmission unit size of 4000 is used. - To define an interface to a virtual HiperSockets adapter that is
connected to a z/VM guest
LAN owned by SYSTEM and named PROD1, enter the following:
where:ifconfig vhsi0 10.2.0.1 vhs 3904 system prod1 mtu 8192Note: The default subnet mask (255.0.0.0) is used. - To define an IUCV interface to user TCPIP2, enter the following:
where:ifconfig iucv0 10.4.0.1/30 pointopoint 10.4.0.2 iucv tcpip2 mtu 9216 - To define an interface to a 1Gb Ethernet Open Systems Adapter Express at address 6904-6906
that will participate in a VLAN with an ID of 8, enter the following:
where:ifconfig eth0 192.60.25.6 eth 6904 primary mtu 1500 portname osa69 vlan 8Note: The default subnet mask (255.255.255.0) is used.Now specify the IFCONFIG command with only the interface name, ETH0, to make sure the connection was defined correctly:
The output will look something like this:ifconfig eth0ETH0 inet addr: 192.60.25.6 mask: 255.255.255.0 UP MULTICAST MTU: 1500 vdev: 6904 rdev: 6904 type: QDIO ETHERNET portname: OSA69 transport type: IP ipv4 router type: PRIMARY ipv6:DISABLED cpu: 0 forwarding: ENABLED ipv4 path MTU discovery: DISABLED RX bytes: 33932 TX bytes: 15534 - To define an interface to an Ethernet Open Systems Adapter Express (OSA-Express2)
at address 3000-3003 that will operate in layer 2 mode, enter the
following:
where:ifconfig eth1 10.11.12.26 eth 3000 ethernet mtu 1500Now specify the IFCONFIG command with only the interface name, ETH1, to make sure the connection was defined correctly:
The output will look something like this:ifconfig eth1ETH1 inet addr: 10.11.12.26 mask: 255.0.0.0 UP BROADCAST MULTICAST MTU: 1500 vdev: 3000 rdev: 3000 type: QDIO ETHERNET portname: UNASSIGNED transport type: ETHERNET MAC address: 02-09-57-00-00-10 ipv6: DISABLED cpu: 0 forwarding: ENABLED ipv4 path MTU discovery: DISABLED RX bytes: 110 TX bytes: 0 - To display information about an interface that is not up, enter the following:
The output will look something like this:ifconfig
osd
1
OSD1 inet addr: 10.200.13.78 mask: 255.255.255.0 UP BROADCAST MULTICAST MTU: 1500 vdev: 508A rdev: 508A type: QDIO ETHERNET portname: UNASSIGNED portnumber: 0 transport type: IP ipv4 router type: NONROUTER ipv6: DISABLED cpu: 0 forwarding: ENABLED ipv4 path MTU discovery: DISABLED RX bytes: 15159 TX bytes: 37495
Note: Question marks (?) are displayed for the subnet mask and the maximum transmission unit size because they are not known. - To display the TCP/IP configuration file
statements needed to define a channel-to-channel (CTC) interface, enter the following:
where:ifconfig ctc0 10.14.6.1/30 vctc 800 tcpip2 3600 ptp 10.14.6.2 portnumber 0 -showNote: Because an MTU was not specified on the command, the LINK MTU is configured as 0, forcing the stack to choose an intelligent default according to Intelligent Default MTU Values Based on the Device and Link Type.The output will look something like this:; Generated by <IFCONFIG ctc0 10.14.6.1 vctc 800 tcpip2 3600 ; ptp 10.14.6.2 portnumber 0 -show> ; 25 Mar 2024 12:16:57 DEVICE DEV@800 CTC 800 LINK CTC0 CTC 0 DEV@800 MTU 0 HOME 10.14.6.1 255.255.255.252 CTC0 START DEV@800 - To display the TCP/IP configuration file
statements needed to define a virtual HiperSockets interface to another virtual HiperSockets
connection, enter the following:
where:ifconfig vhs3 10.2.0.1 mask 255.255.0.0 vhs 3500 tcpip41 subnt96 -showNote: Because an MTU was not specified on the command, the LINK MTU is configured as 0, forcing the stack to choose an intelligent default according to Intelligent Default MTU Values Based on the Device and Link Type.The output will look something like this:; Generated by <IFCONFIG vhs3 10.2.0.1 mask 255.255.0.0 vhs ; 3500 tcpip41 subnt96 -show> ; 25 Mar 2005 12:20:54 DEVICE DEV@3500 HIPERS 3500 LINK VHS3 QDIOIP DEV@3500 MTU 0 HOME 10.2.0.1 255.255.0.0 VHS3 START DEV@3500 - To connect a virtual
EQDIO device (if supported)
to an existing QDIO
guest LAN named TEST1 that is owned by user TCPIP41, display any CP
or NETSTAT commands that were used to change the system, and apply
these changes to a specific TCP/IP stack virtual
machine named TCPIP39, enter the following:
where:ifconfig eth0 10.1.1.1 veth 3400 tcpip41 test1 -v -tcp tcpip39The output will look something like this:* NETSTAT TCP TCPIP39 CP QUERY LAN TEST1 OWNER TCPIP41 * NETSTAT TCP TCPIP39 CP DEFINE NIC 3400
EQDIO
* NETSTAT TCP TCPIP39 CP COUPLE 3400 TCPIP41 SUBNT176
* OBEYFILE IFCONFIG CMSUT1 A ( TCP TCPIP39 - To define a real HiperSockets connection, display any CP or NETSTAT
commands that were used to change the system, and apply these changes
to a specific TCP/IP stack
virtual machine named TCPIP2, enter the following:
where:ifconfig hs0 10.1.2.1 hs fb00 -v -tcp tcpip2The output will look something like this:* NETSTAT TCP TCPIP2 CP ATTACH FB00 TCPIP2 FB00 * NETSTAT TCP TCPIP2 CP ATTACH FB01 TCPIP2 FB01 * NETSTAT TCP TCPIP2 CP ATTACH FB02 TCPIP2 FB02 * OBEYFILE IFCONFIG CMSUT1 A ( TCP TCPIP2 - To define a virtual CTC connection and display any CP or NETSTAT commands that were used to
change the system, enter the following:
where:ifconfig ctc0 10.1.3.1/30 vctc 800 tcpip2 3600 ptp 10.1.3.2 portnum 1 -vThe output will look something like this:* NETSTAT TCP TCPIP CP DEFINE 3088 800 * NETSTAT TCP TCPIP CP DEFINE 3088 801 * NETSTAT TCP TCPIP CP COUPLE 800 TCPIP2 3600 * NETSTAT TCP TCPIP CP COUPLE 801 TCPIP2 3601 * OBEYFILE IFCONFIG CMSUT1 A ( TCP TCPIP - To define an interface to a real Open Systems Adapter Express at address 5200-5202 using IP version 6, enter the following:
where:ifconfig eth0 1080:0:0:0:210:a4ff:fee3:956/64 eth 5200 secondary ipv6primary portname osa52Note: A default maximum transmission unit size of 1500 is used. - To add the IPv4 address 192.168.0.9 with a subnet mask of 255.255.255.0
to interface eth1 (which must be defined already), enter the following:
where:ifconfig eth1 add 192.168.0.9/24 - To delete the IPv6 address 1080:0:0:0:AB32:800:FF83:10 with prefix
length of 64 from interface eth3, enter the following:
where:ifconfig eth3 delete 1080:0:0:0:AB32:800:FF83:10/64 - In this example, eth0 and eth1 are attached to the 9.60.59.0/26 subnet.
The following shows the IFCONFIG output after eth1 has experienced an outage:
ifconfig -all ETH0 inet addr: 9.60.59.6 mask: 255.255.255.192 UP BROADCAST MULTICAST MTU: 1500 vdev: 0600 type: QDIO ETHERNET portname: UNASSIGNED transport type: IP ipv4 router type: NONROUTER ipv6: DISABLED LAN owner: SYSTEM name: SUBNTA cpu: 0 forwarding: ENABLED ipv4 path MTU discovery: DISABLED RX bytes: 0 TX bytes: 0 ETH1 inet addr: 9.60.59.7 mask: 255.255.255.192 DOWN MTU: 1500 vdev: 0700 type: QDIO ETHERNET portname: UNASSIGNED transport type: IP ipv4 router type: NONROUTER ipv6: DISABLED LAN owner: SYSTEM name: SUBNTA cpu: 0 forwarding: ENABLED ipv4 path MTU discovery: DISABLED RX bytes: 0 TX bytes: 0 IPv4 Takeover Link: ETH0The IPv4 Takeover Link field in the eth1 output shows that IPv4 ARP responsibility for eth1's IP addresses has been taken over by eth0. For more information on interface takeover, see Interface Takeover for Local Area Networks.
Usage Notes
- Entering the IFCONFIG command with no other parameters specified displays all active interfaces.
- Use the IFCONFIG command to configure the following types of interfaces:
- CTC
EQDIO
- HiperSockets
- IUCV
- QDIO
- After an interface is defined using IFCONFIG, the only operands that can be changed are the IP address, subnet mask, peer IP address and MTU size. The interface can also be started and stopped. A particular real device can be defined only once to TCP/IP.
- In order to use IFCONFIG to create a device that is enabled for IPv6, you must specify an IPv6 address either as the primary address or on the ADD operand of the initial command that is used to create the device. Otherwise, even though the device itself is IPv6 capable, it is not enabled in the TCP/IP stack and cannot be enabled later without recycling the stack.
- VLAN configuration information can be found in Planning for Guest LANs and Virtual Switches in z/VM: Connectivity.
- Be aware that the IFCONFIG command makes use of the NETSTAT and
OBEYFILE commands to facilitate its operations. To use this command
to make network interface changes, your user ID must be included in
the OBEY list in the TCP/IP server
configuration file.
Note also that one or more considerations regarding use of the NETSTAT and OBEYFILE commands might apply when you use the IFCONFIG command. For specific information, see the Usage Notes for these commands.
- When running MPRoute, various defaults are taken when dealing
with interfaces that are not defined in the MPRoute configuration file. This
could cause undesirable routing scenarios when using IFCONFIG to configure
new interfaces to the stack. In order to avoid this, make sure you have:
specified in the MPRoute configuration file if you plan on using IFCONFIG in this manner.GLOBAL_OPTIONS IGNORE_UNDEFINED_INTERFACE=YES; - The amount of information returned on an IFCONFIG query could differ depending on whether or not the user issuing the command is in the OBEY list of the TCP/IP server.
Return Codes
- Return Code
- Description
- 0
- The command completed successfully.
- 4
- The command completed successfully, but a warning condition was detected.
- 8
- The command was not specified correctly.
- 12
- An error was encountered.
- 16
- An unexpected condition was encountered.
