Welcome to docker.ru hosting provider linux mirror located at Moscow, Russian Federation.
Server configuration: Linux with OpenZFS, 2 x E5-2670v2, 128 GB ECC memory, 12 x 4 TB raidz2 + 1 TB SSD for L2ARC.
Network: 20 gbps uplink, IPv4 (185.253.23.31), IPv6 (2a04:8580:ffff:fffe::2).
My hostname is mirror.docker.ru Adding a Network Device

F.6. Adding a Network Device

The process of adding a network device has changed greatly for Red Hat Enterprise Linux. This is due in part to the migration of the 2.4 kernel to the 2.6 kernel:

Section F.6.1 Adding a qeth Device describes in detail how to add a qeth device to an existing instance of Red Hat Enterprise Linux. Section F.6.2 Quick Reference for Adding Network Devices is a quick reference for installing other zSeries network interfaces.

F.6.1. Adding a qeth Device

First, determine whether the qeth device driver modules are loaded.

# lsmod | grep qeth
qeth                  135240  0
qdio                   45360  2 qeth
ipv6                  303984  13 qeth
ccwgroup               15104  1 qeth

If the output of the lsmod command shows that the modules are not loaded, you must run the modprobe command to load them:

# modprobe qeth

Next, create a qeth group device.

# echo <read_device_bus_id>,<write_device_bus_id>,<data_device_bus_id>
  > /sys/bus/ccwgroup/drivers/qeth/group

Due to the length of this command, it has been broken into two lines.

In the following example, read_device_bus_id is 0.0.0600, write_device_bus_id is 0.0.0601, and data_device_bus_id is 0.0.0602. The device is a z/VM virtual NIC and the IP address to be assigned to this interface is 192.168.70.69.

# echo 0.0.0600,0.0.0601,0.0.0602 > /sys/bus/ccwgroup/drivers/qeth/group

Next, verify that the qeth group device was created properly:

# ls /sys/bus/ccwgroup/drivers/qeth
0.0.0600  0.0.09a0  group  notifier_register

You may optionally add a portname. First, you must check to see if a portname is required:

# cat /sys/bus/ccwgroup/drivers/qeth/0.0.0600/portname
no portname required

The response indicates that you do not need to provide a portname.

To add a port name, check that the devices are offline, and then run the following command:

NoteNote
 

The device(s) must be offline when you add a portname.

# echo <portname> > /sys/bus/ccwgroup/drivers/qeth/0.0.0600/portname

Next, bring the device back online:

# echo 1 /sys/bus/ccwgroup/drivers/qeth/0.0.0600/online

Then verify the state of the device:

# cat /sys/bus/ccwgroup/drivers/qeth/0.0.0600/online
1

A return value of "1" indicates that the device is online, while a return value '0' indicates that the device is offline.

Check to see what interface name was assigned to the device:

# cat /sys/bus/ccwgroup/drivers/qeth/0.0.0600/if_name
eth1

To change the value of if_name, run the following command:

# echo <new_if_name> > /sys/bus/ccwgroup/drivers/qeth/0.0.0600/if_name

You may optionally set additional parameters and features, depending on the way you are setting up your system and the features you require.

For information on how these features work, refer to http://oss.software.ibm.com/developerworks/opensource/linux390/docu/lx26apr04dd01.pdf (Linux for zSeries and S/390 Device Drivers, Features, and Commands).

Now you need to create the configuration file for your new interface. The network interface configuration files are placed in /etc/sysconfig/network-scripts/.

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. In this example it is eth1.

If there is an existing configuration file for another device of the same type already defined, the simplest solution is to copy it to the new name.

# cd /etc/sysconfig/network-scripts
# cp ifcfg-eth0 ifcfg-eth1

If you do not have a similar device defined you must create one. Use this example of ifcfg-eth0 as a template.

/etc/sysconfig/network-scripts/ifcfg-eth0
# IBM QETH
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:06:29:FB:5F:F1
IPADDR=9.12.20.136
NETMASK=255.255.255.0
ONBOOT=yes
NETTYPE=qeth
SUBCHANNELS=0.0.09a0,0.0.09a1,0.0.09a2
TYPE=Ethernet

Edit the new ifcfg-eth1 file.

Remove the HWADDR line for now.

