Section 14.9. The Network Interface


[Page 588 (continued)]

14.9. The Network Interface

An important aspect of system administration is getting a Linux machine connected to the local network so that other machines and all users can communicate with it. Some of the basic concepts and tools used to do this were discussed in Chapter 9, "Networking and the Internet." Networking is a huge subject, and this will only be an overview. For a detailed view, I strongly recommend [Nemeth, 2002].


[Page 589]

Unless you are using wireless networking, some kind of network cable will have to be connected to your Linux computer in order for it to talk to the network. Your machine will have to have an IP address and hostname assigned to it, and the rest of the network will need to be made aware of this name and address (by updating the local host table or DNS database).

The ifconfig command is used to configure the network interface. The typical way to activate a network interface is:

$ ifconfig eth0 194.27.1.14 up 


This causes the interface called "eth0" to be assigned the IP address 194.27.1.14 and configured to be up. Other IP attributes can also be configured with ifconfig. While you can issue this command by hand at a terminal, it is usually found in boot scripts that initialize all network interfaces. When you add a network interface, you'll have to add the appropriate configuration command to the appropriate boot file.

For your Linux machine to communicate with any other computer that is not directly connected to the same network cable (segment), routing information on your machine will need to be specified. The route command is used to specify routers that provide a path to other networks. Generally, you only have to make sure a "default" route is established. A packet will be sent to this router when the destination is not on the local network. The packet is sent to the default router with the assumption that upstream routers will know how to get to the destination.




Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net