22.6. Adding a Network Device

22.6. Adding a Network Device

The process of adding a network device has changed with the migration of the 2.4 kernel to the 2.6 kernel:

Section 22.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 22.6.2, “Quick Reference for Adding Network Devices” is a quick reference for installing other IBM System z network interfaces.

22.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:

Note

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.

  • add_hhlen

  • broadcast_mode

  • buffer_count

  • canonical_macaddr

  • card_type

  • checksumming

  • chpid

  • detach_state

  • fake_broadcast

  • fake_ll

  • ipa_takeover

  • portno

  • priority_queueing

  • recover

  • route4

  • rxip

  • state

  • ungroup

  • vipa

For information on how these features work, refer to http://www-128.ibm.com/developerworks/linux/linux390/october2005_documentation.html#3 (Device Drivers, Features, and Commands - SC33-8289-02).

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.

22.6.2. Quick Reference for Adding Network Devices

There are several basic tasks for adding a network interface on IBM System z.

  • Load the device driver.

  • Create the group device.

  • Configure the device.

  • Set the device online.

  • Define the alias (if needed).

  • Create a configuration script.

  • Activate the device.

The following sections provide basic information for each task of each IBM System z network device driver.

22.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: ethn for OSA-Express Fast Ethernet and Gigabit Ethernet trn 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://www- 128.ibm.com/developerworks/linux/linux390/october2005_documentation.html#3 (Linux for IBM System z 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:

    ethn alias lcs
    trn alias lcs
  • Create a configuration script.

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

    ifcfg-ethn
    ifcfg-trn

    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=ethn
    DEVICE=trn
  • Activate the device.

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

    # ifup ethn
    # ifup trn

22.6.2.2. Working With the QETH Device Driver

The QETH network device driver supports IBM System z 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:

  • hsin for HiperSocket devices

  • ethn for OSA-Express Fast Ethernet and Gigabit Ethernet

  • trn 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 IBM System z 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:

    hsin alias qeth
    ethn alias qeth
    trn alias qeth
  • Create a configuration script.

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

    ifcfg-hsin 
    ifcfg-ethn
    ifcfg-trn

    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=hsin
    DEVICE=ethn
    DEVICE=trn
  • Activate the device.

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

    # ifup hsin
    # ifup ethn
    # ifup trn

Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.