Net Gains: Networking Adapters - page 4
Your Physical Connection to the Network
Installing a second network adapter or installing a single ISA adapter usually involves a bit of extra work compared to the automatic setup that the typical Linux installation program performs. The configuration files presented here are specific to Red Hat's Linux distribution but tend to be common throughout most Linux distributions. In some cases the filename or the directory that a configuration file is located in may be different. The online or printed documentation or Linux books can be a great help.
There are basically three ways to configure network adapters for Linux. The first is to use the configuration program supplied by the distribution. This is a good approach. The second is to modify configuration files that are normally modified by the configuration program; this is a bad approach unless you know what you are doing. The third is to hook into the boot scripts and insert changes that use programs to setup the network configuration.
The linuxconf program is Red Hat's configuration program. It runs in text and graphical environments and provides a very good way to configure network interfaces. It can also be used to adjust existing network interfaces. It is easy to use: just start it up with no arguments. Other Linux distributions may have different configuration programs that provide features similar to those described here. For example, SuSE has YAST and YAST2.
The main screen shows a list of configuration options including Networking plus a Quit and Help button. Select Networking (selected by default) and press the Enter key to manage it. In this article we deal only with the Basic Host Information. Press Enter again. This presents the Host Basic Configuration screen.
The latest version of linuxconf supports half a dozen network interfaces starting with Adapter 1. There is an Enabled check box followed by a number of fields that may be left blank as noted by (opt). The fields include:
Primary name + domain
I/O port (opt)
The Config Mode has three selections: manual, DHCP and BOOTP. Forget the last one unless you are on a corporate network. The DHCP selection can be used if a DHCP server is on the network. In a SOHO environment, a DHCP server may be built into a router or modem-based gateway. Linux can also run a DHCP server, but that is another story. A DHCP server will provide an IP address and Netmask, but you still need to set up the other fields. In manual mode you need to set up all the fields.
The Primary name + domain is what the PC will be known as. If using a cable or DSL modem and the ISP provides a name and domain, then use that here; otherwise you can choose your own. If you have an installed network with a domain name, then just add the PC's name. A typical value will be mypc.linux.dom. The Aliases field is optional, but is usually filled in with a short version of the PC name, like mypc.
The IP address is the usual 4 numbers, as is the netmask. These values were covered in the first article in the series. A typical IP address and Netmask value would be 10.0.0.1 and 255.255.255.0. Remember that each PC on the network must have the same Netmask but separate IP address. Note that IP addresses for name servers and routers/gateways are entered in other screens.
The Net Device is normally eth0 for the first Ethernet adapter and eth1 for the second. The names are actually arbitrary but stick with these if you have no idea of what happens when you change them. The Net Device is simply the logical name by which a network interface will be known.
The Kernel Module is the hard part. It will be filled in if it was discovered by the Linux installation program. If a mouse is configured, then a list of available drivers can be presented by clicking on the down arrow on the right of the field. The list will be the same as the list of files in the network module directory. To find this directory look in the /lib/modules directory. There should be a single directory that matches the Linux distribution. This directory in turn has a list of module types as directories. The net directory has module files for network adapters. Each will have a file extension of .o as in ne.o.
The trick is to find the matching network adapter module in the directory or copy the proper module into the directory. Third-party modules or updated modules can be found on the Internet, or may be provided on a driver diskette that comes with the network adapter.
The name of the module, less the file extension, can then be entered in this field. The I/O port may be required if the driver cannot discover this automatically. This is often the case for ISA network adapters, in which case you need to read the documentation to discover how to set the I/O port. The value is normally entered in hexidecimal as in 0x3A0.
Problems can arise if the driver is old or incorrect, if the wrong driver is used, or if the wrong I/O port number is included.
Multiple network adapters can be set up using this procedure, and may be different network adapters from different vendors. In this case the Kernel Module fields will be different. If multiple network adapters of the same type are used then you may have to differentiate them using the I/O port. This is typically done with ISA adapters. PCI adapters will automatically be recognized and assigned in a first-come-first-served order. You will need to determine which adapter matches eth0, eth1, etc.
When finished, accept the changes by clicking on the button with the mouse (or selecting it using the Tab key and then pressing the Enter key). You may want to configure other items like name servers and gateway IP addresses at this point. Finally, click on Quit until you see the Activate Changes selection. Select this and press Enter to save the changes and get out of linuxconf.
Next, reboot. During the boot process, each network adapter should show up in the startup display. Some Linux distributions hide most of the status information but show the adapter name and whether it loaded or failed to load. Extensive debugging of network adapter problems is beyond the scope of this article, but the Internet is generally a great place for finding people with similar problems and solutions.
- 1Linux Top 3: Network Security Toolkit, Untangle NG Firewall and IPFire
- 2Linux Top 3: Fedora 24, Peppermint 7 and Solus 1.2
- 3Linux Top 3: Alpine Linux 3.4, deepin 15.2 and Linux Lite 3.0
- 4Linux 4.7 Set to Boost Live Patching, Security and Power Management
- 5Linux 4.6 Charred Weasel adds USB 3.1 Support