znetconf - List and configure network devices

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest

Use the znetconf command to list, configure, add, and remove network devices.

The znetconf command:
  • Lists potential network devices.
  • Lists configured network devices.
  • Automatically configures and adds network devices.
  • Removes network devices.
For automatic configuration, znetconf first builds a channel command word (CCW) group device from sensed CCW devices. It then configures any specified option through the sensed network device driver and sets the new network device online.

During automatic removal, znetconf sets the device offline and removes it.

Attention: Removing all network devices might lead to complete loss of network connectivity. Unless you can access your Linux® instance from a terminal server on z/VM® (see How to Set up a Terminal Server Environment on z/VM, SC34-2596), you might require the HMC or a 3270 terminal session to restore the connectivity.
Before you begin: The qeth, ctcm, or lcs device drivers must be loaded. If needed, the znetconf command attempts to load the particular device driver.

znetconf syntax


1  znetconf
2.1 
2.2.1 -a+ ,<device_bus_id>
2.2.1 -A?+ -e <device_bus_id>
2.1?  + -o <attribute>=<value>
2.2.1? -d <driver>
2.1 
2.2.1 -r+ ,<device_bus_id>
2.2.1  -R?+ -e <device_bus_id>
2.2.1? -n
2.2.1 -u
2.2.1 -c
Where:
-a or --add
configures the network device with the specified device bus-ID. If you specify only one bus ID, the command automatically identifies the remaining bus IDs of the group device. You can enter a list of device bus-IDs that are separated by commas. The znetconf command does not check the validity of the combination of device bus-IDs.
<device_bus_id>
specifies the device bus-ID of the CCW devices that constitute the network device. If a device bus-ID begins with "0.0.", you can abbreviate it to the final hexadecimal digits. For example, you can abbreviate 0.0.f503 to f503.
-A or --add-all
configures all potential network devices. After you run znetconf -A, enter znetconf -c to see which devices were configured. You can also enter znetconf -u to display devices that were not configured.
-e or --except
omits the specified devices when configuring all potential network devices or removing all configured network devices.
-o <attribute>=<value> or --option <attribute>=<value>
configures devices with the specified sysfs option.
-d <driver name> or --driver <driver name>
configures devices with the specified device driver. Valid values are qeth, lcs, ctc, or ctcm.
-n or --non-interactive
answers all confirmation questions with "Yes".
-r or --remove
removes the network device with the specified device bus-ID. You can enter a list of device bus-IDs that are separated by a comma. You can remove only configured devices as listed by znetconf -c.
-R or --remove-all
removes all configured network devices. After successfully running this command, all devices that are listed by znetconf -c become potential devices that are listed by znetconf -u.
-u or --unconfigured
lists all network devices that are not yet configured.
-c or --configured
lists all configured network devices.
-h or --help
displays short information about command usage. To view the man page, enter man znetconf.
-v or --version
displays version information.
If the command completes successfully, znetconf returns 0. Otherwise, 1 is returned.

Examples

  • To list all potential network devices:
    # znetconf -u
    Device IDs                 Type    Card Type  CHPID Drv.
    --------------------------------------------------------
    0.0.f500,0.0.f501,0.0.f502 1731/01 OSA (QDIO) 00    qeth
    0.0.f503,0.0.f504,0.0.f505 1731/01 OSA (QDIO) 01    qeth
  • To configure device 0.0.f503:
    znetconf -a 0.0.f503
    or
    znetconf -a f503
  • To configure the potential network device 0.0.f500 with the layer2 option with the value 0:
    znetconf -a f500 -o layer2=0 
  • To list configured network devices:
    znetconf -c
    Device IDs                 Type    Card Type     CHPID Drv. Name          State
    --------------------------------------------------------------------------------
    0.0.f500,0.0.f501,0.0.f502 1731/01 Virt.NIC QDIO 00    qeth encf500 online
    0.0.f503,0.0.f504,0.0.f505 1731/01 Virt.NIC QDIO 01    qeth encf503 online
    0.0.f5f0,0.0.f5f1,0.0.f5f2 1731/01 OSD_1000      76    qeth encf5f0 online
  • To remove network device 0.0.f503:
    znetconf -r 0.0.f503
    or
    znetconf -r f503
  • To remove all configured network devices except the devices with bus IDs 0.0.f500 and 0.0.f5f0:
    znetconf -R -e 0.0.f500 -e 0.0.f5f0
  • To configure all potential network devices except the device with bus ID 0.0.f503:
    znetconf -A -e 0.0.f503