Solaris Resources at Kempston

Connecting to Freeserve with Solaris 7 and Solaris 8

www.kempston.net/solaris/ www.kempston.org/solaris/

This page contains detailed step-by-step instructions to configure PPP on Solaris 7 and Solaris 8 to connect to Freeserve, including all the Freeserve-specific information, such as name server addresses. If you're interested in a further explanation of the changes, please see Configuring PPP to connect to any ISP. These instructions also work on Solaris 2.6.

The only pieces of information you need to configure Solaris to connect to Freeserve are your Freeserve username and your dialup password. In these instructions, username has been used as the Freeserve username and password as the password. When configuring your own system, replace the one occurrence of username with your own username and the one occurrence of password with your password.

These instructions show how to configure Solaris to authenticate to Freeserve using either a username and password or using PAP. I recommend using the username and password technique first because it's easier to see what's happening. When this is working, you can change to PAP if you wish and this establishes the connection a little faster.

Important Notes

The instructions assume that your modem is external and attached to the first serial port but the instructions identify the changes needed to use a modem connected to the second serial port. Note that you must have a real modem; monstrosities known as WinModems are of no use whatsoever with unix. Unfortnately, I have no experience of using internal modems with Solaris and there may be additional configuration issues with these. I'm not able to advise about issues with internal modems but there's some useful advice at Celeste Stokely's Web pages and especially in her Tutorial on Solaris 2.x Modems & Terminals which is highly recommended.

These instructions do work and many people have configured a dial up connection using them. If your system fails to connect to your ISP after following them, the most likely explanation is that you've edited one or more of the files incorrectly. Please note that the format of some of the changes to configuration files is critical: some require a tab character between fields and some require a space. The safest way of making the changes is to save this Web page in a file, load it into a Web browser on Solaris and copy and paste lines from the Web page into the files which are edited.

If you're reading this page on a Windows system, note that Solaris is quite happy to read files saved under Windows. If you have a system which can boot into either Windows or Solaris and your Windows c: drive is the master disc on the primary IDE controller, the following commands mount your c: drive under a directory called /dos in the Solaris file system:

	# mkdir /dos
	# mount -F pcfs /dev/dsk/c0d0p0:c /dos

and you can perform this mount automatically at boot time by adding a line to /etc/vfstab which reads:

	/dev/dsk/c0d0p0:c - /dos pcfs - yes -

Note that ":c" on the end of the device name means the first DOS partition on the drive. The following command mounts the second DOS partition on the same drive:

	# mount -F pcfs /dev/dsk/c0d0p0:d /dos


Now for the instructions. No unix knowledge is assumed, other than the ability to edit files using a text editor.



A step-by-step Guide to configuring PPP for Freeserve

Please note that you must be logged in as root while configuring PPP.

1. Check that the UUCP packages have been installed:

	# pkginfo | grep UUCP

Check that the following are installed:

	system      SUNWbnur       Networking UUCP Utilities, (Root)
	system      SUNWbnuu       Networking UUCP Utilities, (Usr)

If this command just returns with a prompt, the packages aren't installed. Use pkgadd to install them as follows:

For Intel (x86) Solaris 8:

Insert the CD marked "Solaris 8 Intel Platform Edition Software CD 2 of 2" and type:

	# pkgadd -d /cdrom/sol_8_ia_2/Solaris_8/Product SUNWbnur
	# pkgadd -d /cdrom/sol_8_ia_2/Solaris_8/Product SUNWbnuu

For SPARC Solaris 8:

Insert the CD marked "Solaris 8 SPARC Platform Edition Software CD 2 of 2" and type:

	# pkgadd -d /cdrom/sol_8_sparc_2/Solaris_8/Product SUNWbnur
	# pkgadd -d /cdrom/sol_8_sparc_2/Solaris_8/Product SUNWbnuu

For Intel (x86) Solaris 7:

Insert the Intel Solaris 7 CD and type:

	# pkgadd -d /cdrom/sol_7_x86/s2/Solaris_2.7/Product SUNWbnur
	# pkgadd -d /cdrom/sol_7_x86/s2/Solaris_2.7/Product SUNWbnuu

For SPARC Solaris 7:

Insert the SPARC Solaris 7 CD and type:

	# pkgadd -d /cdrom/sol_7_sparc/s0/Solaris_2.7/Product SUNWbnur
	# pkgadd -d /cdrom/sol_7_sparc/s0/Solaris_2.7/Product SUNWbnuu


2. Check that the PPP packages have been installed:

	# pkginfo | grep ppp

Check that (at least) the following are installed:

On Solaris 8:

	system	SUNWapppr	PPP/IP Asynchronous PPP daemon configuration files
	system	SUNWapppu	PPP/IP Asynchronous PPP daemon and PPP login service
	system	SUNWpppk	PPP/IP and IPdialup Device Drivers

On Solaris 7:

	system	SUNWpppk	Solstice PPP Device Drivers
	system	SUNWapppu	PPP/IP Asynchronous PPP daemon and PPP login service
	system	SUNWapppr	PPP/IP Asynchronous PPP daemon configuration files

If you have 64-bit Solaris 7 or 8 installed, you should also see the package:

	system	SUNWpppkx	PPP/IP and IPdialup Device Drivers (64-bit)

If not, use pkgadd to install them in the order shown below.

For Intel (x86) Solaris 8:

Insert the CD marked "Solaris 8 Intel Platform Edition Software CD 2 of 2" and type:

	# pkgadd -d /cdrom/sol_8_ia_2/Solaris_8/Product SUNWpppk
	# pkgadd -d /cdrom/sol_8_ia_2/Solaris_8/Product SUNWapppu
	# pkgadd -d /cdrom/sol_8_ia_2/Solaris_8/Product SUNWapppr

And for 64-bit Solaris 8:

	# pkgadd -d /cdrom/sol_8_ia_2/Solaris_8/Product SUNWpppkx

For SPARC Solaris 8:

Insert the CD marked "Solaris 8 SPARC Platform Edition Software CD 2 of 2" and type:

	# pkgadd -d /cdrom/sol_8_sparc_2/Solaris_8/Product SUNWpppk
	# pkgadd -d /cdrom/sol_8_sparc_2/Solaris_8/Product SUNWapppu
	# pkgadd -d /cdrom/sol_8_sparc_2/Solaris_8/Product SUNWapppr

And for 64-bit Solaris 8:

	# pkgadd -d /cdrom/sol_8_sparc_2/Solaris_8/Product SUNWpppkx

For Intel (x86) Solaris 7:

Insert the Intel Solaris 7 CD and type:

	# pkgadd -d /cdrom/sol_7_x86/s2/Solaris_2.7/Product SUNWpppk
	# pkgadd -d /cdrom/sol_7_x86/s2/Solaris_2.7/Product SUNWapppu
	# pkgadd -d /cdrom/sol_7_x86/s2/Solaris_2.7/Product SUNWapppr

And for 64-bit Solaris 7:

	# pkgadd -d /cdrom/sol_7_x86/s2/Solaris_2.7/Product SUNWpppkx

For SPARC Solaris 7:

Insert the SPARC Solaris 7 CD and type:

	# pkgadd -d /cdrom/sol_7_sparc/s0/Solaris_2.7/Product SUNWpppk
	# pkgadd -d /cdrom/sol_7_sparc/s0/Solaris_2.7/Product SUNWapppu
	# pkgadd -d /cdrom/sol_7_sparc/s0/Solaris_2.7/Product SUNWapppr

And for 64-bit Solaris 7:

	# pkgadd -d /cdrom/sol_7_sparc/s0/Solaris_2.7/Product SUNWpppkx

If you happen to have the (commercial) server edition of Solaris 7 or Solaris 8, do not install the optional Solstice PPP product: it stops the bundled aspppd from working.


3. Configure your modem connection:

Start admintool under CDE:

	# admintool&

Select the Browse menu and then Serial Ports from the drop-down list. Click on the line starting a if your modem is attached to the first serial port or on the line starting b if your modem is connected to the second serial port. Select the Edit menu and then Modify from the drop-down list.

Change the following fields:

	Template:    Modem - Dial out Only
Baud Rate: 38400

Cick on OK and close admintool.


4. Test communication with the modem:

If your modem is attached to the first serial port:

	# tip /dev/cua/a

If your modem is attached to the second serial port:

	# tip /dev/cua/b

tip should respond:

	connected

which indicates that tip has connected to the serial port. To check that the system can communicate with the modem, type:

	ATZ

