This 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.
The 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).
The following example displays the IP address/Ethernet address pairs known to a ChorusOS system that has no name service daemons operating:
$ rsh target arun /bin/arp -a started aid = 22 ? (22.214.171.124) at 8:0:20:a7:d6:f3
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.
ifconfig(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.
The following interactive example configures the primary Ethernet and loopback interfaces for target, then displays the result.
$ rsh target ifconfig ifeth0 126.96.36.199 netmask 0xffffff00 broadcast 188.8.131.52 $ rsh target ifconfig lo0 127.0.0.1 up $ rsh target ifconfig -a ifeth0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 184.108.40.206 netmask 0xffffff00 broadcast 220.127.116.11 ether 00:e0:29:3c:6c:7f lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet 127.0.0.1 netmask 0xff000000
Note that the example above uses the ifconfig command
that is built into the C_INIT(1M) system actor. Thus, if you set the
ADMIN_IFCONFIG feature to true for the ChorusOS
system, you could easily adapt the above example to include the commands in
system initialization script.
ifconfig is also available as a stand-alone actor, /bin/ifconfig.r.
netstat(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.
The following example uses the built-in version of netstat to view information about network interfaces and routing tables.
$ rsh target netstat -i Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll ifeth 1500 <Link> 00.e0.29.3c.6c.7f 17 0 10 0 0 ifeth 1500 129.157 18.104.22.168 17 0 10 0 0 lo0 16384 <Link> 0 0 0 0 0 lo0 16384 127 127.0.0.1 0 0 0 0 0 $ rsh target netstat -r Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire 127.0.0.1 127.0.0.1 UH 0 0 lo0 129.157 link#1 UC 0 0 22.214.171.124 8:0:20:a7:d6:f3 UHLW 3 17 ifeth0 1178
Note that in order for the built-in version to function, you must set
ADMIN_NETSTAT feature to true
and rebuild the ChorusOS system image.
netstat is also available as a stand-alone actor, /bin/netstat.r.
The 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.
The following example displays statistics about NFS activity every second:
$ rsh target arun /bin/nfsstat -w 1 started aid = 22 Getattr Lookup Readlink Read Write Rename Access Readdir Client: 155 51 0 153 0 0 161 2 Server: 0 0 0 0 0 0 0 0 ...
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:
$ rsh target akill 22
The 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.
The following example uses the ping utility to check the connection with the system having IP address 126.96.36.199:
$ rsh target ping 188.8.131.52 184.108.40.206 is alive
The example below shows what happens when the host does not respond:
$ rsh target ping 220.127.116.11 no answer from 18.104.22.168
Note that ping does not support any options.
When 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:
Deliver packets locally if they are addressed to the system itself.
Send packets directly if they are addressed to other systems whose IP addresses it knows and with which it has direct connections.
Send other packets to the gateway system that allows communication with the rest of the Internet.
Drop any packets to which the above cases do not apply.
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.
The following example sysadm.ini fragment uses
route to configure the routing table to deliver packets addressed
to the local system (22.214.171.124), and to forward other
packets to the Ethernet:
# # 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 126.96.36.199 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.
The following example uses ypcat to find "demo" networks mentioned in the NIS database:
$ rsh target arun /bin/ypcat networks | grep demo started aid = 22 demo 129.157.171 demo2 129.157.176
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.