20.3. Adding a Network Device Network device driver modules are loaded automatically by udev . You can add a network interface on IBM Z dynamically or persistently. Dynamically Load the device driver Remove the network devices from the list of ignored devices. Create the group device. Configure the device. Set the device online. Persistently Create a configuration script. Activate the interface. The following sections provide basic information for each task of each IBM Z network device driver. Section 20.3.1, "Adding a qeth Device" describes how to add a qeth device to an existing instance of Red Hat Enterprise Linux. Section 20.3.2, "Adding an LCS Device" describes how to add an lcs device to an existing instance of Red Hat Enterprise Linux. 20.3.1. Adding a qeth Device The qeth network device driver supports IBM Z OSA-Express features in QDIO mode, HiperSockets, z/VM guest LAN, and z/VM VSWITCH. The qeth device driver assigns the same interface name for Ethernet and Hipersockets devices: enccw bus_ID . The bus ID is composed of the channel subsystem ID, subchannel set ID, and device number, for example enccw0.0.0a00 . 20.3.1.1. Dynamically Adding a qeth Device To add a qeth device dynamically, follow these steps: Determine whether the qeth device driver modules are loaded. The following example shows loaded qeth modules: If the output of the lsmod command shows that the qeth modules are not loaded, run the modprobe command to load them: Use the cio_ignore utility to remove the network channels from the list of ignored devices and make them visible to Linux: Replace read_device_bus_id , write_device_bus_id , data_device_bus_id with the three device bus IDs representing a network device. For example, if the read_device_bus_id is 0.0.f500 , the write_device_bus_id is 0.0.f501 , and the data_device_bus_id is 0.0.f502 : Use the znetconf utility to sense and list candidate configurations for network devices: Select the configuration you want to work with and use znetconf to apply the configuration and to bring the configured group device online as network device. Optionally, you can also pass arguments that are configured on the group device before it is set online: Now you can continue to configure the enccw0.0.f500 network interface. Alternatively, you can use sysfs attributes to set the device online as follows: Create a qeth group device: For example: , verify that the qeth group device was created properly by looking for the read channel: You can optionally set additional parameters and features, depending on the way you are setting up your system and the features you require, such as: portno layer2 portname Bring the device online by writing 1 to the online sysfs attribute: Then verify the state of the device: A return value of 1 indicates that the device is online, while a return value 0 indicates that the device is offline. Find the interface name that was assigned to the device: Now you can continue to configure the enccw0.0.f500 network interface. The following command from the s390utils package shows the most important settings of your qeth device: 20.3.1.2. Dynamically Removing a qeth Device To remove a qeth device, use the znetconf utility. For example: Use the znetconf utility to show you all configured network devices: Select the network device to be removed and run znetconf to set the device offline and ungroup the ccw > group device. Verify the success of the removal: 20.3.1.3. Persistently Adding a qeth Device To make your new qeth device persistent, you need to create the configuration file for your new interface. The network interface configuration files are placed in the /etc/sysconfig/network-scripts/ directory. The network configuration files use the naming convention ifcfg- device , where device is the value found in the if_name file in the qeth group device that was created earlier, for example enccw0.0.09a0 . The cio_ignore commands are handled transparently for persistent device configurations and you do not need to free devices from the ignore list manually. If a configuration file for another device of the same type already exists, the simplest way is to copy it to the new name and then edit it: To learn IDs of your network devices, use the lsqeth utility: If you do not have a similar device defined, you must create a new file. Use this example of /etc/sysconfig/network-scripts/ifcfg-0.0.09a0 as a template: Edit the new ifcfg-0.0.0600 file as follows: Modify the DEVICE statement to reflect the contents of the if_name file from your ccw group. Modify the IPADDR statement to reflect the IP address of your new interface. Modify the NETMASK statement as needed. If the new interface is to be activated at boot time, then make sure ONBOOT is set to yes . Make sure the SUBCHANNELS statement matches the hardware addresses for your qeth device. Please, note that the IDs must be specified in lowercase. Modify the PORTNAME statement or leave it out if it is not necessary in your environment. You can add any valid sysfs attribute and its value to the OPTIONS parameter. The Red Hat Enterprise Linux installation program currently uses this to configure the layer mode ( layer2 ) and the relative port number ( portno ) of qeth devices. The qeth device driver default for OSA devices is now layer 2 mode. To continue using old ifcfg definitions that rely on the default of layer 3 mode, add layer2=0 to the OPTIONS parameter. /etc/sysconfig/network-scripts/ifcfg-0.0.0600 Changes to an ifcfg file only become effective after rebooting the system or after the dynamic addition of new network device channels by changing the system's I/O configuration (for example, attaching under z/VM). Alternatively, you can trigger the activation of a ifcfg file for network channels which were previously not active yet, by executing the following commands: Use the cio_ignore utility to remove the network channels from the list of ignored devices and make them visible to Linux: Replace read_device_bus_id , write_device_bus_id , data_device_bus_id with the three device bus IDs representing a network device. For example, if the read_device_bus_id is 0.0.0600 , the write_device_bus_id is 0.0.0601 , and the data_device_bus_id is 0.0.0602 : To trigger the uevent that activates the change, issue: For example: Check the status of the network device: Now start the new interface: Check the status of the interface: Check the routing for the new interface: Verify your changes by using the ping utility to ping the gateway or another host on the subnet of the new device: If the default route information has changed, you must also update /etc/sysconfig/network accordingly. 20.3.2. Adding an LCS Device The LAN channel station (LCS) device driver supports 1000Base-T Ethernet on the OSA-Express2 and OSA-Express 3 features. The LCS device driver assigns the following interface name for OSA-Express Fast Ethernet and Gigabit Ethernet devices: enccw bus_ID . The bus ID is composed of the channel subsystem ID, subchannel set ID, and device number, for example enccw0.0.0a00 . 20.3.2.1. Dynamically Adding an LCS Device Load the device driver: Use the cio_ignore utility to remove the network channels from the list of ignored devices and make them visible to Linux: Replace read_device_bus_id and write_device_bus_id with the two device bus IDs representing a network device. For example: Create the group device: Configure the device. OSA cards can provide up to 16 ports for a single CHPID. By default, the LCS group device uses port 0 . To use a different port, issue a command similar to the following: Replace portno with the port number you want to use. Set the device online: To find out what network device name has been assigned, enter the command: 20.3.2.2. Persistently Adding an LCS Device The cio_ignore commands are handled transparently for persistent device configurations and you do not need to free devices from the ignore list manually. To add an LCS device persistently, follow these steps: Create a configuration script as file in /etc/sysconfig/network-scripts/ with a name like ifcfg- device , where device is the value found in the if_name file in the qeth group device that was created earlier, for example enccw0.0.09a0 . The file should look similar to the following: Modify the value of PORTNAME to reflect the LCS port number ( portno ) you would like to use. You can add any valid lcs sysfs attribute and its value to the optional OPTIONS parameter. See Section 20.3.1.3, "Persistently Adding a qeth Device" for the syntax. Set the DEVICE parameter as follows: Issue an ifup command to activate the device: Changes to an ifcfg file only become effective after rebooting the system. You can trigger the activation of a ifcfg file for network channels by executing the following commands: Use the cio_ignore utility to remove the LCS device adapter from the list of ignored devices and make it visible to Linux: Replace read_device_bus_id and write_device_bus_id with the device bus IDs of the LCS device. For example: To trigger the uevent that activates the change, issue: For example: 20.3.3. Configuring a IBM Z Network Device for Network Root File System To add a network device that is required to access the root file system, you only have to change the boot options. The boot options can be in a parameter file (see Chapter 21, Parameter and Configuration Files on IBM Z ) or part of a zipl.conf on a DASD or FCP-attached SCSI LUN prepared with the zipl boot loader. There is no need to recreate the initramfs. Dracut , the mkinitrd successor that provides the functionality in the initramfs that in turn replaces initrd , provides a boot parameter to activate network devices on IBM Z early in the boot process: rd.znet= . As input, this parameter takes a comma-separated list of the NETTYPE (qeth, lcs, ctc), two (lcs, ctc) or three (qeth) device bus IDs, and optional additional parameters consisting of key-value pairs corresponding to network device sysfs attributes. This parameter configures and activates the IBM Z network hardware. The configuration of IP addresses and other network specifics works the same as for other platforms. See the dracut documentation for more details. The cio_ignore commands for the network channels are handled transparently on boot. Example boot options for a root file system accessed over the network through NFS:

Commands:
lsmod | grep qeth qeth_l3 127056 9 qeth_l2 73008 3 ipv6 492872 155ip6t_REJECT,nf_conntrack_ipv6,qeth_l3 qeth 115808 2 qeth_l3,qeth_l2 qdio 68240 1 qeth ccwgroup 12112 2 qeth
modprobe qeth
cio_ignore -r read_device_bus_id , write_device_bus_id , data_device_bus_id
cio_ignore -r 0.0.f500,0.0.f501,0.0.f502
znetconf -u Scanning for network devices 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 0.0.0400,0.0.0401,0.0.0402 1731/05 HiperSockets 02 qeth
znetconf -a f500 Scanning for network devices Successfully configured device 0.0.f500 (enccw0.0.f500)
znetconf -a f500 -o portname=myname Scanning for network devices Successfully configured device 0.0.f500 (enccw0.0.f500)
echo read_device_bus_id , write_device_bus_id , data_device_bus_id > /sys/bus/ccwgroup/drivers/qeth/group
echo 0.0.f500,0.0.f501,0.0.f502 > /sys/bus/ccwgroup/drivers/qeth/group
ls /sys/bus/ccwgroup/drivers/qeth/0.0.f500
echo 1 > /sys/bus/ccwgroup/drivers/qeth/0.0.f500/online
cat /sys/bus/ccwgroup/drivers/qeth/0.0.f500/online 1
cat /sys/bus/ccwgroup/drivers/qeth/0.0.f500/if_name enccw0.0.f500
lsqeth enccw0.0.f500 Device name : enccw0.0.f500 ------------------------------------------------- card_type : OSD_1000 cdev0 : 0.0.f500 cdev1 : 0.0.f501 cdev2 : 0.0.f502 chpid : 76 online : 1 portname : OSAPORT portno : 0 state : UP (LAN ONLINE) priority_queueing : always queue 0 buffer_count : 16 layer2 : 1 isolation : none
znetconf -c Device IDs Type Card Type CHPID Drv. Name State -------------------------------------------------------------------------------------- 0.0.8036,0.0.8037,0.0.8038 1731/05 HiperSockets FB qeth hsi1 online 0.0.f5f0,0.0.f5f1,0.0.f5f2 1731/01 OSD_1000 76 qeth enccw0.0.09a0 online 0.0.f500,0.0.f501,0.0.f502 1731/01 GuestLAN QDIO 00 qeth enccw0.0.f500 online
znetconf -r f500 Remove network device 0.0.f500 (0.0.f500,0.0.f501,0.0.f502)? Warning: this may affect network connectivity! Do you want to continue (y/n)?y Successfully removed device 0.0.f500 (enccw0.0.f500)
znetconf -c Device IDs Type Card Type CHPID Drv. Name State -------------------------------------------------------------------------------------- 0.0.8036,0.0.8037,0.0.8038 1731/05 HiperSockets FB qeth hsi1 online 0.0.f5f0,0.0.f5f1,0.0.f5f2 1731/01 OSD_1000 76 qeth enccw0.0.09a0 online
cd /etc/sysconfig/network-scripts # cp ifcfg-enccw0.0.09a0 ifcfg-enccw0.0.0600
lsqeth -p devices CHPID interface cardtype port chksum prio-q'ing rtr4 rtr6 lay'2 cnt -------------------------- ----- ---------------- -------------- ---- ------ ---------- ---- ---- ----- ----- 0.0.09a0/0.0.09a1/0.0.09a2 x00 enccw0.0.09a0 Virt.NIC QDIO 0 sw always_q_2 n/a n/a 1 64 0.0.0600/0.0.0601/0.0.0602 x00 enccw0.0.0600 Virt.NIC QDIO 0 sw always_q_2 n/a n/a 1 64
IBM QETH DEVICE=enccw0.0.09a0 BOOTPROTO=static IPADDR=10.12.20.136 NETMASK=255.255.255.0 ONBOOT=yes NETTYPE=qeth SUBCHANNELS=0.0.09a0,0.0.09a1,0.0.09a2 PORTNAME=OSAPORT OPTIONS='layer2=1 portno=0' MACADDR=02:00:00:23:65:1a TYPE=Ethernet
IBM QETH DEVICE=enccw0.0.0600 BOOTPROTO=static IPADDR=192.168.70.87 NETMASK=255.255.255.0 ONBOOT=yes NETTYPE=qeth SUBCHANNELS=0.0.0600,0.0.0601,0.0.0602 PORTNAME=OSAPORT OPTIONS='layer2=1 portno=0' MACADDR=02:00:00:b3:84:ef TYPE=Ethernet
cio_ignore -r read_device_bus_id , write_device_bus_id , data_device_bus_id
cio_ignore -r 0.0.0600,0.0.0601,0.0.0602
echo add > /sys/bus/ccw/devices/ read-channel /uevent
echo add > /sys/bus/ccw/devices/0.0.0600/uevent
lsqeth
ifup enccw0.0.0600
ip addr show enccw0.0.0600 3: enccw0.0.0600: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 3c:97:0e:51:38:17 brd ff:ff:ff:ff:ff:ff inet 10.85.1.245/24 brd 10.34.3.255 scope global dynamic enccw0.0.0600 valid_lft 81487sec preferred_lft 81487sec inet6 1574:12:5:1185:3e97:eff:fe51:3817/64 scope global noprefixroute dynamic valid_lft 2591994sec preferred_lft 604794sec inet6 fe45::a455:eff:d078:3847/64 scope link valid_lft forever preferred_lft forever
ip route default via 10.85.1.245 dev enccw0.0.0600 proto static metric 1024 12.34.4.95/24 dev enp0s25 proto kernel scope link src 12.34.4.201 12.38.4.128 via 12.38.19.254 dev enp0s25 proto dhcp metric 1 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
ping -c 1 192.168.70.8 PING 192.168.70.8 (192.168.70.8) 56(84) bytes of data. 64 bytes from 192.168.70.8: icmp_seq=0 ttl=63 time=8.07 ms
modprobe lcs
cio_ignore -r read_device_bus_id , write_device_bus_id
cio_ignore -r 0.0.09a0,0.0.09a1
echo read_device_bus_id , write_device_bus_id > /sys/bus/ccwgroup/drivers/lcs/group
echo portno > /sys/bus/ccwgroup/drivers/lcs/device_bus_id/portno
echo 1 > /sys/bus/ccwgroup/drivers/lcs/read_device_bus_id/online
ls -l /sys/bus/ccwgroup/drivers/lcs/ read_device_bus_ID /net/ drwxr-xr-x 4 root root 0 2010-04-22 16:54 enccw0.0.0600
IBM LCS DEVICE=enccw0.0.09a0 BOOTPROTO=static IPADDR=10.12.20.136 NETMASK=255.255.255.0 ONBOOT=yes NETTYPE=lcs SUBCHANNELS=0.0.09a0,0.0.09a1 PORTNAME=0 OPTIONS='' TYPE=Ethernet
DEVICE=enccw bus_ID
ifup enccw bus_ID
cio_ignore -r read_device_bus_id , write_device_bus_id
cio_ignore -r 0.0.09a0,0.0.09a1
echo add > /sys/bus/ccw/devices/ read-channel /uevent
echo add > /sys/bus/ccw/devices/0.0.09a0/uevent
root=10.16.105.196:/nfs/nfs_root cio_ignore=all,!condev rd.znet=qeth,0.0.0a00,0.0.0a01,0.0.0a02,layer2=1,portno=0,portname=OSAPORT ip=10.16.105.197:10.16.105.196:10.16.111.254:255.255.248.0:nfs‐server.subdomain.domain:enccw0.0.09a0:none rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us