October 31, 2014
 
 
RSSRSS feed

Net Gains: Networking Adapters - page 3

Your Physical Connection to the Network

  • May 23, 2000
  • By William Wong

If you are installing a current version of Linux for the first time and have only one network adapter, then you are in luck. Most of the work will be done for you by the Linux installation program, assuming the network adapter is a PNP card. The installation program may also discover and configure a non-PNP card if it is set up so that it does not conflict with another adapter. If the installation program does not discover the adapter then check out the next section.

 

If the installation program recognizes the network adapter, it will let you know and install the device driver so it loads each time Linux boots up. The installation program will also ask for the details for configuring TCP/IP setup. If you have not read Part 1 then do so now. It explains IP addressing and network masks.

The installation program will ask for a number of items starting with the PC's IP address and network mask. It will also check for a gateway's IP address and one or two DNS server IP addresses. All of these items can be left blank if a DHCP server will be used. DHCP servers are normally used on larger networks but for home or small-office networks, fixed IP addresses will be used.

We examine three common configurations. The first is a local network with no connections to the outside world. The second is a network with an Internet connection with one PC acting as a gateway but no local DNS server. The third is the more conventional network with a router and a local DNS and DHCP server.

In the first instance, arbitrary, fixed IP addresses are in order. I recommend numbering PCs with 10.0.0.1, 10.0.0.2, and so on with a netmask of 255.0.0.0. There will be no gateway or DNS address but we can set up names for each PC. This is done by editing or creating the text file /etc/hosts. A typical /etc/hosts file looks like:

127.0.0.1 localhost
10.0.0.1 Dad
10.0.0.2 Mom
10.0.0.3 Bob
10.0.0.4 Jenn
10.0.0.5 Laura

With a copy of this file on each PC, you can reference Dad's PC using Dad instead of 10.0.0.1. The localhost is the default address for the PC you are using.

The changes necessary for the second configuration are relatively simple. First, the IP address of the PC that will act as the gateway must be entered. If this was Dad's PC then the gateway IP address would be 10.0.0.1. The gateway PC does not have to be up and running when this is done. It only needs to be running if a connection to the Internet is being used. The DNS IP addresses will be supplied by your Internet Service Provider (ISP) with your ISP account. Configuration of the gateway PC is left to later articles on network and modem Internet connections. The /etc/hosts file can still be used. In this case, local PCs can still be addressed by name and Internet names will be resolved using the ISP's DNS server.

The third configuration is what a small business might use. It requires more expertise to configure than can be covered in this article. The IP address of one PC, usually the local DHCP and DNS server, will be fixed: e.g., 10.0.0.1. The DHCP server will be setup to distribute IP addresses to PCs as they start up. The DHCP server can configure the DNS server IP addresses on these PCs as well. The local DNS server will handle local names so a /etc/hosts file will not be needed on any PC. The DHCP server will also set up each PC to use the router for nonlocal network accesses such as to the Internet. In many cases, the ISP account will come with multiple IP addresses the DHCP server can distribute. Typically a firewall on the router will prevent unauthorized access to local PCs.

If the installation program configured your network adapter correctly, the network configuration has been completed and multiple PCs are attached to the network, usually through a hub or switch, then the network connection can be tested using a program called ping. Ping needs at least one parameter, the IP address of the PC to ping. This program is normally run from a terminal window (such as the xterm program) if you setup a graphical interface or from the command line for a non-graphical environment. If the /etc/hosts file was set up then you can try something like ping Dad. Ping should respond with a message indicating the amount of time it took to get a response. If there are activity status lights on the network hub or switch then they should blink. If this does not work then it is time to backtrack and see what is working.

First, make sure the hardware is connected and working properly. Check out the documentation on the network adapter and the hub or switch. Status lights will usually indicate whether you have a good connection.

Second, try running the ifconfig program with no parameters. This will list the network adapters that have been installed. The default name for the first network adapter is eth0. If this is displayed then it is time to check out the driver. If not, then the driver is not recognizing the adapter and not loading, or the installation program did not get the driver installed properly, which is rare. Another possibility is that a newer device driver will be needed, especially if the adapter is a newer model.

Sitemap | Contact Us