Contenues dansTrouver plus de documentationRessources d'assistance comprises | Télécharger cet ouvrage au format PDF (171 Ko)
Chapter 6 Network Administration CommandsThis chapter describes the utilities you can use to perform network administration tasks on a ChorusOS system. The commands described below apply whether you are using an Ethernet, PPP or SLIP network interface. arpThe arp(1M) utility lets you display and manipulate the tables used to translate IP addresses to Ethernet addresses according to the Address Resolution Protocol (ARP). Example 6-1 Displaying the ARP TableThe following example displays the IP address/Ethernet address pairs known to a ChorusOS system that has no name service daemons operating:
Note that the only system known to the ChorusOS system is the boot server, and that its hostname is not known. You may also use the ChorusOS rarp(1M) utility that makes it possible to configure the IP address of the ChorusOS system during system initialization from a RARP server on the local network. ifconfigifconfig(1M) allows you both to assign an IP address to a network interface, and to configure network interface parameters. It also allows you to check the interfaces you have configured. Example 6-2 Configuring and Checking Interfaces with ifconfigThe following interactive example configures the primary Ethernet and loopback interfaces for target, then displays the result.
Note that the example above uses the ifconfig command
that is built into the C_INIT(1M) system actor. Thus, if you set the ifconfig is also available as a stand-alone actor, /bin/ifconfig.r. netstatnetstat(1CC) displays information about network-related data structures, such as network interfaces (use the -i option) and routing tables (use the -r) option. The utility is available both as a C_INIT(1M) built-in command, and as a standalone actor that supports a wider range of options. Example 6-3 Displaying Network Statistics with netstatThe following example uses the built-in version of netstat to view information about network interfaces and routing tables.
Note that in order for the built-in version to function, you must set
the netstat is also available as a stand-alone actor, /bin/netstat.r. nfsstatThe nfsstat(1CC) command displays statistics about NFS activity between the server and the client. The ChorusOS implementation of this utility supports only the -w option. Example 6-4 Displaying NFS ActivityThe following example displays statistics about NFS activity every second:
Note that you can use the akill(1M) utility to stop nfsstat, which according to the statement, "started aid = 22" in the above output has actor ID 22:
pingThe ChorusOS implementation of ping(1M), a basic tool for checking whether a network connection is working or not, requests an ICMP ECHO_RESPONSE from the specified host and simply displays "host is alive" if the host responds within 20 seconds. Example 6-5 Checking a Connection with pingThe following example uses the ping utility to check the connection with the system having IP address 129.157.197.1:
The example below shows what happens when the host does not respond:
Note that ping does not support any options. routeWhen a system using IP receives a network data packet, it uses the routing table, managed using route(1M), to determine where to send the packet. A properly configured routing table helps the system:
IP forwarding allows the system to forward packets to other systems, such as the gateway. IP forwarding is enabled using the sysctl(1M) command as shown below. Example 6-6 Routing with IP ForwardingThe following example sysadm.ini fragment uses # # Enable IP forwarding (requires the sysctl.r actor) # arun /bin/sysctl -w IPCTL_FORWARDING=1 # arun /image/sys_bank/sysctl -w IPCTL_FORWARDING=1 # if built into system image # # Deliver packets addressed to the local system # route add -host 129.157.197.88 lo0 # # Send other packets back out to the Ethernet # route add default -interface ifeth0 Note that the first route command is unnecessary if the ChorusOS system IP address is assigned dynamically. route is also available as a stand-alone actor, /bin/route.r. ypcatIf the ChorusOS system is bound to an NIS domain, you can use ypcat(1CC), ypmatch(1CC) and ypwhich(1CC) to obtain information from the NIS database. Example 6-7 Reading NIS InformationThe following example uses ypcat to find "demo" networks mentioned in the NIS database:
Note that ypcat, ypmatch and ypwhich require access to the NIS database in order to look up information. See "Name Services and ypbind" for suggestions about binding to the NIS server for the domain. |
||||||||