and the modem should respond:

	OK

Close tip by typing:

	~.

If this doesn't work, and especially if you have an internal modem, have a look at Celeste Stokely's Tutorial on Solaris 2.x Modems & Terminals which contains a wealth of useful information about modems.


5. Edit /etc/uucp/Devices:

Edit /etc/uucp/Devices to comment out the last two lines:

	ACU cua/b - Any hayes
	Direct cua/b - Any direct

by prefixing them with a # symbol and add:

	ACU cua/a - Any hayes

If your modem is attached to the second serial port, this line should read:

	ACU cua/b - Any hayes


6. Edit /etc/uucp/Dialers:

Edit /etc/uucp/Dialers to comment out the existing line starting 'hayes' and add:

	hayes	=,-,	"" P_ZERO "" \d "" AT&F1\r OK ATDT\T\r\c CONNECT

The initialisation string 'AT&F1' is correct for 3Com and US Robotics modems and sets the modem to hardware flow control. If your modem needs a different initialisation string to set hardware flow control, replace 'AT&F1' with the required string.


7. Edit /etc/uucp/Systems:

The changes needed to /etc/uucp/Systems are different depending on whether you wish to authenticate by responding to Login and Password prompts or whether you wish to use PAP.

If you're using the conventional Login and Password method, add to the end of /etc/uucp/Systems a line such as:

	freeserve-ppp Any ACU 115200 08450796699 ogin: username.freeserve.co.uk word: password "" STTY=crtscts

replacing username and password with your username and dialup password.

If you wish to authenticate using PAP, the changes to this file are simpler. Just add a line to /etc/uucp/Systems reading:

	freeserve-ppp Any ACU 115200 08450796699 \n STTY=crtscts

The "\n" in this line waits for the end of the CONNECT string from the modem so that the connect speed is recorded in the asppp.log file.

If you want to be able to connect to more than one ISP, you can add additional lines to this file for the other ISPs.

Note: There must be a line feed (LF) character at the end of the line added to this file. If using a graphical editor, such as the one supplied with CDE, ensure that the cursor is positioned at the start of the line following the inserted line before saving the file. If this LF character is omitted, the aspppd log file will report:

	Call Failed: SYSTEM NOT IN Systems FILE


8. A word about modem speeds

The 115200 in the /etc/uucp/Systems file sets the speed at which the serial port hardware communicates with the modem to 115,200 bits per second. It's important to understand that there are two speeds to be considered in modem communication. There's the speed at which the host computer talks to a connected modem and this is known as the Data Terminal Equipment or DTE speed. There's also the speed at which the modem transmits and receives data across the telphone line and this is known as the Data Communication Equipment or DCE speed. A 56K or V90 modem is capable of a DCE speed of up to 56K, although this is unlikely to be achieved in practice. Data sent down a telephone connection is often compressed with the receiving modem uncompressing the data before sending it to the host computer. So a modem to modem speed (DCE) of 56K could result in a modem to computer speed (DTE) well in excess of 56K. For this reason, the DTE speed should be set at least 50% higher than the maximum DCE speed and a DTE speed of 115200 is recommended for use with 56K modems.

However, not all Sun hardware is capable of talking to a serial port at this speed. If you have a Sun Ultra 5 or better, or an Intel P90 or better, your system should be able to sustain a DTE speed of 115200. If you have an older Sun system, you may well not be able to drive a V90 modem at its maximum speed and will need to experiment to find the highest DTE speed that your hardware supports. If 115200 doesn't work, try specifying 38400, 19200 or 9600 in the line in /etc/uucp/Systems.


9. Create /etc/resolv.conf.freeserve:

	domain freeserve.co.uk
	nameserver 194.152.64.68
	nameserver 194.152.64.35

This file is activated by means of a dialup script, as shown later, which allows simple configuration of Solaris to connect to more than one ISP if necessary.

