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
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
-
checksumming
-
detach_state
-
fake_broadcast
-
fake_ll
-
ipa_takeover
-
portno
-
priority_queueing
-
recover
-
route4
-
rxip
-
ungroup
-
vipa
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.