Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
Like this article? We recommend

Networking

This section describes Linux networking. It contains the following topics:

  • "Interface Configuration"

  • "Startup Scripts"

  • "NFS and the Automounter"

  • "Troubleshooting"

Interface Configuration

Configuration of an interface from the command line is accomplished the same as in Solaris with the ifconfig command. If the network card is compiled as a module, then the module needs to be aliased to a standard interface name in /etc/modules.conf. Standard Ethernet interface names in Linux are eth0, eth1, etc. For example, a 3Com 3C905B 10/100 NIC that uses the 3c59x driver in Linux would have the following entry in the /etc/modules.conf file.

alias eth0 3c59x

This entry assigns this card as interface eth0 when the 3c59x driver is loaded, then it is possible to up the interface via ifconfig.

NOTE

Because there is no native STREAMS support in Linux, there is no concept of plumbing the interface. Once the driver is loaded and associated to an interface name via an alias in the /etc/modules.conf file, an ifconfig <interface> up is all that is needed to activate it. By contrast in Solaris, an ifconfig <interface> plumb is necessary to allow the IP streams driver to use this interface before an ifconfig <interface> up is issued.

As in Solaris, ifconfig adds a route to the kernel routing table based on the IP address and subnet mask used on the command line. To add a route manually in Linux, use the route command. The command-line options are slightly different than those in Solaris. The following are examples of adding a default route in Solaris versus adding the same default route in Linux.

Solaris example:

route add default 192.168.3.254 1

Linux example:

route add -net default gw 192.168.3.254 metric 1

Startup Scripts

The rc scripts to bring up networking are entirely different in Solaris and Linux, but they achieve similar results.

  • Solaris uses /etc/init.d/network and /etc/init.d/inetinit to bring up the necessary interfaces, routes, and protocols.

  • Linux uses /etc/init.d/network to bring up the necessary interfaces, routes, and protocols, but this script calls other scripts from the directory /etc/sysconfig/network-scripts. The actual network configuration for a Linux machine is defined in the file /etc/sysconfig/network as a series of environmental variables. This file is sourced from all the network configuration scripts. It can be manipulated manually, but the program netconfig is normally used to make modifications to it.

NFS and the Automounter

The NFS implementation in Linux has recently started providing NFS version 3 support, allowing for the use of TCP and larger block sizes. Support for NFS version 3 is achieved through the kernel configuration process. The nfsd server daemon is implemented similarly to Solaris nfsd in that it runs multi-threaded. Eight threads are started by default, but this number can be tweaked by modifying the startup script, /etc/init.d/nfs. This script starts both the client and the server processes for NFS. The authentication daemon rpc.mountd uses /etc/exports as its configuration file rather than /etc/dfs/dfstab. The syntax of /etc/exports is considerably different than /etc/dfs/dfstab in Solaris. Refer to the exports(5) manual page for more information.

In Linux, there are two different automounters. The first, autofs, was developed in Linux and is the default used for most Linux distributions. The second automounter, amd, came from BSD UNIX but has been ported to many operating systems, including Linux. They are both somewhat different in implementation than the Solaris automounter, but serve the same purposes. In addition to NFS, Linux autofs is capable of providing access to other types of network file systems and local hardware, such as diskette and CD-ROM drives. In this latter capacity, it serves a purpose similar to that of vold in Solaris. For useful configuration examples relevant to those familiar with the Solaris automounter, refer to the Web site at http://www.linux-consulting.com/Amd_AutoFS/autofs-5.html.

Troubleshooting

The process of network troubleshooting in Linux is not much different than in Solaris. The netstat, rpcinfo, and nfsstat commands all do essentially the same thing. The major difference is that instead of snoop, the tool to use for packet sniffing is called tcpdump. The tcpdump command gives similar information as snoop, but with different command-line options and output formats. For example, the equivalent to snoop -d <interface> would be tcpdump -i <interface>. The full list of command-line options for tcpdump(8) can be found in the manual page. For the latest version and documentation, tcpdump is maintained at the following Web site: http://www.tcpdump.org.

  • + Share This
  • 🔖 Save To Your Account