znetconf - List and configure network devices
![]()
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.
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 part
of the compiled kernel or loaded as modules. If needed, the znetconf command
attempts to load the particular device driver.
znetconf syntax
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 or --option <attribute>=<value>
- configures devices with the specified sysfs
option.
For qeth attributes, note that some are specific to the layer 2 or layer 3 mode of operation. Specify the
layer2=[0|1]option as the first attribute. - -d 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 help information for the command. To view the man page, enter man znetconf.
- -v or --version
- displays version information.
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
layer2option with the value 0 and theportnooption with the value1:# znetconf -a f500 -o layer2=0 -o portno=1
- 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 eth2 online 0.0.f503,0.0.f504,0.0.f505 1731/01 Virt.NIC QDIO 01 qeth eth1 online 0.0.f5f0,0.0.f5f1,0.0.f5f2 1731/01 OSD_1000 76 qeth eth0 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