Modify the DEVICE statement to reflect the contents of the if_name file from your ccwgroup.

Modify the IPADDR statement to reflect the IP address of your new interface.

Modify the NETMASK statement as needed.

If you want your new interface 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.

/etc/sysconfig/network-scripts/ifcfg-eth1
# IBM QETH
DEVICE=eth1
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
TYPE=Ethernet

A qeth device requires an alias definition in /etc/modprobe.conf. Edit this file and add an alias for your interface.

/etc/modprobe.conf
alias eth0 qeth
alias eth1 qeth
options dasd_mod dasd=0.0.0100,0.0.4b19

Now you can start the new interface:

# ifup eth1

Check the status of the interface:

# ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 02:00:00:00:00:01
          inet addr:192.168.70.87  Bcast:192.168.70.255  Mask:255.255.255.0
          inet6 addr: fe80::ff:fe00:1/64 Scope:Link
          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:23 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:644 (644.0 b)  TX bytes:264 (264.0 b)

Note that the HWaddr field in the first line of the ifconfig command output. The value after that must be added to the ifcfg-eth1 file. Add a line like the following to that file:

HWADDR=02:00:00:00:00:01

Now ifcfg-eth1 looks similar to the following:

# IBM QETH
DEVICE=eth1
HWADDR=02:00:00:00:00:01
BOOTPROTO=static
IPADDR=192.168.70.69
NETMASK=255.255.255.0
ONBOOT=yes
NETTYPE=qeth
SUBCHANNELS=0.0.0600,0.0.0601,0.0.0602
TYPE=Ethernet

Check the routing for the new interface:

# route
Kernel IP routing table
Destination     Gateway         Genmask        Flags Metric Ref  Use Iface
192.168.70.0    *               255.255.255.0  U     0      0      0 eth1
9.12.20.0       *               255.255.255.0  U     0      0      0 eth0
169.254.0.0     *               255.255.0.0    U     0      0      0 eth1
default         pdlrouter-if5.p 0.0.0.0        UG    0      0      0 eth0

Verify your changes by using the ping command to ping the gateway:

# 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

If the default route information has changed, you must also update /etc/sysconfig/network accordingly.

F.6.2. Quick Reference for Adding Network Devices

There are several basic tasks for adding a network interface on zSeries systems.

The following sections provide basic information for each task of each zSeries network device driver.

F.6.2.1. Working With the LCS Device Driver

The LAN channel station (LCS) device driver supports OSA-2 Ethernet/Token Ring, OSA-Express Fast Ethernet in non-QDIO mode, and OSA-Express High Speed Token Ring in non-QDIO mode. For z990, the LCS driver also supports Gigabit Ethernet in non-QDIO mode (including 1000Base-T).

Based on the type of interface being added, the LCS driver assigns one of two base interface names: eth<n> for OSA-Express Fast Ethernet and Gigabit Ethernet tr<n> for Token Ring, where <n> is an integer that uniquely identifies the device. <n> is 0 for the first device of that type, 1 for the second, and so on.

  • Load the device driver:

    # modprobe lcs
  • Create the group device:

    # echo <read_device_bus_id>,<write_device_bus_id> 
    > /sys/bus/ccwgroup/drivers/lcs/group

    Due to the length of this command, it has been broken into two lines.

  • 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:

    # echo <portno> > /sys/bus/ccwgroup/drivers/lcs/<device_bus_id>/portno

    For more information about configuration of the LCS driver, refer to the following:

    http://oss.software.ibm.com/developerworks/opensource/linux390/docu/lx26apr04dd01.pdf (Linux for zSeries and S/390 Device Drivers, Features, and Commands)

  • Set the device online:

    # echo 1 /sys/bus/ccwgroup/drivers/lcs/<read_device_bus_id>/online
  • Define the alias.

    Based on the type interface being added, add a line to /etc/modprobe.conf that is similar to one of the following:

    eth<n> alias lcs
    tr<n> alias lcs
  • Create a configuration script.

    Create a file in /etc/sysconfig/network-scripts/ with a name like one of the following:

    ifcfg-eth<n>
    ifcfg-tr<n>

    The file should look similar to the following:

    /etc/sysconfig/network-scripts/ifcfg-eth0
    # IBM LCS
    DEVICE=eth0
    BOOTPROTO=static
    HWADDR=00:06:29:FB:5F:F1
    IPADDR=9.12.20.136
    NETMASK=255.255.255.0
    ONBOOT=yes
    NETTYPE=lcs
    SUBCHANNELS=0.0.09a0,0.0.09a1
    PORTNAME=0
    TYPE=Ethernet

    Based on the type interface being added, the DEVICE parameter should be one of the following:

    DEVICE=eth<n>
    DEVICE=tr<n>
  • Activate the device.

    Based on the type interface being added, issue an ifup command:

    # ifup eth<n>
    # ifup tr<n>

