Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Red Hat Enterprise Linux 9 Essentials Book now available.

Purchase a copy of Red Hat Enterprise Linux 9 (RHEL 9) Essentials

Red Hat Enterprise Linux 9 Essentials Print and eBook (PDF) editions contain 34 chapters and 298 pages

Preview Book

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:
  • The proc file system is no longer used to control or obtain status on network devices.
  • The new sys file system now provides facilities for controlling devices.
  • /sys/class/net/interface_name/device now provides status on active devices.
    interface_name is a name such as eth0 or eth2 that is given to a network interface by the device driver when the device is configured.
  • /etc/chandev.conf no longer exists.
    The sys file system now contains the information that was placed in /etc/chandev.conf.
  • /etc/modules.conf no longer exists.
    Network interface alias specifications are now placed in /etc/modprobe.conf.
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
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
For information on how these features work, refer to https://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.

 
 
  Published under the terms of the GNU General Public License Design by Interspire