Note: Some editors (including CDE's text editor) create files with permissions of 600 which means that only the owner can read the file. If /etc/resolv.conf.freeserve has these permissions, only root will be able to use the dial-up connection. To ensure that the dial-up connectivity is accessible to all users, change the permissions on this file:

	# chmod 644 /etc/resolv.conf.freeserve


10. Edit /etc/asppp.cf:

Make two copies of /etc/asppp.cf:

	# cp /etc/asppp.cf /etc/asppp.cf.original
	# cp /etc/asppp.cf /etc/asppp.cf.freeserve

You can edit the original version of this file if you wish. But be aware that the aspppd daemon starts automatically at boot time if /etc/asppp.cf exists and dials on demand if this file contains an 'ifconfig' line. This may be inconvenient, unexpected, and costly in telephone charges. It's much safer to make these changes in a copy of the file and activate the copy in a script as shown later: this gives you control over the dialup process.

Edit /etc/asppp.cf.freeserve and add to the end of this file:

	ifconfig ipdptp0 plumb 1.1.1.1 2.2.2.2 up
	path
		inactivity_timeout 300	# 5 minutes
		interface ipdptp0
		debug_level 9		# Full logging
		negotiate_address on
		default_route
		peer_system_name freeserve-ppp

The IP addresses 1.1.1.1 and 2.2.2.2 are replaced automatically during the PPP negotiation phase with the dynamic IP address assigned by Freeserve to your connection and with the address of Freeserve's gateway. Adjust the inactivity timeout if desired.

Note that the name specified on the peer_system_name line must match the name used in /etc/uucp/Systems. A common mistake is to use a hyphen in one file (freeserve-ppp) and an underline character in the other (freeserve_ppp). Make sure that they match!

If you're authenticating using PAP (don't do this if you're using the conventional Login and Password method), add three additional lines to /etc/asppp.cf.freeserve immediately after the 'peer_system_name' line, reading:

		will_do_authentication pap
		pap_id username.freeserve.co.uk
		pap_password password

replacing username with your username and password with your password.

Change permissions on the asppp.cf files:

	# chmod 600 /etc/asppp.cf.original /etc/asppp.cf.freeserve


11. Check /etc/nsswitch.dns and /etc/nsswitch.files:

Check whether your system has files named /etc/nsswitch.dns and /etc/nsswitch.files:

	# ls /etc/nsswitch.dns /etc/nsswitch.files
	/etc/nsswitch.dns /etc/nsswitch.files

These files exist in later versions of Solaris 7 and in Solaris 8, but not in early versions of Solaris 7. If both files exist, skip the rest of this step.

The nsswitch.files file is used while your system isn't connected to your ISP and tells your system to look in /etc/inet/hosts when it needs to look up an IP address. The nsswitch.dns file is used while your system is connnected to your ISP and tells your system to look in /etc/inet/hosts first but to use your ISP's DNS name servers if the address isn't listed in the local hosts file.

If one or both files don't exist, create them as follows:

/etc/nsswitch.dns:

Create this file by copying /etc/nsswitch.conf:

	# cp /etc/nsswitch.conf /etc/nsswitch.dns

Edit /etc/nsswitch.dns and check that the line starting "hosts:" reads as follows, changing it if necessary:

	hosts:      files dns

Make sure that the file has the correct permissions:

	# chmod 644 /etc/nsswitch.dns

/etc/nsswitch.files:

Create this file by copying /etc/nsswitch.conf:

	# cp /etc/nsswitch.conf /etc/nsswitch.files

Edit /etc/nsswitch.files and check that the line starting "hosts:" reads as follows, changing it if necessary:

	hosts:      files

Make sure that the file has the correct permissions:

	# chmod 644 /etc/nsswitch.files


12. Create the aspppd log file:

	# touch /var/adm/log/asppp.log


13. Inhibit sending of RIP packets:

in.routed may send routing information packets (RIP) on the dialup link. This is undesirable and is prevented by creating a file named /etc/gateways containing the single line:

	norip ipdptp0


14. Stop the system acting as a router:

Solaris may decide that your system is a router, running routed and router discovery. This is undesirable on a dialup connection and is prevented by creating an empty file named /etc/notrouter:

	# touch /etc/notrouter


15. Disable host caching:

The name service cache daemon (nscd) causes problems with name lookups on intermittentently-connected systems. Disable host caching by editing the /etc/nscd.conf file and uncommenting the line:

	#	enable-cache		hosts		no

so that it reads:

		enable-cache		hosts		no

Then stop and restart the nscd daemon:

	# /etc/init.d/nscd stop
	# /etc/init.d/nscd start


16. Log incoming TCP/IP connections:

Change the last line in /etc/rc2.d/S72inetsvc from:

	/usr/sbin/inetd -s &

to:

	/usr/sbin/inetd -s -t &

This instructs inetd to log incoming TCP/IP connections to /var/adm/messages. Note that if you use the Open Windows text editor to edit the file, the editor saves the orginal file in /etc/rc2.d as S72inetsvc%. If this file is left in place, Solaris will execute both the original file and the edited file during boot up and this will result in error messages being reported to the console. After editing the file, delete the saved original file by doing:

	# rm /etc/rc2.d/S72inetsvc%

It's necessary to do this only when the file is edited using the Open Windows text editor. The CDE text editor doesn't save the original file.


17. Create a dialup script named /dialup :

	cp -p /etc/resolv.conf.freeserve /etc/resolv.conf
	cp -p /etc/asppp.cf.freeserve /etc/asppp.cf
	cp -p /etc/nsswitch.dns /etc/nsswitch.conf
	/etc/init.d/asppp start
	/usr/sbin/ping 2.2.2.2

The script activates the Freeserve-specific versions of /etc/resolv.conf, /etc/asppp.cf and /etc/nsswitch.conf and starts the aspppd daemon which dials on demand and routes PPP packets across the dialup link. Finally, it pings the dummy gateway address which causes aspppd to start the dialup process.


18. Create a hangup script named /hangup:

	/etc/init.d/asppp stop
	rm /etc/resolv.conf
	cp -p /etc/asppp.cf.original /etc/asppp.cf
	cp -p /etc/nsswitch.files /etc/nsswitch.conf
	/usr/sbin/route -f

This script stops aspppd which terminates the dialup connection, deletes /etc/resolv.conf and re-instates the original versions of /etc/asppp.cf and /etc/nsswitch.conf.. Finally, it flushes the gateway entry from the routing table.


19. Make these scripts executable:

	# chmod 700 /dialup /hangup


20. Reboot:

	# init 6

This isn't essential (Solaris very rarely requires a reboot) but it has the effect of testing the changes you've made to scripts which are run at boot time.


Connecting to Freeserve

After rebooting, your system should be fully configured for dialling into Freeserve.


To test the dial-up link:

Open two terninal windows on your screen. In the first window, type:

	# tail -f /var/adm/log/asppp.log

This will display the contents of the PPP log file as it is written to by the asppp daemon and enables the progress of the connection to be monitored.

In the second window, run the dial-up script by typing:

	# /dialup

Watch the log window and you'll see the interaction with the modem, the telephone number being dialled and the CONNECT response from the modem when the two modems at each end of the link have negotiated a connection. If you're authenticating using a Login and Password script, the log window will show the login followed by some PPP frames as the PPP negotiation is performed. If you've configured your system to perform PAP or CHAP authentication, the log file will show PPP frames as soon as a connection has been established.

The PPP frames displayed in the log window may not make much sense unless you're familiar with the detail of the PPP protocol. There are some examples of typical PPP negotiations, with an explanation of what it all means, in my page on Analysing the asppp log file on Solaris. Have a look at this if you're interested and especially if the connection fails for any reason.

When PPP negotiation has finished, the log file displays:

	start_ip: IP up on interface ipdptp0, timeout set for 300 seconds

which indicates that the link is fully up and ready to carry traffic. After this point, the log window shows each PPP frame carried on the link. The log file can grow large very quickly and you may wish to reduce the logging level when you're happy that the connection process is working properly.

Note that the 'ping' command in the dial-up script will fail because the pinged address doesn't exist. Don't worry about this; its purpose is simply to prod aspppd into action and start the dial-up process.

After connection is established, test the link using ping and nslookup, or just fire up Netscape for Solaris and have a look at www.sunfreeware.com

Be aware that it's not advisable to connect to the Internet routinely while logged in as root and, in particular, running any Web browser as root may compromise the security of your system. Once you've checked that the PPP configuration is working, I'd recommend that you always start the dialup process while logged in as an ordinary non-privileged user. There's a small problem here, in so far as the /dialup and /hangup scripts must be run with root privileges. The solution is an excellent program called sudo (Super User Do) that enables specified programs and scripts to be run as root from an ordinary user. Please see my Web page on installing sudo for details.


To stop the dialup link, type:

	# /hangup


To monitor TCP/IP packets while connected:

	# snoop -d ipdptp0

Further configuration

Logging levels

When you're sure that the dialup connection is working properly, you may like to reduce the logging information written to /var/adm/log/asppp.log by changing the line in /etc/asppp.cf.freeserve which reads:

	debug_level 9		# Full logging

to:

	debug_level 5		# Log all uucp chat script info

Level 5 logs the connection process but not PPP messages or raw IP packets.


Netscape

Some recent versions of Netscape for Solaris don't work properly if the name server cache daemon (nscd) is configured not to cache host name lookups as described on this page. Symptoms are that Netscape works fine when given the IP address of a Web server but times out when given the name of a Web server. This problem doesn't occur on all systems but, if it happens on your system, the solution is to undo the changes to /etc/nscd.conf. Edit this file to replace:

		enable-cache		hosts		no

with:

	#	enable-cache		hosts		no

Then stop and restart the nscd daemon:

	# /etc/init.d/nscd stop
	# /etc/init.d/nscd start


A graphical Internet Dialer

Dave Everly has written an excellent Internet Dialer script for Solaris that enables you to select an ISP and connect to the Net with just a few clicks of the mouse.

This script assumes that you have already configured your Solaris system to connect to the Net as described here and provides a graphical user interface as an alternative to using the /dialup and /hangup scripts directly.

The script can be downloaded from my Web page on A GUI Internet Dialer for Solaris 7 which also contains a screenshot and full details on installing and configuring the script.


Configuring mail

Now that you've successfully configured Solaris to make a dial up connection to your ISP, you may like to follow my instructions for Configuring mail so that you can send and receive email using Solaris.


Security

Consider installing TCP wrappers to give you at least some security from unwelcome visitors when your Solaris system is connected to the Net.



Connecting to multiple ISPs:

One advantage of creating ISP-specific files for use with a dialup script is that it's simple to configure Solaris to dial into one of several ISPs under user control.

My /dialup script reads as follows:

#!/sbin/sh
#
# PPP Dialup script for Demon, Netcom, U-Net and Freeserve
# Copyright (c) mike@kempston.net 1999

case "$1" in

'demon')
	/etc/init.d/sendmail stop
	cp /etc/resolv.conf.demon /etc/resolv.conf
	cp /etc/asppp.cf.demon /etc/asppp.cf
	cp /etc/nsswitch.dns /etc/nsswitch.conf
	/etc/init.d/asppp start
	/usr/sbin/ping 158.152.1.222
	;;

