This chapter takes you through the process of setting up a Point-to-Point Protocol (PPP) interface on a ChorusOS system. PPP allows the target system to connect to another system using a direct serial line or modem connection in the same way as an Ethernet connection. If your system does not support serial connections, or if you do not plan to use PPP with your system, you may skip this chapter.
This chapter also describes how to enable PPP on a host for use with a ChorusOS system during application development.
Configuring Hardware. See "Configuring Hardware".
Creating Interfaces. See "Creating Interfaces".
Creating Devices. See "Creating Devices".
Configuring PPP. See "Configuring PPP".
PPP on a Solaris Host. See "PPP on a Solaris Host".
ChorusOS systems support multiple PPP interfaces,
each of which is identified by a unique name such as ppp0.
Depending on the number of serial lines physically available on the ChorusOS
system, the binary distribution of the ChorusOS product provides support
for up to two PPP lines. (If you have the source distribution,
you can increase the number of lines possible by modifying the value of NPPP
in the machine/ppp.h header file.)
See the appropriate guide in the ChorusOS 5.0 Target Platform Collection to verify serial line support for your particular target system
hardware.
The first serial line on the ChorusOS system is reserved for system debug, and for console access using the host workstation tip(1) utility. It cannot be used for PPP. The console requires a terminal type cable.
A direct connection between a host and a target requires a null modem cable. See "Asynchronous EIA-232-E Null Modem" in Solstice PPP 3.0.1 Administration Guide for details.
If you are unsure what serial lines your system uses, yet you are able to boot the system, you can use the dtree(1M) utility to display devices listed in the target system device tree:
% rsh target dtree |
ChorusOS systems may be used with modems. The chat(1M) utility can help you handle modem connection and configuration. See "chat" for more information.
This document does not provide information about modem configuration commands, nor does it provide information about the cables required for connecting modems to targets. Please refer to your modem documentation for information regarding modem configuration.
Interface creation for PPP is usually performed by including commands in the sysadm.ini file that you build into the ChorusOS system image for your target. In order to create a PPP interface, use the mkdev(1M) utility as follows:
mkdev ppp unit
where unit is the number that makes the interface unique. In order to allow the system to use IP, you must also create a loopback interface.
The following example sysadm.ini fragment creates a PPP interface and the loopback interface needed for IP communication. These commands simply create the interface; nothing is configured for use, yet.
# Create a PPP interface mkdev ppp 0
PPP interfaces rely on tty devices to communicate directly with the serial hardware. You must therefore create at least one tty device for each PPP line you intend to open. If the ChorusOS system is configured to "dial on demand", in which case the line only opens when there are packets to send or receive, you must also create a pseudo-tty master (ptyp) and a pseudo-tty slave (ttyp) device for each PPP line.
It is also possible that your applications require a BPF device for raw access to network packets.
The following example sysadm.ini fragment creates a PPP interface and the loopback interface needed for IP communication. It then creates the tty devices needed to open a PPP line that may be configured for "dial on demand". Finally, it creates a BPF device for any applications that require one.
# # Set the file creation mask to 0 during system configuration # umask 0 # # Create a PPP interface # mkdev ppp 0 # # Create a loopback interface # mkdev lo 0 # # Create a tty device for the second serial port # # The first serial port is reserved for system debug and console access # through the tip(1) utility on the host workstation # # If you do not know the device tree pathname to the second serial port, # note that device tree is visible in the output of dtree(1M). # # Note that major number 0 is conventionally reserved for ttys # mkdev tty 0 # takes first available device # Other possibilities include: #mkdev tty 0 /pci/pci-isa/ns16650-2 #mkdev tty 0 /raven/w83c553/ns16650-2 #mkdev tty 0 /sabre/simba-b/ebus/ns16650-2 mknod /dev/tty01 c 0 0 # # Create pseudo-tty devices for on-demand dialing # mknod /dev/ptyp0 c 5 0 # Master mknod /dev/ttyp0 c 6 0 # Slave # # Create a Berkeley Packet Filter device and special file # mkdev bpf 0 mknod /dev/bpf c 23 0
See the appropriate document in the ChorusOS 5.0 Target Platform Collection for serial device IDs for other serial line hardware.
This section explains how to configure Point-to-Point Protocol (PPP) with the ChorusOS product standard interface and drivers. It assumes the serial line or modem is already physically connected. On some platforms, a unique serial line is used both for the console (accessed through tip), and for PPP. At boot time, the serial line connector must be connected to the host tip line.
Systems often have two IP addresses: one for Ethernet, one for PPP.
This document differentiates between Ethernet Internet addresses and PPP addresses. As you read, be aware that hostname refers to the Ethernet hostname corresponding to the Ethernet IP address, and that host_PPP refers to the hostname corresponding to the PPP address.
PPP as implemented in this version of the ChorusOS operating system handles IP traffic in a different way to previous releases of the ChorusOS operating system. The entire process is described in this chpater in detail but can be summarized as follows:
First, run pppstart, a daemon that listens for requests for connection.
Next, use the pppd command to enable rsh connection to a specific serial line.
When finished with a PPP connection, you may close it using the pppclose command.
Finally, disable PPP services altogether using the pppstop command.
In order to make sure the Ethernet interface can still be used for IP traffic, use different IP addresses for Ethernet and IP.
It is strongly recommended for this release that you use different IP addresses for PPP and Ethernet.
As shown above, if each system has only one IP address, when an ifnet interface is set up between target_PPP and host_PPP, all traffic to host_PPP is routed through target_PPP. In other words, all IP traffic passes through the serial line.
Enabling PPP services involves using the pppstart process. You can choose to enable PPP services either automatically at boot time, or manually, via the command line.
Change to the directory where you build system images:
host% cd build_dir |
Use the hints in the table below to set system image features and tunables:
Set... |
Comments |
---|---|
VTTY=true |
PPP requires virtual ttys. |
PPP=true |
|
iom.nfs.rsize=1024 |
Optimizing NFS read and write buffer sizes for use with PPP by setting them to a maximum of 1024 |
iom.nfs.wsize=1024 |
|
host% configurator -set VTTY=true |
host% configurator -set PPP=true |
Ensure that both serial lines and network interfaces are available for PPP by including the necessary commands in the conf/sysadm.ini file that you build into the system image. For example:
# set umask to 0 during system configuration umask 0 # Build the various interfaces you need using the mkdev command. # All interfaces require a unit number. For bpf and tty, this number also # to the device minor. Thus: # mkdev tty 0 /pci/pci-isa/ns16550-2 # corresponds to # mknod /dev/tty01 major 0 # Create the tty interface using the second serial port # because the first is reserved for the tip line mkdev tty 0 /pci/pci-isa/ns16550-2 # rarp needs bpf, again the unit number corresponds to the device minor. mkdev bpf 0 mkdev bpf 1 # Create a PPP interface that is not bound to the tty yet. mkdev ppp 0 # Ethernet # mkdev ifeth 0 /pci/epic100 mkdev ifeth 0 # loopback interface mkdev lo 0 # Create a tty special file mknod /dev/tty01 c 0 0 # Pseudo tty devices, needed for dialup on demand. # mknod /dev/ttyp0 c 5 0 # mknod /dev/ptyp0 c 6 0 # Enable PPP # Requires pppstart in system image # /image/sys_bank/pppstart & pppd /dev/tty01 # Open a PPP line. # Wait for the interface to be up. # ifwait ppp0
See the appropriate document in the ChorusOS 5.0 Target Platform Collection for serial device IDs for other serial line hardware.
Start the Ews configuration utility:
host% ews conf/ChorusOS.xml & |
Include the pppstart process in the system image
(see "Embedding the pppstart
process into the ChorusOS
system image" for information about how to do this).
(Optional) If you need chat, include the chat
process in the system image (see "Embedding the chat
process into the ChorusOS
system image" for information
about how to do this).
Rebuild the system image.
host% make chorus
Copy the system image to the boot server:
host% rcp system_image_name boot_server:/tftpboot |
Reboot the target system:
host% rsh target reboot |
Make the serial lines and network interfaces available for PPP:
Create a tty interface:
host% mkdev tty 0 |
Create a PPP interface:
host% mkdev ppp 0 |
Create a special tty file:
host% mknod /dev/tty01 c 0 0 |
Embed the pppstart process into the ChorusOS system
image (see "Embedding the pppstart
process into the ChorusOS
system image").
Run the pppstart process:
host% rsh target pppstart & |
Opening an available PPP line involves the built-in C_INIT
command, pppd.
Run the built-in C_INIT
command, pppd, on the target system:
host% rsh target pppd device pppd device:info: Using interface ppp0 pppd device:notice: Connect: ppp0 <--> device pppd device:notice: local IP address local_addr pppd device:notice: remote IP address remote_addr |
where device is either /dev/tty01 or /dev/tty02.
See pppd(1M) for details.
Closing an open PPP line involves using the pppclose command.
Run the built-in C_INIT
command, pppclose, on the target system:
host% rsh target pppclose device pppd device:info: Terminating on signal 15. pppd device:notice: Connection terminated, connected for 2 minutes pppd device:info: Exit. |
where device is either /dev/tty01 or /dev/tty02.
Disabling PPP services involves using the pppstop command. This kills the pppstop process daemon.
Run the built-in C_INIT
command, pppstop, on the target system:
host% rsh target pppstop |
This section briefly describes how to configure PPP on the Solaris operating environment system to work with a ChorusOS system. Enough information is provided for you to set up a PPP connection, but for full details about setting up and using PPP on hosts running the Solaris operating environment, see the TCP/IP and Data Communications Administration Guide in the Solaris 7 System Administrator Collection and the System Administration Guide, Volume 3 in the Solaris 8 System Administrator Collection.
You must be root to install and configure PPP.
Before configuring PPP, check that the following packages are installed on the host workstation:
SUNWbnuu
SUNWbnur
SUNWpppk
SUNWapppu
SUNWapppr
host% pkginfo | egrep '.*(bnu|ppp).*' system SUNWapppr PPP/IP Asynchronous PPP daemon configuration files system SUNWapppu PPP/IP Asynchronous PPP daemon and PPP login service system SUNWbnur Networking UUCP Utilities, (Root) system SUNWbnuu Networking UUCP Utilities, (Usr) system SUNWpppk PPP/IP and IPdialup Device Drivers |
If the packages are not installed, you must install them in the order specified above before you continue.
This section describes all files which must be created or modified to configure PPP on a Solaris host.
If you are using aliases for your IP addresses, it is important to ensure that the Solaris operating environment can resolve them. In /etc/hosts, include the following lines:
# Host PPP address Host PPP hostname host_PPP host_name # Target PPP address Target PPP hostname target_PPP target_name
Make sure /etc/hosts or the NIS configuration file, nsswitch.conf(4) includes PPP addresses for both the host and target systems. The nsswitch.conf file explains how to configure /etc/hosts.
You must provide the PPP Link Manager with information regarding each remote host with which the local host will communicate. This information is contained in the PPP configuration file asppp.cf. See also aspppls(1M).
Configure asppp.cf as follows:
Run ifconfig, specify the PPP interface used, select the plumb option to enable IP to recognize the interface, define the local and target hosts and set the interface to up :
ifconfig ipdptp0 plumb host_PPP target_PPP up
See "ifconfig" for more information about the ifconfig command.
Configure the path by adding the interface number, the name of the target host, the ipcp_async_map and the timeout interval:
path interface ipdptp0 peer_system_name .zsmon ipcp_async_map 0xa000 inactivity_timeout 1000000
For further information regarding configuring PPP and the asppp.cf file, see "Configuring PPP" in TCP/IP and Data Communications Administration Guide from the Solaris 7 System Administrator Collection and "Overview of PPP" in System Administration Guide, Volume 3 from the Solaris 8 System Administrator Collection. There is also useful information in aspppd(1M)
This section describes how to modify the terminal configuration to allow a PPP connection without login.
Become superuser:
host% su Password: root password |
Start admintool.
Select Serial Ports from the Browse menu.
Double-click the port to use for PPP.
Click the Expert radio button in the Detail field.
Use the hints in the table below to set options for the port.
Field |
State/Value |
---|---|
Service Enable |
Selected |
Baud Rate |
9600 |
Initialize Only |
Not selected |
Bidirectional |
Selected |
Software Carrier |
Selected |
Port Monitor Tag |
zsmon |
Connect on Carrier |
Selected |
Service |
/usr/etc/aspppls |
Streams Modules |
ldterm, ttcompat |
Timeout (secs) |
Never |
Once properly configured, PPP starts automatically at boot time.
Become superuser:
host% su Password: root password |
Start PPP:
# /init.d/asppp start |
Make sure PPP started successfully:
# netstat -i Name Mtu Net Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue lo0 8232 loopback localhost 1386 0 1386 0 0 0 hme0 1500 host_name host_name 93612 1714 73065 0 860 0 ipdptp0 8232 target_PPP host_PPP 0 0 0 0 0 0 # tail /etc/log/asppp.log 12:31:34 Link manager (2099) started 11/27/99 12:31:34 parse_config_file: Successful configuration 12:31:40 000531 ipdptp0 SEND PPP ASYNC 29 Octets LCP Config-Req ID=6b LEN=24 MRU=1500 ACCM=000a0000 MAG#=cdf1e77f ProtFCOMP AddrCCOMP |
If you want the PPP target to be visible from the whole network, you must enable routing on your workstation.