-->
Previous | Table of Contents | Next |
The files that control TCP/IP configuration are stored in the /etc directory. When you first set up Linux and are asked about machine names and domain names, this information is sent to the /etc/hosts file. While you dont need to mess with this file if youre connected to the Internet (it does many of the same things that a Domain Name Server does), its a good thing to place the names of essential servers in this file. And if youre not connected to the Internet but you are maintaining a small network, this is the place to store the IP addresses for the workstations on your system. (Again, this could be done via a DNS on your local system, but its a lot easier to use the /etc/hosts file.)
Another file to check is the /etc/networks file, used to configured different networks in the TCP/IP subsystem. This file is summoned when the system launches, and its functions are handled by DNS servers if youre working on the Internet. Again, if youre not connected to the Internet but you want to have subnetworks and such (you really dont; were speaking hypothetically here if youre working on a small network), youd use this file instead of a DNS.
NOTE: If you have an ethernet card, you can configure it using the netconfig command. You might also need to edit /etc/rc.d/rc.modules to load support for your card.
Youll also want to run the ifconfig command, which essentially tells the kernel about your Ethernet card and the IP addresses if youve not done so already. To see the current state of your system, use the command with no options:
gilbert:/$ ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0 UP BROADCAST LOOPBACK RUNNING MTU:2000 Metric:1 RX packets:0 errors:0 dropped:0 overrun:0 TX packets:40 errors:0 dropped:0 overruns:0
In this case, were actually using Linux without a network card or a connection to a networkbut Linux thinks its on a network using a tool called loopback. Loopback allows applications and daemons that need to communicate via TCP/IP to connect to local resources.
Linux networking is an involved subject and one beyond the goals of this book. Youll want to check out some of the reference works in Appendix A for more information.
Previous | Table of Contents | Next |