'netcom')
	cp /etc/resolv.conf.netcom /etc/resolv.conf
	cp /etc/asppp.cf.netcom /etc/asppp.cf
	cp /etc/nsswitch.dns /etc/nsswitch.conf
	/etc/init.d/asppp start
	/usr/sbin/ping 2.2.2.2
	;;

'unet')
	cp /etc/resolv.conf.unet /etc/resolv.conf
	cp /etc/asppp.cf.unet /etc/asppp.cf
	cp /etc/nsswitch.dns /etc/nsswitch.conf
	/etc/init.d/asppp start
	/usr/sbin/ping 2.2.2.2
	;;

'freeserve')
	cp /etc/resolv.conf.freeserve /etc/resolv.conf
	cp /etc/asppp.cf.freeserve /etc/asppp.cf
	cp /etc/nsswitch.dns /etc/nsswitch.conf
	/etc/init.d/asppp start
	/usr/sbin/ping 2.2.2.2
	;;

*)

	echo "Usage: $0 { demon | netcom | unet | freeserve }"
	exit 1
	;;

esac
exit 0

So I can choose which ISP I dial into by typing one of:

  # /dialup demon
  # /dialup netcom
  # /dialup unet
  # /dialup freeserve

Has this guide been useful?

I hope these instructions prove useful. If you have any comments or suggestions for improvement, or have found any technical errors, please email me at mike@kempston.net

This page is copyright © mike@kempston.net 2000. Reproduction is forbidden without the author's permission. You are welcome to link to these pages if you wish but please point to the pages at www.kempston.net: Solaris Resources at Kempston


Home Free Solaris Connecting to an ISP
Configuring mail Configuring modem dialup Configuring a PPP server
Installing Software Solaris FAQs and Software Site Index

This page is maintained by the Kempston Webmaster
Last updated 17 September 2000