F.6.2.2. Working With the QETH Device Driver

The QETH network device driver supports zSeries HiperSockets, OSA-Express Fast Ethernet, Gigabit Ethernet (including 1000Base-T), High Speed Token Ring, and ATM features (running Ethernet LAN emulation) in QDIO mode.

Based on the type of interface being added, the QETH driver assigns one of three base interface names:

  • hsi<n> for HiperSocket devices

  • eth<n> for OSA-Express Fast Ethernet and Gigabit Ethernet

  • tr<n> for Token Ring

The value <n> is an integer that uniquely identifies the device. <n> is 0 for the first device of that type, 1 for the second, and so on.

  • Load the device driver:

    # modprobe qeth
  • Create the group device:

    # echo <read_device_bus_id>,<write_device_bus_id>,<data_device_bus_id>
      > /sys/bus/ccwgroup/drivers/qeth/group

    Due to the length of this command, it has been broken into two lines.

  • Configure the device.

    For more information about configuration of the QETH driver, refer to the following:

    http://oss.software.ibm.com/developerworks/opensource/linux390/docu/lx26apr04dd01.pdf (Linux for zSeries and S/390 Device Drivers, Features, and Commands)

  • Set the device online:

    # echo 1 /sys/bus/ccwgroup/drivers/qeth/<read_device_bus_id>/nline
  • Define the alias.

    Based on the type interface being added, add a line to /etc/modprobe.conf that is like one of the following:

    hsi<n> alias qeth
    eth<n> alias qeth
    tr<n> alias qeth
  • Create a configuration script.

    Create a file in /etc/sysconfig/network-scripts/ with a name like one of the following:

    ifcfg-hsi<n> 
    ifcfg-eth<n>
    ifcfg-tr<n>

    The file should look like this:

    /etc/sysconfig/network-scripts/ifcfg-eth0
    # IBM QETH
    DEVICE=eth0
    BOOTPROTO=static
    HWADDR=00:06:29:FB:5F:F1
    IPADDR=9.12.20.136
    NETMASK=255.255.255.0
    ONBOOT=yes
    NETTYPE=qeth
    SUBCHANNELS=0.0.09a0,0.0.09a1,0.0.09a2
    TYPE=Ethernet

    Based on the type interface being added, the DEVICE parameter should be like one of the following:

    DEVICE=hsi<n>
    DEVICE=eth<n>
    DEVICE=tr<n>
  • Activate the device.

    Based on the type interface being added, issue an ifup command:

    # ifup hsi<n>
    # ifup eth<n>
    # ifup tr<n>

F.6.2.3. Working With the CTC Device Driver

A Channel-to-Channel (CTC) connection is the typical high speed connection between mainframes. The CTC device driver can be used to establish a point-to-point TCP/IP or tty connection between two Linux for zSeries and S/390 instances or between a Linux for zSeries and S/390 instance and another mainframe operating system instance such as z/OS, OS/390, z/VM, or z/VSE.

The CTC driver assigns a base interface name like the following:

ctc<n>

