September 20, 2014
 
 
RSSRSS feed

Net Gains: Networking Adapters - page 5

Your Physical Connection to the Network

  • May 23, 2000
  • By William Wong

OK, either linuxconf is not for you, you have an earlier version of Linux, or you want to see what linuxconf does. This section will be brief, as most of the details can be found in examples in the files discussed. Essentially this approach makes changes directly to the configuration files that linuxconf normally deals with. Due to the variety of Linux distributions and versions, the details presented here may not exactly match the version of Linux you have, but should be close.

First a little info about the boot procedure. Linux uses the script files in /etc/rc.d to start up and shut down Linux. These scripts use configuration files that may be found in a number of places. The ones we are concerned with are found in /etc and /etc/sysconfig.

The file /etc/conf.modules is used to setup modules not configured using the scripts found in /etc/rc.d, such as the Apache Web server. The /etc/conf.modules file is usually rather sparse, but if a network adapter is installed, then there will be a line in the file that looks like:

alias eth0 3c509

In this case, the eth0 Net Device is associated with the 3c509.o module found in the network modules directory mentioned earlier. Add this sort of line if you need to include support for a network adapter. The I/O port can be set using a line like:

options 3c509 io=0x310

Additional adapters can be added for eth1and so on. Multiple adapters that require options can list them on a single options line separated by commas.

Next, check out the /etc/sysconfig/network-scripts directory. There should be an ifcfg-eth0 file. There will be additional files like ifcfg-eth1 if there are multiple adapters. The files will need to be created if none exist. The files may contain many lines, but must have at least the following for a manual configuration.

DEVICE="eth0"
BOOTPROTO="none"
ONBOOT="yes"
IPADDR="10.0.0.1"
NETMASK="255.255.255.0"

If DHCP is used, then the BOOTPROTO string will be DHCP and the IPADDR and NETMASK lines can be omitted.

The /etc/sysconfig/network file finishes out the group. The typical contents look like

NETWORKING=yes
HOSTNAME="mypc.linux.dom"
GATEWAY="10.0.0.254"
GATEWAYDEV="eth0"

The HOSTNAME is the one described in the previous section. Gateways were also mentioned in the last section but their configuration was not. This is where the gateway information winds up.

For other Linux distributions and earlier Red Hat distributions, the files and contents presented here may be different, but in general the ideas will be the same. One way to force the creation of these files during installation is to select a network adapter that may or may not match yours and then look for the module name in the configuration files for your distribution. What to change should then be more apparent. In many cases it will simply be a matter of adding the proper module to the hard disk and changing the module name in the configuration files.

Sitemap | Contact Us