-->
Page 250
Red Hat Linux comes with networking enabled. The easiest way to get started with networking is to configure it as part of your installation. If you are not familiar with the information requested, you can skip it and reconfigure it later with the netcfg program.
Begin by starting up the X Window environment and running netcfg from an xterm window. The opening window should look something like Figure 13.1.
If your Hostname: and Domain: entries already have entries in them, don't worry. That just means you've already set those values during the installation. If not, enter the appropriate information for your hostname and domain name. If you are unsure of these, contact your local network administrator to find out.
The Search for hostnames in additional domains: box should be left blank unless you want to be able to specify hostnames from multiple domains without having to use their fully qualified domain names. This is usually a bad idea.
The Nameservers: box is important. This will tell your network where to resolve hostnames that are not local to your network. Each line should contain the IP address of every DNS server you want to query (with a maximum of three). If you do not know this information, again, contact your network administrator and ask. If you are the network administrator, read the section on setting up a DNS server, "The Domain Name Service."
When you are done entering this information, click the Hosts button at the top of the window. The window will change to look like Figure 13.2.
Page 251
This is what will become the /etc/hosts file. (See the section "The Domain Name Service," later in this chapter, for detailed information.) This file essentially provides a mapping from hostnames to IP numbers. At the very least, you should provide mappings for any machines on your network necessary as part of your boot procedure (such as servers). For example, if you wanted to add an entry for the host vestax whose IP address is 192.168.42.7, you would do the following:
After you have entered all the hosts your system needs to know at boot time, click the button labeled Interfaces at the top of the window. The window will change to look like Figure 13.3.
You can configure an Ethernet device from this window. To configure your Ethernet card, do the following:
Page 252
With your interface defined, you can now set routes and gateways for your machine. Click the button labeled Routing at the top of the window. This will change the Network Configurator window to look like Figure 13.4.
To set up your routing information, follow these steps:
Page 253
Your system now has the necessary scripts configured to establish your network connection. Before you can claim victory, you need to test the connection. Enter the following command to start the network connection:
/etc/rc.d/init.d/network stop;/etc/rc.d/init.d/network start
This will restart your network connection. Try pinging a machine in your immediate network using the ping command, like this:
ping IP_Address
where IP_Address is the IP address of the machine you are trying to ping. If you placed the IP address to hostname mapping in the Hosts section in netcfg, then you can use the hostname instead. This should return output similar to this:
PING 192.168.42.1 (192.168.42.1): 56 data bytes 64 bytes from 192.168.42.1: icmp_seq=0 ttl=255 time=1.0 ms 64 bytes from 192.168.42.1: icmp_seq=1 ttl=255 time=3.5 ms -- 192.168.42.1 ping statistics -- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max = 1.0/24.4/47.8 ms
Note that in order to get ping to stop, you need to press Ctrl+C.
If you have an Internet connection, try pinging a machine outside of your network. This should result in output similar to the preceding, with the notable exception that the time measurements will be longer. If the ping fails at this point, try another host; it could be the other machine that has failed and not yours.
If the pings fail, restart netcfg and verify the information you provided it.