The value <n> is an integer that uniquely identifies the device. <n> is 0 for the first device of that type, 1 for the second, and so on.

  • Load the device driver:

    # modprobe ctc
  • Create the group device:

    # echo <read_device_bus_id>,<write_device_bus_id> 
    > /sys/bus/ccwgroup/drivers/ctc/group

    Due to the length of this command, it has been broken into two lines.

  • Configure the device.

    Set the protocol:

    # echo <protocol> /sys/bus/ccwgroup/drivers/ctc/<device_bus_id>/protocol

    Where <protocol> is 0, 1, 2, or 3.

    0 — This protocol provides compatibility with peers other than OS/390, or z/OS, for example, a VM TCP service machine. This is the default.

    1 — This protocol provides enhanced package checking for Linux peers.

    2 — This protocol provides a CTC-based tty connection with a Linux peer.

    3 — This protocol provides compatibility with OS/390 or z/OS peers.

    For more information about configuration of the CTC driver, refer to the following:

    http://oss.software.ibm.com/developerworks/opensource/linux390/docu/lx26apr04dd01.pdf (Linux for zSeries and S/390 Device Drivers, Features, and Commands)

  • Set the device online:

    # cho 1 /sys/bus/ccwgroup/drivers/lcs/<read_device_bus_id>/online
  • Define the alias.

    Based on the type interface being added, add a line to /etc/modprobe.conf that is like the following:

    ctc<n> alias ctc
  • Create a configuration script.

    Create a file in /etc/sysconfig/network-scripts/ with a name like the following:

    ifcfg-ctc<n>

    The file should look like the following:

    /etc/sysconfig/network-scripts/ifcfg-ctc0
    # IBM CTC
    DEVICE=ctc0
    BOOTPROTO=static
    IPADDR=192.168.70.136
    GATEWAY=172.16.70.136
    NETMASK=255.255.255.255
    ONBOOT=yes
    SUBCHANNELS=0.0.1b00,0.0.1b01
    NETTYPE=ctc
    CTCPROT=0
    TYPE=CTC
  • Activate the device.

    Based on the type interface being added, issue an ifup command:

    # ifup ctc<n>

F.6.2.4. Working With the IUCV Device Driver

The Inter-User Communication Vehicle (IUCV) is a VM communication facility that enables a program running in one VM guest to communicate with another VM guest, with a control program, or even with itself. The Linux for zSeries and S/390 IUCV device driver is a network device driver that uses IUCV to connect Linux guests running on different VM user IDs, or to connect a Linux guest to another VM guest such as a TCP/IP service machine.

The IUCV driver assigns a base interface name like the following:

iucv<n>

The value <n> is an integer that uniquely identifies the device. <n> is 0 for the first device of that type, 1 for the second, and so on.

  • Load the device driver:

    # modprobe netiucv
  • Create the IUCV device:

    # echo <peer_id> > /sys/bus/iucv/drivers/netiucv/connection

    The value of <peer_id> is the guest ID of the VM guest you want to connect to. The IUCV device driver interprets the ID as uppercase. This is usually TCPIP.

    This creates a sysfs structure like the following:

    cat /sys/bus/iucv/drivers/netiucv/netiucv<n>

    The value <n> is an integer that uniquely identifies the device. <n> is 0 for the first device of that type, 1 for the second, and so on.

  • Configure the device.

    Set the maximum buffer size if needed:

    # echo <value> > /sys/bus/iucv/drivers/netiucv/netiucv<n>/buffer
      

    The <value> is the number of bytes you want to set. If you specify a value outside the valid range, the command is ignored.

    The permissible range of values for the maximum buffer size depends on the MTU settings. It must be in the range <minimum MTU + header size> to <maximum MTU + header size>. The header space is typically 4 bytes. The default for the maximum buffer size is 32768 bytes (32 KB).

    For more information on configuration of the IUCV driver, refer to the following:

    http://oss.software.ibm.com/developerworks/opensource/linux390/docu/lx26apr04dd01.pdf (Linux for zSeries and S/390 Device Drivers, Features, and Commands)

  • Define the alias.

    Based on the type interface being added, add a line to /etc/modprobe.conf that is like the following:

    iucv<n> alias netiucv
  • Create a configuration script.

    Create a file in /etc/sysconfig/network-scripts/ with a name like the following:

    ifcfg-iucv<n>

    The file should look like this:

    /etc/sysconfig/network-scripts/ifcfg-iucv0
    # IBM IUCV
    DEVICE=iucv0
    BOOTPROTO=static
    IPADDR=192.168.70.136
    GATEWAY=172.16.70.136
    NETMASK=255.255.255.255
    ONBOOT=yes
    NETTYPE=iucv
    PEERID=TCPIP
    TYPE=IUCV
  • Activate the device.

    Based on the type interface being added, issue an ifup command like the following:

    # ifup iucv<n>
powered by nginx