previous contents up next

Unix for Advanced Users

13. Unix Networking

13.3. Networking commands

arp command
Arp uses broadcast messages to determine the MAC-layer address that corresponds to a particular internetwork address. The arp program displays and modifies the Internet-to-Ethernet address translation tables used by the address resolution protocol

ifconfig command The command ifconfig is used to assign an address to a network interface or to configure network interface parameters, or both. ifconfig must be used at boot time to define the network address of each interface present on a machine; it may also be used at a later time to redefine an interface's address or other operating parameters. If no option is specified, ifconfig displays the current configuration for a network interface. If an address family is specified, ifconfig reports only the details specific to that address family. Only the super-user may modify the configuration of a network interface. Options appearing within braces ({}) indicate that one of the options must be specified.

route command route manually manipulates the network routing tables. These tables are normally maintained by the system routing daemon, by routed, or through default routes and redirect messages from routers.

netstat command netstat displays the contents of various network-related data structures in various formats, depending on the options you select.

The first form of the command displays a list of active sockets for each protocol. The second form selects one from among various other network data structures. The third form shows the state of the interfaces. The fourth form displays the routing table, the fifth form displays the multicast routing table, and the sixth form displays the state of DHCP on one or all interfaces.

nslookup command

nslookup sends queries to Internet domain name servers. It has two modes: interactive and non-interactive. Interactive mode allows the user to contact servers for information about various hosts and domains or to display a list of hosts in a domain. Non-interactive mode is used to display just the name and requested information for a host or domain.

ping command

The utility ping utilizes the ICMP protocol's ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from the specified host or network gateway. If host responds, ping will print host is alive on the standard output and exit. Otherwise, after timeout seconds, it will write no answer from host The default value of timeout is 20 seconds. When the -s flag is specified, ping sends one datagram per second (adjustable with -I) and prints one line of output for every ECHO_RESPONSE that it receives. No output is pro- duced if there is no response. In this second form, ping computes round trip times and packet loss statistics; it displays a summary of this information upon termination or timeout. The default datagram packet size is 64 bytes, or you can specify a size with the packetsize command-line argument. If an optional count is given, ping sends only that number of requests. When using ping for fault isolation, first ping the local host to verify that the local network interface is running.

traceroute command

The Internet is a large and complex aggregation of network hardware, connected together by gateways. Tracking the route one's packets follow (or finding the miscreant gateway that's discarding your packets) can be difficult. Tra- ceroute utilizes the IP protocol `time to live' field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to some host.

The only mandatory parameter is the destination host name or IP number. The default probe datagram length is 38 bytes, but this may be increased by specifying a packet size (in bytes) after the destination host name.

previous contents up next