This chapter explains the various network administration commands that a system administrator of the ChorusOS operating system requires. In this ChorusOS distribution, daemons are located in the directory /sbin, and other commands are in the directory /bin.
Interface Creation
chat
dhclient
gifconfig
ifconfig
pppstart
Administration
arp
gif
icmp6
inet6
netstat
ndp
nfsstat
ping
ping6
rpcinfo
route
tcpdump
traceroute
Name services and ypbind
Network Commands
ftpd and ftp
tftpd and tftp
sysctl
Daemons
mountd
nfsd
ntp
rpcbind
rtsol and rtsold
telnetd
Note that any or all of these commands can be killed using the akill(1M) utility.
The chat utility handles modem connections for use with PPP. See chat(1M), pppd(1M) and pppstart(1M) for more details.
In order to use chat, you must first embed the chat
process
into the ChorusOS system image.
chat
process into the ChorusOS
system imageYou can use Ews, the graphic configuration utility
to embed the chat
process:
Open the Ews graphic configuration utility:
host% ews <build_DIR>/conf/ChorusOS.xml &
Select the Application file list node, as follows:
ChorusOS configuration | ChorusOS System Image Configuration | Applications | Application file
Click on Application File with the right-hand mouse button and select New Element.
Double-click on the Empty file which appears in the Application File. A new window opens in Ews.
Click twice on the Value cell next to Reference in this window, then click on the button marked "..." which appears on its right hand side. This opens a window entitled Select a Reference.
Select chat
from the list of options in the Select a Reference window.
Close the Select a Reference window, then select file | save in the Ews graphic configuration tool to save the new settings.
You must now build or re-build the ChorusOS system image:
host% make chorus
The Dynamic Host Configuration
Protocol utility, dhclient(1M), allows the ChorusOS system to obtain
network information, such as a dynamically assigned IP
address, or the IP addresses of the default router and
name server, from a DHCP server at boot time. In order
to boot using dhclient you must first embed the dhclient
process into the ChorusOS system image.
dhclient reads dhclient.cf(4CC) and dhcp.options(4CC).
dhclient
process into the ChorusOS
system imageYou can use Ews, the graphic configuration utility
to embed the dhclient
process:
Open the Ews graphic configuration utility:
host% ews <build_DIR>/conf/ChorusOS.xml &
Select the Application file list node, as follows:
ChorusOS configuration | ChorusOS System Image Configuration | Applications | Application file
Click on Application File with the right-hand mouse button and select New Element.
Double-click on the Empty file which appears in the Application File. A new window opens in Ews.
Click twice on the Value cell next to Reference in this window, then click on the button marked "..." which appears on its right hand side. This opens a window entitled Select a Reference.
Select dhclient
from the list of options in
the Select a Reference window. If necessary, follow the
same procedure to select dhclient.cf
in order to
embed the optional dhclient configuration file.
Close the Select a Reference window, then select file | save in the Ews graphic configuration tool to save the new settings.
By default, ChorusOS boots using RARP. In order to
boot using DHCP, you must change the sysadm.ini file. In the sysadm.ini file, you deactivate RARP by making the appropriate line into a comment and you activate DHCP by including the line corresponding to dhclient
:
# rarp ifeth0
/image/sys_bank/dhclient ifeth0
You must now build or re-build the ChorusOS system image:
host% make chorus
Further information on building the system image is supplied with the ChorusOS 5.0 Installation Guide.
See also "The Embedded Workshop Graphical Configuration Tool" for additional guidance on Ews.
Configures the physical address for the generic IPv6 tunnel interface. See gifconfig(1M).
ifconfig(1M) allows you 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 129.157.197.88 netmask 0xffffff00 broadcast 129.157.197.253 $ rsh target ifconfig lo0 127.0.0.1 up $ rsh target ifconfig -a ifeth0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 129.157.197.88 netmask 0xffffff00 broadcast 129.157.197.253 ether 00:e0:29:3c:6c:7f lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet 127.0.0.1 netmask 0xff000000 |
The example above uses ifconfig command that is built into the C_INIT(1M) system actor. You can also embed the ifconfig command in the sysadm.ini(4CC) system initialization script. ifconfig is also a standalone program.
The pppstart(1M)
function enables client PPP operations on the ChorusOS
system. See Chapter 11, Setting Up PPP for details on configuring a ChorusOS
system as a PPP client. In order to use PPP, you have to
embed the pppstart
process into the ChorusOS system
image.
pppstart(1M) uses pppstart(2K). See the sysLog(2K) man page for examples of how to read the log.
pppstart
process into the ChorusOS
system imageYou can use Ews, the graphic configuration utility
to embed the pppstart
process:
Open the Ews graphic configuration utility:
host% ews <build_DIR>/conf/ChorusOS.xml &
Select the Application file list node, as follows:
ChorusOS configuration | ChorusOS System Image Configuration | Applications | Application file
Click on Application File with the right-hand mouse button and select New Element.
Double-click on the Empty file which appears in the Application File. A new window opens in Ews.
Click twice on the Value cell next to Reference in this window, then click on the button marked "..." which appears on its right hand side. This opens a window entitled Select a Reference.
Select pppstart
from the list of options in
the Select a Reference window.
Close the Select a Reference window, then select file | save in the Ews graphic configuration tool to save the new settings.
You must now build or re-build the ChorusOS system image:
host% make chorus
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 have no name service daemons operating:
$ rsh target arp -a (129.157.197.144) 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.
The gif interface is a generic tunneling pseudo device for IPv4 and IPv6. See gif(7P).
This is the error and control message protocol used by the Internet Protocol family. See icmp6(7P).
The inet6 family is a collection of protocols layered on top of the ip6(7P)
transport layer. The inet6 family provides protocol support
for the SOCK_STREAM
, SOCK_DGRAM
and SOCK_RAW
socket types. See inet6(7P).
Used in conjunction with socket. See socket(2POSIX).
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 129.157.197.88 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 129.157.197.144 8:0:20:a7:d6:f3 UHLW 3 17 ifeth0 1178 |
netstat is also available as a stand-alone actor, netstat.
This command manages the IPv6 Neighbor Discovery Protocol, (NDP). Symbolically displays the contents of the Neighbor Discovery cache. See ndp(1M).
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 nfsstat -w 1 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 ... |
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 |
The following example uses the ping utility to check the connection with the system having IP address 129.157.197.1:
$ rsh target ping 129.157.197.1 129.157.197.1 is alive |
The example below shows what happens when the host does not respond:
$ rsh target ping 129.157.197.44 no answer from 129.157.197.44 |
Note that ping supports options.
Elicits an ICMP6_ECHO_REPLY from a host or gateway. See ping6(1M).
The rpcinfo(1M) utility is used to obtain information about RPC services registered through the rpcbind daemon. This utility can be used to see RPC services running on the target or on other hosts.
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.
The route command in this version is also IPv6 enabled, to manually manipulate the network routing tables.
IPv4 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 in Example 13-6.
The following example sysadm.ini fragment uses route
to configure the routing table to deliver packets addressed
to the local system (129.157.197.88), and to forward other
packets to the Ethernet:
# # Enable IP forwarding (requires the sysctl actor) # sysctl -w net.inet.ip_forwarding=1 # /image/sys_bank/sysctl -w net.inet.ip_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, route.
This command dumps traffic on a network, and prints out headers of packets. Users must have read access to /dev/bpf*. See tcpdump(1M).
This command prints the route packets to take to the network host. It
does this by utilizing the IP protocol `time to live' field and by then attempting
to elicit an ICMP TIME_EXCEEDED
response from each
gateway along the path to the host. See traceroute(1M).
Name services make it possible to convert between IP addresses and system names.
The most basic name service solution on a ChorusOS system consists of using the information from the /etc/hosts file, or /etc/networks files.
ChorusOS systems usually rely on other systems to provide name services, however.
The following example configures the NIS daemon for the fictitious an.example.COM domain:
$ rsh target domainname an.example.COM $ rsh target /sbin/rpcbind& $ rsh target ypbind |
Note that the actors in this example are normally found in a file system outside the system image, such as a root file system located on the host. The domain name must be configured before starting ypbind. As you can see from the example, rpcbind must also be started first, to start ypbind.
You can use ypcat(1CC), ypmatch(1CC) and ypwhich(1CC) to obtain information from the NIS database if the ChorusOS system is bound to an NIS domain. See "Name Services and ypbind" for details about binding to the NIS server for the domain.
The following example uses ypcat to find "demo" networks mentioned in the NIS database:
$ rsh target ypcat networks | grep demo 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.
The ftpd(1M) function provides File Transfer Protocol services on ChorusOS systems. See also ftp(1CC).
The following example starts the ftpd server on the ChorusOS system and tests it:
$ rsh target /bin/ftpd & $ ftp target Connected to target. 220- Welcome to ChorusOS! 220 FTP server (Version 6.00) ready. Name (target:user): 331- Password not checked 331 Login ok. Password: 230- Logging in with home=/ 230 User user logged in. ftp> ls ls 200 PORT command successful. 150 Opening ASCII mode data connection for 'file list'. bin dev etc lib Makefile 226 Transfer complete 30 bytes received in 0.11 seconds (0.28 Kbytes/s) ftp> bye bye 221 Goodbye. $ |
Note that target is running in non-secure mode, so no password is required.
This daemon is used if you want to boot the ChorusOS target from the network (using bootmonitor), with the DHCP and TFTP server running on a ChorusOS machine. The tftpd daemon is a standalone daemon. It is not started by the inetd command.
The command tftp is used to transfer files in the same way as ftp. See tftpd(1M).
The systcl target utility is used to get or set the microkernel state. See sysctl(1M).
This daemon is the server for NFS mount requests from other client machines. It reads the file /etc/exports(5) to find the list of exported file systems. See mountd(1M).
The nfsd(1M) function provides Network File Services to NFS clients on the network. See Chapter 7, Sharing Target File Systems Over NFS for details about running an NFS server on a ChorusOS system.
The Network Time Protocol (NTP) public domain software from the University of Delaware is included in this version of the ChorusOS operating system. NTP is a server/client implementation that enables you to manage precise time and network clock synchronization in a network environment. The inclusion of NTP in the ChorusOS operating system provides increased time precision.
Pick one system to be the master clock (NTP server), and then set up all your other systems (NTP clients) to synchronize their clocks with the master clock. This is done using the ntpd daemon, which sets and maintains a UNIX system time-of-day in agreement with Internet standard time servers.
The ntpd, ntpq, ntpdate and ntptrace utilities are available with the ChorusOS operating system. For further information on these utilities see ntpd(1M), ntpdate(1M), ntpq(1M), ntptrace(1M).
The ntpd daemon sets and maintains the system time-of-day.
The ntpd daemon reads the /etc/ntp.conf file at system startup. See ntpd(1M) for information about configuration options of ntpd.
An NTP client synchronizes automatically with an NTP server when it boots, and if it gets out of sync, it will resync again when it sees a time server.
The method of authentication provided in the NTP implementation of the ChorusOS operating system is MD5.
The only reference clock driver supported is the undisciplined local clock.
Become superuser.
Change to the /etc directory.
Copy the ntp.client file to the ntp.conf file:
# cp ntp.client ntp.conf
Synchronize the date manually, by using the ntpdate command:
# rsh target ntpdate <timeserver> |
Start the ntpd daemon:
# rsh target ntpd |
Become superuser.
Change to the /etc directory.
Copy the ntp.server file to the ntp.conf file.
# cp ntp.server ntp.conf
Start the ntpd daemon:
# rsh target ntpd |
In order to start RPC services, the rpcbind daemon must be running on the system. The rpcbind daemon is required, for example, by the ypbind daemon and other yp tools, and by the nfsd NFS daemon. The rpcbind path is /bin/rpcbind.
The rtsold daemon sends ICMPv6
router solicitation messages on specific interfaces. The rtsold
daemon sends only one router solicitation message to the specified
interface and exits.
Configure the ChorusOS IPv6 stack to accept IPv6 router advertisements:
host% rsh target sysctl --w net.inet6.ip6.accept_rtadv=1 |
Send a router solicitation message on the ifeth0
interface. An IPv6 router on the network should answer with a router advertisement
message.
host% rsh target /sbin/rtsolifeth-0 |
For further information see rtsold(1M) man page. See also the icmp6(7P) and ip6(7P) man pages.
The telnetd(1M) daemon enables remote login operations in the ChorusOS operating system using the Telnet virtual terminal protocol. For further information regarding Telnet, see ChorusOS man pages section 3TELD: Telnet Services.