Linux Space Station Raven - SSR-03

(C) Graham Swallow version -1b, gen 1996-07-29 00:37, gps@trix.dircon.co.uk

Issue Three - Networking

1 Issue-3

Greetings, this is Issue-3. It is all about getting networking up and running.

The best reference texts are the NAG (network administrators guide), and the NET-2 HOWTO in the LDP printed compendium, and on-line.

1.1 Drop-in and change the values, example configuration

You may find Raven easier, because it uses ”real example values”, rather than generic descriptions. However, you must remember to chage the values to yours! Obvious really. Do refer back to the main LDP docs, as they cover more variations, of different situations, However, once you have a working system, they will make more sense.

You should also use your imagination, and think up a different number than 67, and a different set of host names. Allocating IP addresses is discussed in Issue-1 , basically 192.168.67.1 can be your TCP/IP address on your private LAN.

1.2 modem + ethernet card

The configuration files used here, work for a machine with a modem and an ethernet card, ie a typical small home/office machine. I recommend that you get an ethernet card anyway, because it allows you to take the machine anywhere (or bring a friends machine in), and connect over ethernet, with only a few edits to /etc/hosts, and maybe /etc/rc.d/rc.inet1 (or whatever).

If you don’t have an ethernet card, this configuration will still work, as long as the loopback interface works correctly. You can use a ”dummy0” TCP/IP interface instead of eth0, but this should not be necessary. To link two machines without ethernet, you can use a null modem serial cable and PPP or SLIP.

1.3 SLIP or PPP

Both are documented. Most people are moving towards PPP, but SLIP is still a common option, for connecting to your Internet Service Provider.

You will have to modify the chat script, or dip script, so that you phone the correct telephone number, and login as the correct name using your secret password.

In addition, different ISP’s have different greeting messages, which is how the scripts know they are properly connected, and my ISP asks me if I want SLIP or PPP.

After connecting, you may have additional parameters that need setting, your ISP will help you. These work for me.

1.4 dial ppp

Raven is a shareware magazine, but dial ppp is available elsewhere as a Free package.

dial ppp was inspired by an article in Raven, that enables a non-root user to get root permissions to establish and break the PPP connection, in a ”safe and controlled manner”.

A description of how it works, is a pending article in Linux World. (a new Linux oriented magazine from ther UK).

1.5 Apps

As well as making the connection you want to locate and configure apps to run over it. There are many choices, you want an email reader, a news reader, web browser and an ftp client.

With a local LAN, or even over a dial-up connection you can become a web server, by installing Apache or another httpd (daemon).

1.6 sendmail

Configuring sendmail is not difficult, but it can be confusing, when you want something now. Raven has a 10 line configuration that works for a typical home machine, and background information about how to test it and how it works.

2 fax

Your modem has to act as a receptionist for incoming calls. DATA gets the login prompt, FAX gets the FAX machine software. VOICE just makes it more complicated.

This is the job of ’getty’, a program that converts serial lines to usable login tty lines. You don’t need mgetty, efax is ok.

• CDROM

• file:/cdrom/apps/comm/fax - efax

• file:/cdrom/system/Serial - mgetty+sendfax-0.98.tar.gz

• SUNSITE

• http://sunsite.unc.edu/pub/Linux/apps/comm/fax - efax

• http://sunsite.unc.edu/pub/Linux/system/Serial - mgetty

Jun 17 19:29          686 disc4/apps/comm/fax/efax07a.lsm
Jun 17 19:53        82617 disc4/apps/comm/fax/efax07a.tar.gz

Later I thought I’d go for mgetty. It does audio?

Aug 31 07:03         1342 disc4/system/Serial/mgetty+sendfax-0.98.lsm
Aug 31 14:11       444017 disc4/system/Serial/mgetty+sendfax-0.98.tar.gz

2.1 efax-07a

This is a tiny system at 82K, mgetty weighs 444K (uncompiled). It builds and installs out of the box. You have to customise ONE file - to set your station-id and other parameters. You have to

• make

• make install

• vi /usr/bin/fax - as follows

• file:/usr/bin/fax - browse you own file

2.2 vi /usr/bin/fax

vi /usr/bin/fax and make at least these changes ...

• DEV=modem

• FROM=”+44 0181 123 4567”

• NAME=”Graham ... ”

• PAGE=A4

• PRTYPE=ps

• VIEW=’$EFIX -ve -p$PAGEDIM $RES -opgm $f’ # pgm or pbm

• VIEWCMD=”xv -”

• VIEWCMD=”xloadimage stdin”

• /cdrom/disc4/X11/xapps/graphics/viewers/xloadimage.4.1.tgz

• FAXMGR=postmaster •

2.3 Test the fax

The fax test command, will look at your modem, to see that all is OK. Avoid spaces in the phone number, it’s confusing with shell.

• fax test - talks to correct modem OK

• chown you /dev/modem /dev/cua? # or chgrp better •

• vi /tmp/fax1

• fax make /tmp/fax1

• fax view /tmp/fax1.*

• fax send 01296-123-4567 /tmp/fax1 At first glance, the fonts used in faxes seem quite horrific. This is a problem with the viewer scaling down the image. You will see the difference.

2.3.1 Setup for incoming It’s mostly all done, you just need to print the faxes, or email them to someone (a message is sent, the files remain in /var/spool). Delete files when ??

2.4 fax view

I tried looking at /tmp/fax out.001 I was not happy.

2.4.1 efix -o pbm -n fax out.pbm fax out.001 converted the 20 k g3 file, to a 500 k pbm. If you don’t want to collect .pbm files, you can use .pbm file format for the viewer’s stdin.

2.4.2 xv fax out.pbm xv displays the 1728 x 2287 pbm in a ’lossy’ way, the g3 file is OK, the pmb file is OK, the xv display is fuzzy.

2.4.3 xloadimage fax out.pbm This shows that the fonts are crystal clear, which may be too high a resolution for the fax paper, or viewer. Unfortunately I couldn’t get xloadimage to read the fax out.001 file directly, it said the format was not recognised. ie the efix program is needed to convert the file formats. The same effect happens when efix outputs a .pgm. Its because everbody’s library code decimates by 4 and cut lines somewhere.

2.4.4 efix -o pbm fax out.001 | xloadimage stdin This is the hottest FAX viewer in town!

2.4.5 efix -o pgm -n fax out.pgm fax out.001 This file is a mere 250 K, and the display is worse, it is probaby due to the resolution having taken groups of 4 pixels into grey scales. /usr/bin/fax view uses pgm as default, this saves switching screen res, but pbm is more readable, albeit bigger than the screen. To avoid creating lots of big .pbm files, I edit /usr/bin/fax to use xloadimage, with the .pbm data travelling through a unix pipe, but not getting stored on the disk.

2.5 URGENT! 50 page postscript document to send NOW!

First you have to create your file, probably using a wordprocessor and postscript output to disk. I used Raven-Issue-One.dvi. You can use netscape to convert .html to .ps, or ghostview, or whatever.

2.5.1 dvips ssr1.dvi Converted ssr1.dvi to ssr1.ps. And much quicker than I expected.

2.5.2 ghostview ssr1.ps & With X11 running, this confirmed that the file is a valid postscript file, and preview it for formatting problems.

2.5.3 fax make ssr1.ps created ssr1.fax.052, ie one page per file in g3 format. Typically 50 K big.

2.5.4 efix -o pbm fax out.001 | loadimage stdin This is a high res fax viewer.

2.5.5 fax send 0123-456-7689 ssr1.ps Hopefully that worked.

2.5.6 hi-res lo-res FAX has two different vertical reolutions (horizontal is a fixed 204 dpi,

        HI-RES  204 x 196       1728 x 2100 # page length arbitrary
        LO-RES  204 x  96       1728 x 1000 # eg A4, legal, other

2.5.7 fax make -l ssr1.ps According to the /usr/bin/fax script, HI-RES is the default. Just to prove a point try adding the -l after fax make.

2.5.8 Switching to .pbm for fax view If .pgm files are the right size, but unacceptable for detail, you can make .pbm your default viewer, by editing the /usr/bin/fax script.

• VIEW=’$EFIX -ve -p$PAGEDIM $RES -opbm $f’

• VIEWCMD=”xloadimage stdin” Of course when the library is fixed, you may wish to change it back.

2.5.9 Viewing postscript pictures Whilst playing, look in /usr/lib/ghostscript/examples. fax make just calls ghostscript which does the conversion, but it shows how colour pictures get converted. It is easier to use ghostview directly.

2.5.10 mgetty+sendfax-0.98.tar.gz This untars to it’s own relative dir. It’s got it’s own license. All the docs are in (or start at) ./doc/mgetty.textiin, including documentation for packages such as voice support. I decided to go for efax first, but it is an alternative.

3 Internet

This is the fast route to a single host on the network. More complex issues are not covered. The networking programs are on the Slackware-N disk set, and elsewhere on the CD’s. (Slackware) /var/adm/setup/setup.netconfig, may help you establish an initial configuration, (or destroy any existing configuration). Other utilties like linuxconf, may or may not help. You have to do several things to get networking up. This may include rebuilding the kernel, configuring modules and making the serial port work at high speed. To make it easier to understand, I have split those into seperate sections. You should read them (and keep them in mind) when configuring Internet. Internet is just a special case of TCP/IP in general. If you wanted to, you could create your own private Internet, and in fact many Internet providers use Linux to implement the real thing! To get Internet working, simply put the correct values into the correct files and it will work. Usually.

3.1 Documentation

• LDP - means Doctor Linux - your Linux Doc Project compendium

• LDP-V: Network Admin Guide (all of it)

• LDP-XVI: Ethernet Howto (eg hardware problems)

• LDP-XXVII: Net-2 / Net-3 Howto (all of it)

• LDP-XXVIII: NIS Howto (you don’t need NIS)

• LDP-XXVIV: News Howto (or use your net browser) (good-luck)

• LDP-XXXII: PPP Howto (all of it if using PPP not SLIP)

• LDP-XXXVI: Serial HOWTO (skim - find setserial(1))

• man setserial # eg setserial /dev/modem irq 5 spd vhi

• man setserial # eg setserial /dev/modem irq 5

• minicom # shows modem is alive, dial up manually

• man dip # does the dialing and calls ifconfig for you

• man pppd

• dial ppp-0.0.1.tgz - has working example configuration

3.2 ISP Account Information

There are different types of account. I have an account that gives me a static IP address, and hostname.

Some sites may give you a dynamic address (you don’t want this). If so, there are two problems. Firstly SLIP needs to find out the allocated IP address (man dip, wait string ; get $remote). PPP would (probably) get it from the remote connection automatically.

Secondly, you won’t have that address in /etc/hosts, so a few utilities may get confused about what is your address. They may bind onto the first available configured device. It works for many people, so I guess it should work for you! Ask your service provider.

Some accounts don’t register your machine on the Internet, only your email name on their machine. These are a good idea for DOS, but won’t help you learn much, except about that particular system.

You will probably get a choice of CSLIP, SLIP or PPP. PPP may use optional security features (which repeats the logon password identification step with a second password, but sent as part of the PPP protocol.

You will be collecting mail by SMTP, but popmail is also an option.

Your ISP will tell you:

• IP address of you

• IP address of your nearest gateway

• IP address of your nameserver

• IP netmask (almost always 255.255.255.0)

• MTU (often 1500)

• hostname.domain (eg trix.dircon.co.uk)

• login name and password (eg ”trix”, PASSWORD, to connect to their system)

• Phone numbers

• other useful stuff (mailserver, ftp, www, )

You MUST substitute your values into these scripts. Using my ISP’s nameserver for your requests won’t make me popular, and may or may not work, depending on whether the ISP checks who made the call, and whether it advertises the outside to the outside.

In particular, I don’t want to receive your mail!

3.3 Overview

Many people will be connecting their workstation to the LAN, using an ethernet card. If you only have a null-modem RS232 cable, or a PLIP cable, you will need to interpret the text relating to ethernet, but it’s much the same.

You will also be connecting your Linux workstation to the Internet, using a modem. You can be connected to both the LAN and the Internet at the same time, but Issue-3 doesn’t go as far as bridging them, eg with a proxy gateway.

Normally, establishing the Internet PPP or SLIP link, requires root login permissions. You will configure an suid script, and /etc/group to allow a list of ”plain” users to bring the link up and down.

This text will help you understand what the manuals are talking about. When you need details that isn’t there, you will already be familiar with topics discussed in the README’s and FAQ’s, and should find things sooner.

The HOWTO’s describe dialing IN as well as out. Don’t get frightened by that! Internal modems are the same as external modems, but appears as an additional UART chip on the machine.

Your ISP will allocate you a static IP address, and will advertise that address on their nameservers, so that others will find you. This helps with email, but also with direct access to services on your machine. IE if you are currently on-line and dialed in, others can call you for ftp, web pages, telnet-login and other services.

My ISP allows me to connect using either PPP or SLIP. When I connect, after login and password, they present an additional question ”Protocol?”. Your CHAT and DIP scripts will be different.

4 Modem

You are going to connect to the internet with your modem - yes?

So you want to be sure that your modem works, and that it is working correctly. What can go wrong?

4.1 Modem on wrong irq

The jumpers on the card, tells the card the irq it should use. setserial /dev/modem tells you the irq that the driver is using. These must be the same.

        setserial /dev/modem irq 5

Tells the driver where the modem really is.

I don’t understand how, but with the wrong irq, the serial driver manged to send small pieces of data (hint¡20 bytes) to and from the modem But it was extremely slow, with 7 seconds delay.

4.2 irq conflict

You cannot have two different ISA cards, on the same irq. One of them must either be disabled, or moved to a different irq.

4.3 Modem not spd vhi

The old POSIX, can’t nominate BAUD rates above 38400. This is because of the bits in the termios structure, and the stty documentation.

To get round this, Linux has a hack, where the driver UART runs at 115200 BAUD, but the kernel reports 38400 with spd vhi set. If you set spd hi and 38400, you get 57600 BAUD.

        setserial /dev/modem spd_vhi
        stty 38400 < /dev/modem

To get around this, newer releases of DIP and PPPD have extra Linux intelligence, that does the setserial spd vhi for you. IE you request 115200 in the pppd options, and it makes sure that you get it. But if you asked for 38400, should it ... ?

Beware! If you have an old minicom, dip or pppd this might not be true. If in doubt check!

4.4 Modem at wrong BAUD rate

Well it would run at 115200 if you selected 38400, but you didn’t. Not asking, gives you the ”default”, or ”as currently found” which may be 9600.

4.5 Modem reports CONNECT 115200 - not CONNECT 28800

This is how you know that the (virtual) serial cable is running at spd vhi.

The AT S95=47 (on my modem) tells it to display CONNECT 115200, S95=46 tells it to display CONNECT 28800 (or whatever the line quality is).

You should run it once, to confirm 115200. Normally, you want it to report the actual connect speed (28800), since that can vary.

4.6 Modem prefers rtscts

There isn’t much in it, especially with control-character escaping, but RTS/CTS is preferred over XON/XOFF.

Of course, you have to make sure that it is switched on! With pppd you simply add rtscts to the options list, with slip you can set it in the calling shell script, and with minicom it is set in a menu somewhere.

Since I like RTS/CTS so much, I try to have it set as soon as the system boots, and set it at the start of every script!

        stty crtscts < /dev/modem

4.7 Sharing the modem with a getty

Both programs (pppd and getty) must agree on the locking mechanism and name of the lock file. Note that /dev/modem and /dev/ttyS2 will create two different LOCK files! So be consistent.

/var/lock/LCK..modem

The getty might want to initialise the modem, after pppd has finished, to reset options like auto-answer and number of rings.

4.8 Other possible problems

Most modems have intelligent defaults, but yours might do something strange that needs attention. It may need some AT flags to make it behave. If you have a relevent URL that explains what needed to be done for your favourite modem (that I don’t have), send it every month until I cross-reference it!

Remember, that the people with the REAL answers (that’s not me), are too busy solving problems to write docs. Linux is a user supported OS, so if you had problems with your particular situation, create a WEB page.

4.9 Query UART during session

You can run these whilst a session is active. As long as you read the settings and don’t attempt to change them.

        setserial /dev/modem
        stty < /dev/modem
        stty -a < /dev/modem    # shows rtscts NOT -rtscts

4.10 Test with minicom

Without dialing out, you can look at the modem, and see that it is alive and well.

Minicom will run the setserial option, when it opens the device. It will also send it’s configuration AT command to the modem, which the modem should echo along with OK.

You should then dial out, to a plain old BBS, to see that it works. My ISP provides a BBS on the same number. Just login as guest or whatever it says on the login prompt. This also tests the phone line.

4.11 Dead modem card

Sometimes, my modem card doesn’t work, (immediately after boot), but a power off, wait 10 secs, power on, works just fine!

This is probably a hardware or intermittent design fault, but it is very irritating, especially after starting X11, and several logins.

Now, I make a point of running dial ppp test, as soon as the machine is booted. This just sends ATZ to the modem, which (hopefully) replies with OK. Then I know it’s working.

4.12 Modem card not jumpered to defaults

This is the same, cheap card that doesn;t like being jumpered to anything other than COM3, IRQ 5. I suspect that that is all it was ever tested at in the factory.

A lot of problems went away when I put it back on the defaults, but it may be the OTHER card, that it swapped places with. Either way, it used to fail BADLY on time in four (as in complete machine lockups), now it fails once a week (not locking the machine up).

4.13 Screen Capture with minicom

To write you chat script, or dip script, you need to know what key prompts are displayed by the remote system (is it Login or login?)

In particular, my account gets a ”Protocol:” prompt, where I type ”ppp” or ”slip”. In both cases, sucessfully getting past that point gives me ”Packet Mode Enabled”, but that is just a string that came into their script writer’s head.

To get and keep this, you can either use a pencil, or minicoms capture facility. Save the text to a file, use cut+paste, and re-use the exact same original bytes.

4.14 Reset Defaults with minicom

Default pppd scripts tend to simply accept the modem in the state they found it. Ususally, this is OK, but you may prefer to reset the modem to a known state.

ATZ returns the modem to it’s remembered default state. Most modems have two of these, and they are programmable. IE they get remembered after power off.

You can go through your modems code book, and try out options.

4.15 dial ppp

dial ppp is an extra that you will install later, so that you don’t have to be root, when running pppd (or dip). However it is an option, and before getting confused with one more thing to be wrong, get the basic scripts running as root, then add dial ppp. Read it now, as it helps you set up the basic ppp script. In particular, the diap ppp.sh script and chat tdc file, may help you get PPP running.

IE if running the shell script as root works, running the binary as another user should work or fail.

4.16 /etc/ppp/chat isp

This is the script that initialises the modem, dials the number, logs in with your password, and answers the protocol question.

At every step it has a magic substring, such as ”OK”, ”login:”, ”Password:”. Before sending the next line (word), it checks the return string from the previous action. It is also good practise to get and check for the final message that says ”everything ok from now on it’s ppp”. This is just to confirm that everything is ok. eg ”Packet mode enabled”

You will have to re-write this for your site.

ABORT BUSY
ABORT 'NO CARRIER'
ABORT 'NO DIAL TONE'
REPORT CONNECT
'' ATZ
TIMEOUT 5
OK 'AT Q0 V1 E1 X4 L0 W1 S95=47 M1 I4'
OK 'ATDT 0181 265 2211'
TIMEOUT 45
CONNECT ''
TIMEOUT 10
login: trix
Password: PASSWORD
Protocol: ppp

5 TCP/IP system files

As well as configuring pppd, as a TCP/IP interface, you have to configure TCP/IP itself. This section is common to ethernet and modems. Normally you do this first.

5.1 /etc/HOSTNAME

I keep trying to put a different name in here, so that I can boot trix as raven, or as a different name (selecting a different configuration in /etc/rc.d/rc.*), but sendmail keeps refusing to allow me to do so. In the mean time, I use the ’one-true-name’ of my Intenet connection.

trix.dircon.co.uk

You would of course substitute your hostname here, and everywhere else. Ditto for the other parameters.

5.2 /etc/hosts

You MUST edit this to be YOUR addresses and names. chmod 644, chown root. It must be world readable, but not writable. You should check its contents regularly, as it is a lock (one of many) needed to keep the system secure. Check also the permissions on /etc/.

The first name on a line is the ’proper’ name. Note that trix has two lines, one for the ethernet card, one for the slip link.

The 192.168.xxx.nn numbers are LOCALLY allocated PRIVATE addresses. Basically, you think of a random number instead of 67, and allocate the last number (1,2,3,4 ...). See Issue-1 for details.

The extended names eg ”kestrel.trix.dircon.co.uk”, are not illegal, but they are not valid global internet names. If I had a proper registration, that I what I’d do, but I don’t, so I do so quietly.

# /etc/hosts
# loopback
127.0.0.1       localhost
# lan_67  the ethernet LAN
192.168.67.1            trix.dircon.co.uk    trix.trix.priv trix
192.168.67.2       crow.trix.dircon.co.uk    crow.trix.priv crow
192.168.67.3    kestrel.trix.dircon.co.uk kestrel.trix.priv kestrel
192.168.67.6    pc_cube.trix.dircon.co.uk pc_cube.trix.priv pc_cube
192.168.67.7     pigeon.trix.dircon.co.uk  pigeon.trix.priv pigeon
192.168.67.11     raven.trix.dircon.co.uk   raven.trix.priv raven
# slip link to tdc
193.128.226.67    trix.dircon.co.uk tdc_me
193.128.226.1   tdc_gw.dircon.co.uk tdc_gw
# number placed into /etc/resolv.conf
193.128.224.1           nameserver.dircon.co.uk nameserver
# problems with name server during connection establishment
193.128.224.10          mailhost.dircon.co.uk felix felix.dircon.co.uk
# eof # /etc/hosts.

5.3 /etc/host.conf

Check that it contains the following. Note that hosts comes before bind, this means that your /etc/hosts file ’knows better’ than the network DNS service, and is checked first.

        order hosts, bind
        multi on

Personally I have a bug-ette where DNS does not work properly for the first few seconds until the name server connection ’warms-up’. IE the ISP’s modem server, talks to the central database, and sets up all the links for packets to reach me, during the first 2 seconds, this doesn’t always work.

My workaround, is to put the mailserver address in /etc/hosts, not get it from the DNS. This also prevents delays when the network is down, and helps prevent a spoofing host from feeding me lies.

5.4 /etc/resolv.conf

You MUST edit this to have YOUR domain and nameserver. Use the information that your ISP sent you.

        domain dircon.co.uk
        nameserver 193.128.224.1

This is part of DNS - how you automatically lookup the IP ADDR of ”rtfm.mit.edu”, or any other site not listed in /etc/hosts.

If you connect to different ISP’s at different times, simply move the correct file into place as part of the dip in script.

You can have two nameservers, and can NAME them provided you have entries in /etc/hosts, and order hosts,bind in host.conf

5.5 The confusing parts

Actually that’s it, but it may help to realise that your machine can have several addresses, and they DONT have to appear above.

pppd in particular is very clever and can negociate the IP ADDR of both sides (unless you set a manual override). Ethernet doesn’t do any negociation (unless you request it over RARP), but the IP ADDR comes from the /etc/rc.d/rc.eth0 script.

IE when you run ifconfig (and route), the command line parameter becomes the IP ADDR of that interface, whether it is listed in /etc/hosts or not.

To make life simpler, ifconfig can take a NAME, that it converts to an address, by looking it up in /etc/hosts. pppd also.

To make this easier, I use a standard /etc/hosts on every machine, and add aliases for the interfaces. These aliases appear in the establish interface scripts. eg ”tdc me” and ”tdc gw” are the IP ADDRs of both sides of the slip/pppd link.

I call it ”tdc gw”, but dircon probably have their own name for it.

6 ifconfig route lo eth0 ppp0 sl0

The TCP/IP core, talks to real and virtual devices, to send and receive packets. TCP/IP doesn’t KNOW you have an ethernet card, you have to tell it.

Every TCP/IP machine MUST have the loopback device configured, and it is always 127.0.0.1

Never-the-less, you have to configure it, just the same as you have to configure every device that TCP/IP uses. This is done in /etc/rc.d/rc.inet1 (or other!).

6.1 interface names

• lo – loopback

• eth0 – etherenet

• eth1 – etherenet

• ppp0 – first PPP link

• ppp1 – second PPP link

• sl0 – first SLIP link

• sl1 – second SLIP link

NOTE: eth0 and /dev/eth0 are completely different, but get linked together to be the working device! eth0 is the TCP/IP interface channel, it talks TCP/IP. /dev/eth0 is the card hardware. It talks IRQ, DMA and packets. /dev/eth0 could be controlled, and accessed by any program, ”eth0” can only be accessed by the networking kernel code.

lo is a special interface, that doesn’t have any hardware. Any IP packet (”datagram”) written out to lo, re-appears as a packet-in.

6.2 ethernet card devices

/dev/eth0 is the device driver’s filesystem name, that holds the kernel major and minor device numbers. They correspond to the kernel driver code (probably packaged as a module) which can do occasional tasks like initialising the card, and regular tasks like transmitting and receiving packets.

Ethernet is a protocol beneath the TCP/IP protocol (but has evolved with it). It uses ethernet ”MAC” addresses, not IP addresses.

The ethernet card, automatically filters out traffic that this host is interested in receiving. This reduces CPU load, because the machine never sees packets that would get ignored anyway.

You can switch the card into ”promiscuous” mode, where every packet on the LAN gets through the hardware filter. That is how LAN sniffers work. Also some packets are ”broadcast” to every other card on the LAN, using the broadcast MAC address.

You can also make the card behave as though it has several MAC addresses, when the PC looks like several PC’s

But now that you know that, you can forget it! Thanks to careful design of the various standards and components, it just happens!

6.3 different ethernet card devices

All ethernet cards are much the same, and /dev/eth0 is a common denominator. However NE2000 cards are different from 3COM cards, and Western Digital cards (etc).

The driver that is relevent to you, is selected by you in /etc/conf.modules (or is groped by the kernel at boot time). Then /dev/eth0 is implemented by the loadable module ”ne.o”, which contains it’s own code, but provides the standard Linux interface and drives an NE2000 based card.

All ethernet cards send and receive complete (checksummed) packets, with typically upto 1500 bytes of data. HINT: write your application to use 1024 bytes of data, then allow yourself to add a few bytes to index the contents of your packets, or add your own data headers. Then your data won’t get split into multiple packets, and will have more data than headers.

NOTE: If your etherenet card driver is a module, you must start /sbin/kerneld¿ before it is needed, ie in /etc/rc.d/rc.S and NOT /etc/rc.d/rc.local which is called after /etc/rc.d/rc.inet1

6.4 ppp0, sl0 and /dev/modem

/dev/modem is probably a link to /dev/cua2 or /dev/ttyS2, the serial port. It understands single bytes coming in and out.

IP (and hence TCP/IP), prefers to communicate in complete packets, not bytes, so the SLIP protocol, and sl0 driver, converts between the two. sl0 allows for long delays between bytes, and other serial behavior that TCP/IP doesn’t want to know about.

When you establish a connection, on /dev/modem, you then run the slattach() system call, which ”converts” a serial line into an IP interface. PPP is a protocol above SLIP, which does lots of extra things, but is basically the same.

You probably run dip or pppd to do the slattach for you, but you could write your own ”dip”, or even run the components from the command line (ie slattach(1) is a program that calls slattach(2) for you).

6.5 ifconfig and route

LOOPBACK, SLIP, PPP and ETHERNET interfaces, need to be configured to start and stop them, and to set the running parameters.

You have to tell the interface, using ifconfig, what IP address it is, and how to filter in/out BROADCAST addresses.

You then use the route command, you have to tell the TCP/IP core, that the interface is there, and what LAN it is connected to.

To understand this, look at the ifconfig and route commands for the loopback device.

Each interface needs it’s own script, or pair of commands in a script. With slackware, this is usually /etc/rc.d/rc.inet1.

6.6 the loopback device

If you don’t have ethernet, or dial up running, you can still be a TCP/IP host, by attaching the loopback interface.

Everybody needs the the loopback device, but it still has to be configured in. eg in /etc/rc.d/rc.inet1

        /sbin/ifconfig lo 127.0.0.1
        /sbin/route add -net 127.0.0.0

That’s all there is to it! Maybe other devices take additional parameters, and routing to the default gateway adds a bit, but the rest of it is just shell scripts with lots of extra syntax, that clouds the view of what is actually happening.

Fortunately, the modern ifconfig and route are better at ”guessing” the NETMASK (8 bit host part), and broadcast address (host all 1’s). IE unless you are something strange, you don’t have to specify them or calculate them (saves a lot of shell script lines). See Issue-1 for how to calculate them.

6.7 the ethernet device

        # these two commands bring the eth0 interface to life!
        # other parameters such as broadcast, netmask may be needed.
        # ${VARNAME} is a shell varname that you have set, (in the script)
        # or just put the correct value there.
        # Maybe the name, if it is in /etc/hosts and /etc/networks
         IPADDR=192.168.67.11
        NETWORK=192.168.67.0
        NETMASK=255.255.255.0
         /sbin/ifconfig eth0 ${IPADDR}
         /sbin/route add -net ${NETWORK} netmask ${NETMASK}

Normally, TCP/IP over the ethernet device stays active for the lifetime of the machine. However, you can bring it down with:

          /sbin/ifconfig eth0 down

6.8 the SECOND ethernet device

This will be much the same as for eth0, but for eth1.

You may need to decide which card is which ( eg /etc/modules.conf), and whether your box is a router or gateway between the two LANS, (or simply attached to both).

You can use the same FQHN for both, but usually, one would be called jackdaw.lan 67.trix.dircon.co.uk the other called jackdaw.lan 68.trix.dircon.co.uk

         /sbin/ifconfig eth0 192.168.67.14
         /sbin/route add -net 192.168.67.0 netmask 255.255.255.0
         /sbin/ifconfig eth1 192.168.68.15
         /sbin/route add -net 192.168.68.0 netmask 255.255.255.0

6.9 /etc/rc.d/rc.inet1

This is the file that contains the above commands, on a Slackware system.

Some distributions make it much more complicated by putting the parameters in a second file, and using shell scripts to extract those parameters to build and call the real command line.

Some go one step further to allow individual interfaces to be brought up and down seperately, according to the machine run level. This just adds to the complexity of what is rather simple.

You can use /etc/hosts to hold some of the actual numbers, and use names in the calls to ifconfig and route. This is better, but regerettably there is no established system file to hold the netmasks and broadcast addresses.

6.10 default route

The route command is used for complicated and blindingly obvious routing. Ie as well as telling TCP/IP that lan 99 is acessed through a gateway on lan 68 (not lan 67), you have to tell it that lan 67 is accessed via the lan 67 interface.

route is also called, so that packets with no known route, get send down a default interface, to a specific gateway/router. IE a packet destined for sunsite.unc.edu, goes to the route table and doesn’t know where to go. It isn’t on the LAN, and isn’t on your ISP’s ”local” network. So it goes down the default route, to your ISP’s gateway, which then knows how to send it.

The following command is run by pppd or dip, but if your machine is only connected by ethernet, and you have a local gateway, you include it in rc.inet1

        # GATEWAY="192.128.67.1"
        # /sbin/route add default gw ${GATEWAY} metric 1

6.11 scripts for the PPP device (or DIP)

When you connect to the internet, the ”default” route will be your ISP’s routing gateway. pppd will call route for you.

The calls to ifconfig, route (and slattach as required), are built-in to the pppd binary, or dip binary (and script). You just have to select and specify the correct parameters.

Since you start PPP (or SLIP) using a command script, the commands don’t appear in /etc/rc.d/.

When you start PPP, you (usually) need a chat script to do the dialing, and other configuration files. Look in /etc/ppp/.

6.12 What didn’t happen ...

If it works, great! But if it didn’t, what can you do?

Reread your scripts, and run them manually (there is nothing special about the /etc/rc.d scripts, other than they are run at boot time as root).

You can find out what did happen, using the ifconfig and route commands. Without any parameters, they tell you their current view of the world.

6.13 ifconfig

This lists all configured interfaces, and their current parameters. It also hows how many packets have been send/received by each.

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0
          TX packets:12 errors:0 dropped:0 overruns:0
eth0      Link encap:10Mbps Ethernet  HWaddr 00:C0:DF:45:08:DA
          inet addr:192.168.67.1  Bcast:192.168.67.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0
          TX packets:0 errors:0 dropped:0 overruns:0
          Interrupt:12 Base address:0x300
ppp0      Link encap:Point-Point Protocol
          inet addr:193.128.226.67  P-t-P:193.128.226.1  Mask:255.255.255.0
          UP POINTOPOINT RUNNING  MTU:1500  Metric:1
          RX packets:494 errors:0 dropped:0 overruns:0
          TX packets:498 errors:0 dropped:0 overruns:0

6.14 route

This lists all configured routes, both routes to LAN’s and routes to gateways then beyond.

Kernel routing table
Destination     Gateway         Genmask         Flags MSS    Window Use Iface
tdc_gw.dircon.c *               255.255.255.255 UH    1500   0        0 ppp0
192.168.67.0    *               255.255.255.0   U     1500   0        0 eth0
loopback        *               255.0.0.0       U     3584   0        1 lo
default         tdc_gw.dircon.c *               UG    1500   0        5 ppp0

7 dial ppp

This is the command that calls pppd with the correct chat script, the correct options, and correct UID permission.

It allows a ’plain user’ to bring a ppp link up or down without knowing the root password.

Some people prefer the scripts /usr/sbin/ppp-on and ppp-off. Many apps might try to use them, so you could rewrite them as

        #!/bin/sh
        # ppp-on
        /etc/ppp/dial_ppp tdc
and
        #!/bin/sh
        # ppp-off
        /etc/ppp/dial_ppp cut

This is still ”secure”, as only members of the ”dial ppp” group (or root) can run the dial ppp command.

7.1 /etc/group

Add a new group, called dial ppp. Members are allowed to start and stop pre-configured ppp links. Add the people to the line

        dial_ppp::19:gps,fred,kt

You don’t have to, but now is a good time to add a new group, called ”phone”. Members are allowed to use the modem at any time of the day for sesson type calls (eg minicom). the email ppp link, send faxes, make calls, etc.

dial ppp and phone have nothing to do with each other. /etc/ppp/dial ppp works by refusing non members of the dial ppp group, who don’t have permission to run the binary.

It then gives root uid and exec’s a semi-safe script passing argv through untouched. minicom and fax work by group permission on /dev/modem (or by a script such as this one!).

After editing /etc/group, those users will have to logout/login, for it to take effect.

7.2 /etc/ppp/dial ppp.c

Here is a program. Type it in. Compile it.

/* /etc/ppp/dial_ppp.c */
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
main( int argc, char ** argv, char ** envp )
{
        if( setgid(getegid()) ) perror( "setgid" );
        if( setuid(geteuid()) ) perror( "setuid" );
        execve( "/etc/ppp/dial_ppp.sh", argv, envp );
        perror( argv[0] );
        return errno;
}

7.3 chgrp dial ppp /etc/ppp/dial ppp

This is the only time the group permission is used, provided the chmod is done correctly.

7.4 chown root /etc/ppp/dial ppp

The owner of the file will be the process UID.

7.5 chmod 6750 /etc/ppp/dial ppp

It isn’t 6755, because we only want members of the group to be able to run this command, and that zero stops them.

It can be 4750 or 6750, it makes no difference here.

The suid bit is fragile! If you chgrp or chown the file, you will have to chmod it again. Similarly recompiling needs a new chmod. If there is a Makefile, eg dial ppp.mk, it should do that for you.

You might wish to allow the command to appear in ALL users space, so that they can run it by accident, when browsing for gif converters.

ln -s /etc/ppp/dial ppp /usr/bin

7.6 /etc/ppp/dial ppp.sh

This is the command that gets run. It is a suid shell script so be careful.

Edit the parts that have ”tdc”, that’s the name of the isp. Put your details there.

#!/bin/sh
# /etc/ppp/dial_ppp.sh
#  echo "Running: $0 $* (\$#=$#)"
loc="tdc_me"
rem=""
speed=38400
modem=/dev/modem
OPTIONS="debug lock crtscts modem defaultroute persist"
PATH="/usr/sbin:$PATH"
case "$1"
in
        help)   echo "$0" "$@" "# see /etc/ppp/."
                exit 1
;;      id)     id
;;      cut)    killall pppd
;;      ppp_tdc)
                exec /etc/ppp/ppp_tdc
;;      tdc)
                rem=""
                chat_script=/etc/ppp/chat_tdc
                # rem="tdc_gw" # allow remote to supply ip_addr
                set -x
                pppd connect "chat -v -f $chat_script" \
                        "$modem" $speed $OPTIONS \
                        "$loc:$rem"
;;      list)   echo "tdc # PPP link to dircon" # used by menu
;;      *)      echo "BAD USAGE: $0 $*"
                exit 1
esac

7.7 /etc/ppp/chat tdc

chat does the actual modem initialisation and dialing. This script is alternating, expect ” send ATZ, expect ’OK’ send AT Q0 ...,

I wish chat had a spectial line-string character such as @ that didn’t echo the password into the trace files! You may need chmod 640 /var/log/messages to keep it’s contents private.

ABORT BUSY
ABORT 'NO CARRIER'
ABORT 'NO DIAL TONE'
REPORT CONNECT
'' ATZ
TIMEOUT 5
OK 'AT Q0 V1 E1 X4 L1 W1 S95=47 M1 I4'
OK 'ATDT 0181 265 2211'
TIMEOUT 45
CONNECT ''
TIMEOUT 10
login: trix
Password: password
Protocol: ppp

7.8 /etc/ppp/ip-up

This is another shell script that also gets run as root, as does /etc/ppp/ip-down. I don’t have to fetch email, but running finger @mailhost sooner, wakes it’s sendmail up, and tells me when it’s finished. That’s local.

#!/bin/sh
 mailq
 sleep 2
 sendmail -q
 finger @felix # seems to leave one in queue
 finger @felix # you might use popclient - faster
 echo "$0 $* exit $?" >> /var/log/messages

7.9 /etc/ppp/options

Mine is blank, but you can put the modem baud rate and options in there. Much tidier if you do.

Your ISP’s PPP setup may be different than Dircon’s (”The Direct Connection”). You might have to negociate your secret key challenge, but your ISP should tell you what settings you need.

7.10 persist

This option tells pppd, to redial if the connecton drops. Note that if the chat script fails (eg BUSY), it won’t redial again, if that is a problem, look at diald. Note that this is a new feature, and might not be in your pppd.

7.11 Anything else ?

You have got to have ”tdc me” and tdc gw in /etc/hosts. These are alias names for the IP addresses of the two ends of the ppp link. If you don’t specify them, you can’t complain about what the other end thinks it’s called, or request it to become what you want. You need a menu to call your new command. I used tcl+tk. The lines you have to call are:

        dial_ppp tdc    - to connect to the tdc isp
        dial_ppp cut    - to cut the ppp link

I’m not sure what is the correct way to bring a pppd link down, as I only have one, so I kill all of them. There is probably a better way of recording the pid and naming it later, or ifconfig ppp0 down If you flit between different ISP’s, you will need to change your selected nameserver to avoid timeouts. The ppp script would also switch over the necessary /etc/resolv.conf file. You probably want ppp-2.2.0f or better, if you are running a 1.3 or 2.0 kernel. If you want to use dip instead (for a SLIP link), you may need to edit the scripts so that it isn’t called ”dial ppp”

7.12 ANNOUCE: dial ppp.tgz

dial ppp is a nifty utility, I use it every day! To make dial ppp avaiable to everybody, without requiring them purchase Raven Issue-3, I am creating a .tgz file, and putting it on sunsite.unc.edu as Free software. system/Network/Serial The package is much the same as this article, but may differ in a few details, and it’s easier to use install it, than type it in from scratch! The package will get maintained seperately from this article. In addition to making the software Free, I shall be bundling this article, to help document it, and a rather neat Tcl/tk menu utiltity. Note that the article and menu-utility are ”contributed”, and not Freely modifyable, but I think you’d rather have them than not. IE the dial ppp.html article may NOT be edited, but can be freely distributed as-is. The dial ppp.tcl code can only be customised to your configuration, you can’t sell it, or derive from it. It is ”on-loan” for 1 year. The rest of dial ppp.tgz is Free. Watch this space!

8 SLIP and tdc.dip

Serial Line IP, is the string and glue needed to make a modem behave as an IP device. It converts packaets to and from byte streams, and it adds checksums, that eth0 normally does.

If you have a dedicated (null modem) serial line, there is no dialing to be done, and you simply say (at both ends)

        slattach ...
        ifconfig ...
        route ...

Of course you also need stty and setserial, to preconfigure the UART. With a modem, you also need to do the dialing, select the IP ADDR’s of BOTH ends, and disconnect eventually.

If you want to, you can use minicom to get past the remote hosts login (with the correct BAUD rate ans rtscts), suspend minicom and run the commands manually (slattach, ifconfig, route).

However, after trying that, it is easier to use DIP to do all of that, and write a dip script to drive it.

NOTE: If you use PPP, deep down it uses SLIP, but you use CHAT and pppd instead of dip, so the following script is not for you. In addition, PPP does various link-estabishment protocol discussions, and packet framing. EG PPP can exchange IP ADDRESSES, so that one end can tell the other end what address to take.

PPP also supports other protocols, SLIP only does IP.

8.1 /usr/local/lib/tdc.dip

This file must NOT be world readable, as it contains the password to your Internet account.

DIP scripts are much more frightening than CHAT scripts, but that is because the chat program is very cleverly designed. You could probably use chat with SLIP, but that’s going against tradition.

tdc is the name of my ISP. To make life easier, I use two pseudonyms ’tdc me’ and ’tdc gw’ in /etc/hosts.

Copy and modify the example ’dip’ script and write a shell script that calls it. My calling script wakes up my sendmail, and the ISP’s sendmail.

8.1.1 AT S95=47 -or- AT S95=46

When V34 modems CONNECT, they return the BAUD rate, reporting either the speed of the wire to the computer (DCE), or the speed of the phone wire (DTE). They should be different, the computer talks to the modem, four times faster than the modem can talk down the phone wire.

You should run once with (AT S95=47) so that it shows the DCE speed. This confirms that setserial really did work.

Then modify it to use (AT S95=46), so that the modem reports the CONNECT speed. This varies beteen 28800 26400 24000, depending on luck, and the quality of the line.

8.1.2 V34 isn’t byte by byte

The V34 modem gathers complete ’V34 packets’ from the remote modem at 28.8k baud. It then checksums the packet before passing it to the computer at 115.2k (4 times faster).

IE Bytes are not passed straight through, one at a time, they are collected by the modem into checksum-able clumps. Once that checksum has been validated, you want the data to get to the computer as fast as possible.

These V34 packets have nothing to do with TCP/IP packets, and apart from the effect on the delivery timings, the computer never sees them. The benefit, is that a V34 link is a ”perfect” link, with no corrupted data, but occasional delays, or complete line drop.

Consult your modem manual for options.

8.1.3 Typical throughput 2.8 KPS

For comparison figures, FTP often reports text file transfers at 4 K/s and compressed binaries at 2.5 K/s. It seems that the modem’s compression doesn’t improve on gzip, but helps a lot with text files.

8.2 tdc.dip

If you use this script unattended, you MUST make it robust. I watch it run, and use CTRL-C (TWICE!) if it fails.

NOTE: You can’t have comments on the same line as commands.

You will have to edit this.

----------------------------------------------------------------------
#!/sbin/dip
#       /usr/local/lib/tdc.dip
#######
# label: first word on line
# comments must be on own line # cmd # cmnt causes usage -1
#######
# wait string [ timeout ] # returns OK_ZERO
# if $errlvl == 0 goto OK
# if $errlvl != 0 goto TIMEOUT
#######
# dial tel_string [ TIMEOUT ] # returns OK_ONE
# if $errlvl == 1 goto CONNECTED
# if $errlvl != 1 goto TIMEOUT
# 1 - CONNECT
# 2 - ERROR
# 0 - OK   ## BUT NOT CONNECT 28800/ARQ
#######

        main:
                        echo on
                        print DIP_SCRIPT ........ tdc.dip ........
                        get $local  tdc_me.dircon.co.uk
                        get $remote tdc_gw.dircon.co.uk
                        netmask 255.255.255.0
# speed $speed  # it does the setserial IOCTL # defaults if fails # cmnt
# speed 0       # probably drops DCR ON_LINE -> ON_HOOK #
# speed 9600    # BAUD
# speed 19200   # 19200
# speed 38400   # 38400 -or- setserial /dev/modem spd_hi  for  57600
# speed 38400   # 38400 -or- setserial /dev/modem spd_vhi for 115200
# speed exta    # 19200
# speed extb    # 38400
# speed 115200  # 115200 DIP does spd_vhi # tested #
# speed 115200  # 115200/28800 = 11 kps / 2.8 = 4/1
# throughput calcs (in 1000 or 1024 - close to same)
# 8 bit no parity 1 stop bit + 1 start bit = 10 bits per byte #
# divide 10.1000 # 11.52 / 2.88   approx 4 times modem rate
# divide 10.1024 # 11.25 / 2.8125 k-bytes
# stty /dev/modem - has a POSIX limitation no named baud rate > 38400
# linux uses setserial spd_vhi (internal modem - as fast a bus)
# DIP recognises problem and does the setserial # tested #
# but comments on speed line cause another default to be used!
# AT_OK Modem codes used ------------------------------
# AT Q0 V1 E1 X4 L2 W1 S95=47 M1 I4 \r
# AT Q0 - enable result codes to be issued to the screen.
# V1 - Result codes in verbal format not numeric
# E1 - AT command line echo : on
# X4 - monitor dial tones : all
# L2 - speaker volume : 0,1,2,3 low,default,medium,high
# W1 - error correction message shown in CONNECT line
# S95=47 - CONNECT shows Extended Results. Selector codes
# 01 - CONNECT shows DCE (spd_vhi) or DTE (modem-to-modem)
# 02 - CONNECT shows ARQ - Automatic Repeat request
# 04 - CARRIER XXXX
# 08 - PROTOCOL XXXX

# 32 - COMPRESSION
# 47 = 32 + -- + 08 + 04 + 02 + 01
# 46 = 32 + -- + 08 + 04 + 02 + --
# M1 - Speaker On - until carrier detected
# I4 - OEM-STR(28,800 BPS; V.34; 16FEB95; 1.021a)
get_modem_lock:
print DIP_SCRIPT getting UUCP device LOCK
port modem
speed 115200
expect_AT_OK:
# reset # reset done by init str
# want: detect modem line levels
print DIP_SCRIPT looking for AT_OK modem
# show DCE      send AT Q0 V1 E1 X4 L2 W1 S95=46 M1 \r
# show DTE      send AT Q0 V1 E1 X4 L2 W1 S95=47 M1 \r
send AT Q0 V1 E1 X4 L1 W1 S95=47 M1 I4 \r
wait OK 2
if $errlvl == 0 goto got_a_modem
print DIP_SCRIPT errlvl $errlvl
modem_not_talking_to_me:
print DIP_SCRIPT modem not talking to me
print DIP_SCRIPT or not an AT_OK device
goto error
got_a_modem:
print DIP_SCRIPT Modem online - ok
# OK got a modem
dial_and_connect:
now_connect:
# 0 - OK
# 1 - CONNECT
# 2 - ERROR
print  DIP_SCRIPT dial 0181-265-2211 -  tdc Video Tron V34
                  dial 0181-265-2211
if $errlvl == 1 goto got_connect
print DIP_SCRIPT errlvl $errlvl

print DIP_SCRIPT MODEM <-- CONNECTED --> MODEM
print DIP_SCRIPT Expecting login banner
sleep 2
dial_failed:
print DIP_SCRIPT Dial Failed
goto error
got_connect:
## DIP is not exactly bullet proof
## it was not reading text through properly
## stopeed using if errlvl codes
## so made simply a timeout
## ie hightly visible to operator
## echo on allows view of tty during login
## currently seen CONNECT:
now_login_prompt:
#               wait login: 20
wait ogin: 20
if $errlvl == 0 goto got_login_prompt
print DIP_SCRIPT errlvl $errlvl
fail_no_login_prompt_timeout:
print DIP_SCRIPT TIMEOUT(login)
goto got_login_propmt # POSSIBLY UNSEEN
goto error
got_login_prompt:
------>                 send SLIP_LOGIN\n
now_password_prompt:
#       wait Password: 20
wait ord: 20
if $errlvl == 0 goto got_password_prompt
print DIP_SCRIPT errlvl $errlvl
fail_no_password_prompt_timeout:
print DIP_SCRIPT TIMEOUT(password)
goto got_password_propmt # POSSIBLY UNSEEN
goto error
got_password_prompt:

------>                 send SLIP_PASSWORD\n
# this is an optional switch for SLIP -or- PPP select
#       goto look_for_signs_of_succesful_login
#       goto now_enabled_sign
now_protocol_prompt:
wait Protocol: 20
if $errlvl == 0 goto got_protocol_prompt
print DIP_SCRIPT errlvl $errlvl
# goto error
got_protocol_prompt:
send SLIP\n
look_for_signs_of_succesful_login:
now_enabled_sign:
#       tdc says "Packet mode enabled" # grp fmt || fd=tdc
#       tdc says "Packet mode enabled..." # grp fmt || fd=tdc
wait Packet 20
if $errlvl == 0 goto got_remote_SLIP
print DIP_SCRIPT errlvl $errlvl
got_enabled_sign:
got_remote_SLIP:
print DIP_SCRIPT Logged in to terminal sserver
get $mtu 1500
route_before_slattach:
default
does_this_do_slattach:
mode CSLIP
# get $mtu 296
# 1500 is great for ethernet to backbone
# try 296 for point to point
# try V34 packet sizes +- compression, q depth, etc
connected_to_slip:
print DIP_SCRIPT CONNECTED $locip <---> $rmtip
print DIP_SCRIPT /dev/$port at $speed baud
goto exit_ok
error:
print DIP_SCRIPT errlvl $errlvl

                print DIP_SCRIPT ERROR - CALL ABORTED
                print DIP_SCRIPT /dev/$port at $speed baud
                print DIP_SCRIPT local $local $locip
                print DIP_SCRIPT remote $remote $rmtip
                print DIP_SCRIPT FAILED
                quit
exit_ok:
exit:
                exit
---------------------------------------------------------------------

For some reason dip seems to require TWO CTRL-C’s to exit. As will any script that calls it.

dip does the dialing, and it also does the ifconfig and route’ing.

8.3 /usr/local/bin/dip in

You will need an extra few commands to tickle sendmail to life, and so-on. How you tell your ISP’s mailhost (felix), to start email transmission will vary. Ditto for your self.

If you have smail, you need runq. If you have POP-3 mail you need something else. If you have a working news feed, you will also want to run procnews when the link is up, and maybe a batch-em-up script before the link comes up.

You might also want to connect WITHOUT transferring email, eg if you are booting a second test host, or if the transaction would take to long.

#!/bin/sh
# dip_in #
# see also /usr/local/lib/tdc.dip
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:
mailq   # show mail that is queued to go out
setserial /dev/modem # already done in /etc/rc.d/rc.local
dip /usr/local/lib/tdc.dip 2>&1 | tee -a /tmp/dip_craps_out_$$ # || exit $?
echo
tail -1f /var/adm/messages &    # shows all sorts of info
sleep 2                         # nameserver not debugged
sendmail -q                     # send outgoing mail
finger @felix                   # pull incoming mail
# /usr/local/bin/procnews       # pull news - if working

        finger @felix                   # confirm all received
        mailq                           # usually all sent by now

8.4 /usr/local/bin/dip out

I only have one dip connection. You might have several, and be more selective about which you want to kill.

I don’t like using the ’dummy’ interface to prop-up a non-existent slip interface. I prefer to get ’network unreachable’ errors, which is the correct diagnosis when the SLIP link is switched off. Some apps may need it.

The ifconfig and route commands, substitute the dummy device at the address where the sl0 device was. I don’t know if this is a good idea, or what exactly happens, but it can help. It would effect commands that use the nameservice, such as smail, and find the unreachability of the nameserver as a sign that the actual name (being looked up) is bad.

It also effects daemons that listen/attach to specific interface addresses. eg samba has to be configred for each of its eth0 and sl0 addresses.

Really those two lines should be put into /etc/rc.d/rc.dummy tdc, where the other devices are.

The tdc me parameter gets looked up in /etc/hosts, to be the IP ADDR to use. If your /etc/hosts file is shared between multiple hosts, you may need to rethink it.

        # dip_out #
        dip -k          # for single dip session
        # killall dip   # slightly more drastic option
        PATH=$PATH:/sbin
        ifconfig dummy tdc_me
        route add tdc_me

The ifconfig and route commands in rc.inet1 (rc.eth0), are much the same as those used for the dummy, and called internally by DIP.

/dev/eth0 exists (on SVR4 machines at least), but with route and ifconfig, eth0 eth1 sl0 ppp0 dummy0 are names not filenames or devices (but they are devices!)

sl0 is a TCP/IP device, like eth0, but customised to handle serial lines, where data comes in waves of bytes, not packets.

8.5 Now test it!

You may wish to set up sendmail first, and get a result first time.

As the root user run dip in - it is on your path! You did do chomd 755 on it! I hope you used the dip-example files (not mine), and modified the values for your machine.

Note, these texts have been edited after importing to HTML. Sorry for any errors introduced!

Naturally, this worked first time! To confirm this use ping tdc gw or the name you used as the other end of the SLIP connection.

Now test that DNS is working using ping sunsite.unc.edu, or src.doc.ic.ac.uk (Imperial College, Academic, UK ). Since you didn’t type in those addressess, they must have come from (or via) your nameserver.

Note for UK users: Imperial College has a shocking cd sunsite prefix, but ftp runs a tad faster, it also has many categories in /pub/packages, including TCL/TK for MS-WIN.

Now try:

        mkdir /tmp/ftp
        cd    /tmp/ftp
        ftp sunsite.unc.edu     (or src.doc.ic.ac.uk)
                ftp-login: anonymous
                password: abc@          (your login, be polite)
                cd /pub/Linux/system/Network/info-systems
                pwd
                ls
        # on src.doc.ic.ac.uk try something like
        # /packages/linux/sunsite.unc-mirror first, us ls
                hash                    # show 1 K progress
                mget mosaic*            # takes ages, so make your choice
                mget netscape*          # has problems when remote X11 display
                dip_out

If you have mc-3, you can also run

        mc /tmp/ftp ftp://src.doc.ic.ac.uk/pub/packages

8.5.1 ftp netscape, mosaic, arena, ...

With Slackware, you already have Lynx on the disk, and with Infomagic/sunsite, you already have arena, ready to untar and link. Netscape and Mosaic are NOT on the disks! You have to have Internet access to get them.

Lynx runs on a text tty, arena needs X11 to run. Configuring X11 needs a bit of work to get just right.

If you find FTP is a bit slow, eg to a site connected by modem, or an overloaded host, you can setup sendmail, then ask a kind third party (probably near rtfm.mit.edu) to ftp it for you, and send it uuencoded as email.

uuencode makes a binary file into a text file, expanding it by 40%, but V34 modems will compress SOME of that down again. netscape is 1.6 Mbytes big! which takes 10-20 minutes to download. Getting it from a slow host will take longer, and your local ISP machine SHOULD be faster! To see if your SMTP line is active, use netstat.

9 Kernel devices

If it works, it works. If it doesn’t ...

To make the eth0 device work, the kernel must be able to drive the ethernet card. If you have two, you may need to pick which is which.

Kernel configuration is simple, but very configurable. If you don’t want a driver you exclude it for the compilation. Drivers exist for TCP/IP itself, ne2000 eth cards (and many others), slip, ppp, serial, ...

As well as including or excluding drivers, most drivers can be made as modules. This is a very exciting feature of Linux, that is NOT (yet) available on much more expensive SVR4 boxes. IE you can re-compile a module and reload it, without rebooting.

A module, is a kernel driver, loaded by running the command ”insmod driver.o” before you need it. Of course you must have compiled the driver, and placed it where kerneld will find it. Normally you don’t use ”insmod”, but allow kerneld to load it automatically for you.

9.1 compiling the kernel and modules

If you have an old 1.2.13 kernel you should consider (you don’t have to) upgrading to a recent kernel, eg 2.0.0 or more recent. You will also need the associated modules packages (1.3.69f ++), and the recent ppp-2.2.0f (++) package. Other upgrades may be necessary such as lilo, libc and gcc. See the README’s in the /usr/src/linux tree, look in linux/Documentation/Changes.

When you have these installed, you have to rebuild the kernel deselecting the devices you don’t have, and making modules of the ones you can load from disk.

        cd /usr/src/linux
        make clean
        make menuconfig         # answer all the questions
        make dep
        make install            # or zlilo # see Issue-1
        make modules
        make modules_install
        depmod -a

You have to run depmod -a with the new kernel running (or same version numbers), so two reboots may be necessary.

You have to have /sbin/kerneld somewhere, such as /etc/rc.d/rc.S, so that it is loaded before you attempt to load the eth0 module.

You have to have edited /etc/conf.modules, so that kerneld knows that the ”eth0” module (which is an alias) is really the ne.o module (NE2000), and has parameters such as the IO PORT address. kerneld also loads the ppp0 devices, as well as drivers for (well almost anything). If these don’t have parameters that need setting, ( such as IO PORT) they won’t be listed in /etc/conf.modules. Use lsmod to list those currently loaded.

The modules get placed in /lib/modules/2.0.0/. where kerneld or insmod can find them.

9.2 /sbin/kerneld

The kernel can detect when a call is made to a module that isn’t loaded (or doesn’t exist). If you have started kerneld (before it is needed), that module will get automatically loaded. when it is first accessed.

This has three main advantages; firstly it saves having to type insmod into a script somewhere. Secondly it allows better memory management, a driver isn’t loaded if you don’t need it. Thirdly it allows boot disks to load strange drivers as required. (As long as the driver isn’t on a disk that needs the driver to be readable!)

/sbin/kerneld has to be started, eg in /etc/rc.d/rc.S

9.3 /etc/conf.modules

Here is mine, which tells kerneld to load the NE2000 driver when using eth0. It tells it to use IO ADDR 0x300 (which used to be in /etc/lilo.conf). IRQ-12 gets groped by the driver.

        # This is an example of additional definitions you can put in /etc/conf.modules
        # Note that modprobe has some default aliases built in ("modprobe -c").
        # The built-in aliases will be overridden by any definitions in this file.
        alias eth0 ne
        options ne io=0x300
        # alias eth1 de620
        # options lp irq=7

Other modules, such as isofs.o (a filesystem driver), don’t need to be listed here, because they don’t need extra parameters, or aliases.

10 /etc/services and other files

After configuring the other files, you probably don’t need to configure these. They have to be correct, otherwise things won’t work, but the standard configurations (from recent distributions) are all pre-configured.

10.1 /etc/services

This lists the TCP and UDP port numbers used by different services. Sendmail for example, will be listening on port 25 because it requested the ”smtp” port by name.

10.2 /etc/inetd

You might have to edit this to switch between daemons that are always running, and daemons that get started (by inetd) on the first request over the network.

If you start the daemon, you will have to tell inetd, as well as actually starting the daemon yourself (eg in /etc/rc.d/*). I don’t know why inetd can’t detect an application waiting for connections, and reconfiguring itself from that.

/etc/inetd also contains ”wrappers”, that can be used to log every connect to your box, and authenticate who the remote caller is.

10.3 Others

After that, individual services have their own permission control and configuration files, such as /etc/hosts.equiv, /etc/ftpaccess, /etc/hosts.deny, /usr/local/samba/smb.conf, ...

There are several of these, but you probably don’t have to do anthing just yet, as the defaults are usually reasonable. At least not until you notice that that particular service isn’t running as you expected.

¡-! lines starting ’ fail sgml2text -¿

11 networking with/out passwords

If the calling user and host is KNOWN why not allow remote access without passwords? The paranoid should read this because not doing it doesn’t stop it happening.

11.1 /home/gps/.rhosts # or any users HOME

        # this is pigeon:/home/gps/.rhosts
        trix.dircon.co.uk root
        trix.dircon.co.uk gps

rlogin, rsh and rcp use the same mechanism, hence the same files. If the requesting host or user, isn’t in .rhosts, rlogin presumes itself to be interactive, and offers a password prompt, whereas rcp simply fails (if not configured).

Personally, I believe that this mechanism is SAFER, because once you have established the basic user-login identity, you can permit them to do certain functions without telling them the passwords of other systems. They don’t need a weekly newsletter, they don’t write it down anywhere, they don’t shout it out across the room, and they don’t forget it. Service down is itself a problem.

The original login can have a nice menu so that the user may not even be aware of what is happening.

11.2 rlogin pigeon −lgps

Gives you a login on pigeon. Just like telnet, but without passwords.

If you do require a password, rlogin asks for it, so it is usually a safe option in scripts.

rsh however fails if you need a password.

11.3 rsh pigeon -l gps mount /cdrom

Run the remote shell on pigeon as the user login gps with the commands to mount the cdrom (with ”defaults,user” in /etc/fstab). You can do this as a safer user, not root.

You should still set the permission on the device for the eject command.

If rlogin needs a password, it asks for it, but rsh just fails.

There may be a bug, where the remote command exits, and the remaining TCP/IP buffers get truncated. If so, you will need to sleep to wait for the buffers to get sent.

Some older systems, may put a welcome banner at the top of the rsh return text, in which case you have to script around it.

11.4 rcp gps@pigeon:/cdrom/X11/xapps/graphics/xearth-0.92.tar.gz /tmp/pkgs cd

This copies the file from pigeon to here, but the command is flexible.

rcp scans its arguments, and can copy between several different hosts, as different users. It can transfer multiple files to a directory, and can recursively copy a subdirectory. Beware of permissions (eg mtime of file) and transferring symbolic links, which become files not links.

11.5 slighty safer rcp rsh

If you set the SHELL parameter in the remote /etc/password, that program will be used instead of /bin/sh. That program can be a #!/bin/sh shell script or a perl, tcl or other shell script, or even a compiled program.

This replacement program would not then simply run the requested command. Instead it would look at the command line, and decide if it is an allowed command, then run it. This would make it that much harder for a hacker to do anything interesting, and still allow you to do exactly what your application wants.

If the requested command is rcp, and you wish to allow that, simply exec rcp.

11.6 slighty less stable than normal

The rcp program, calls rcp at the remote end, and they have their own protocol to pass multiple parameters around, and a result code back. It can do this over a single TCP/IP stream, using it’s own protocol to distinguish commands, data and return codes. rsh, however uses a single TCP/IP stream, and expects a program like /bin/sh on the other end. Since /bin/sh has no knowledge of rcp/rsh, there is no built-in method of returning the exit code of the the called shell. This means that the result code from rsh (exit 0 means ok, else errno) only tells you that rsh suceeded in making the call, or failed to make the call.

If your called command line fails, its exit code is dropped, and you get ’0’ back from rsh - because the call succeeded. This is a real headache, as you will have to write your own workaround to get the result. Not a problem for occasional commands run manually.

11.7 security areas

-NOTE- ’rsh’ is the ’remote-shell’ command. The ’restricted-shell’ command coincidentally has the same name. –

11.7.1 Host name used in .rhosts

The main security feature in .rhosts is the name of the calling host, written in $HOME/.rhosts. This must match the FIRST name on the line in /etc/hosts (unless you are using NIS).

The /etc/hosts file must be secure (not writable, but world readable). Also check the permissions on the /etc/ and / directories.

The calling host must be secure. The calling LAN must be secure. The local cracker’s route in is to plug a Linux box on the LAN, wait for the secure host to go off-line for a few seconds, and pretend to be it for long enough to run a single command.

Basically don’t allow it as root, only allow it as a special user, who has a special shell, maybe a chroot’ed /etc/passwd, and use an ’at’ or cron job to process results before/after connections.

However for home LAN’s they are nice!

11.7.2 UN-sophisticated command lines

        echo '<user@host>' >> $HOME/tmp/email_list_7

The ’¡’ and ’¿’ won’t confuse the local shell, because they are quoted.

However, when using rsh, the command line has be re-quoted to get through multiple-evaluation stages. It’s easiest to avoid the NEED for quoting anywhere, write a script that contains the ’ ” ¡ & or anything else that would need special quoting.

You could even put the command into a script, rcp the script over, run it and delete it.

11.8 tar -zxf gps@pigeon:/cdrom/X11/xapps/graphics/xearth-0.92.tar.gz

This does not work, but almost does, (it is supposed to). It writes a message in /var/adm/messages

12 Networking X11

This allows you to run X11 programs remotely, but still have the display shown locally.

The ”application server” can be a different CPU type from the X11 terminal, as long as they both agree on the X11 protocol, and things like fonts.

The X11 terminal can be a 4 MB 386, without much of a disk, and it will still work, however most people use it as a way of working on multiple machines, from one workstation.

Netscape didn’t work with this, but mosaic did. Probably fixed since then.

12.1 The X11 terminal is the server

When people connect 100 terminals to a central machine, they usually call the central box the ”server” and the terminals ”clients”.

However, with X11, the service is not what the central box can offer. The service is ”X11” (the display and keyboard). When you run a program on the central host, it initialises and looks for an X11 display. It looks at $DISPLAY, and calls the X11-terminal asking for the X11-display service.

IE the X11-terminal is the X11 server, and the program is running on the client.

To prevent anyone using you terminal display and keyboard, your X11-terminal chooses who it will accept connections from, using either xhost or xauth.

12.2 xhost pigeon

This command tell the RUNNING X11 server to allow any user on pigeon to access this X11 desktop.

You need it, so that when you start programs on pigeon, the window will be displayed here. IE pigeon can use your display.

This is a security hole, because ANY user on pigeeon can access your desktop, including grabbing you keyboard hence reading your passwords. If this is a problem, look at xauth. However, on isolated LAN’s with only one user on pigeon, you decide.

Pigeon must be in the local /etc/hosts file, and the authority expires when the X11 server exits (XF86 SVGA).

12.3 TODO - xauth

xhost is insecure, because ANY user at pigeon can get access to your DISPLAY. xauth is supposed to be better, but it’s not a simple to setup. TCL/TK won’t accept xhost, and demands xauth, so maybe I’ll have a go one day.

12.4 export DISPLAY=trix:0.0 ; xterm &

First telnet to pigeon, then run these commands.

It selects the X11 display where xterm’s window will be drawn. xterm is really running on pigeon, but it appears to be local.

Because you exported DISPLAY, any programs started from that xterm will also appear on trix, but be running on pigeon.

13 TCP/IP apps

13.1 telnet

Telnet gives you a tty connection to a remote host, where you get the login prompt.

It isn’t a VDU emulator, you want to set the same TERM on the remote host as is infront of you. The remote host must have the correct terminfo configuration!

Telnet has two modes, key-by-key, and line buffer mode. This is like the kernel, and usually gets switched at the correct time, to the correct mode.

Telnet adds a CRTL-] key, to interrupt and then quit the connection.

13.1.1 telnet host port

Telnet can also connect to any remote port, (even if it doesn’t make sense to do so). This enables you to manually drive a network connection that is ususally automated.

For example as a substitute for sendmail, you can connect to a remote smtp server using:

        telnet remote smtp

but then you will be talking to the remote hosts SMTP daemon (sendmail), and you will have to talk it’s language.

13.2 ftp src.doc.ic.ac.uk

ftp is how you connect to a remote machine and transfer files.

Most servers allow you to connect as the user ’anonymous’ with password: user@host.domain or password: user@

If you select anonymous login, you get access to a sub-zone of the remote machine. If you connect as an actual user (with the actual password), you get access to the full machine (at least those files that that user can read or write).

A common feature of anonymous ftp, is that access is limited to files within /home/ftp. Your system is probably already configured as an anonymous server. You can see what you look like with ftp localhost (not much fun, as there aren’t any interesting files in /home/ftp).

Once you have done an ftp connect/login, you have a command line interface where you can type simple commands. The actual transfers use a second connection.

13.2.1 ˜ /.netrc

To automate the login process, you can create $HOME/.netrc,

        www.users.dircon.co.uk  login trix
        beyond.malmo.lth.se  login gps
        default login anonymous password gps@

ftp -n remote, will not read .netrc

13.2.2 cd /packages/linux

some ftp commands look (a bit) like unix commands. lcd does a local cd

13.2.3 ls -rt

This lists the files in reverse time order. You can also specify a wild-card which makes slow connections usable.

13.2.4 binary

This tells ftp to request binary mode transfers for all files. Most servers do this anyway, but if you forget, the .tgz file will contain errors.

13.2.5 hash

This command is VITAL. It tells ftp to print a ’#’ for every 1K transfered. It tells you that ftp and TCP/IP are alive and making progress,

13.2.6 get README.NOW

This fetches the remote file to the current directory. The file’s date will be set to today (mc corrects for this if it can).

13.2.7 mget pkg*26*

This is a multi-get (even if only one file matches!), every matching filename will be offered, and you reply ’y’.

The wildcard you use may pick up files you don’t want (such as pkg-0.7.26-a.out.tgz), so you say ’n’.

ftp runs at about 0.5 to 5 Kps over V34 modem. Binaries usually transfer at line speed, ie 2.5 Kps. A 4 megabyte file takes half an hour -if- everything runs quickly. Throughput depends on every component in the chain.

13.3 mc ftp://src.doc.ic.ac.uk/packages/linux/sunsite.unc-mirror

mc, mosaic, netscape and others make excellent ftp browsers.

mc version 3 has ftp browsing added (with a similar syntax). If you setup $HOME/.netrc it will know to login as anonymous. It also keeps fetched files (eg after pressing the F3 key) so that a subsequent F5-COPY is quick. It has a few bugs, but I guess the authors know that.

13.4 netscape ftp://src.doc.ic.ac.uk/packages/linux/sunsite.unc-mirror

Netscape can make a remote ftp site, as convenient as a WEB site, (and vice verse). Ususally, netscape known when to display a file, and when to download it to disk, but pressing SHIFT when clicking on a URL may help.

13.5 98% of 3344 K (Stalled)

Nightmare! If your sessions stalls, eg the remote host goes off-line, you have 15 minutes to do something, before Netscape gives up. DO NOT PRESS STOP.

If you press STOP, or if Netscape decides to stop, the dialog box will be removed from the screen, and the file (98% there) will be deleted from the disk. Instead, try the following:

        cd ~/9607/0731  # netscape is saving the file here
        mkdir bad
        cd bad
        ls ..
        ln ../big_file.tgz .

Then when Netscape deletes the file, it will only unlink the name it created, the second link will still be there, with the 98% still in it.

13.6 restart 3287040

Now the remote host comes back, or you find the EXACT SAME file on a different server (it must be an FTP server, not a WWW server).

        ls -l big_file.tgz      # write down the number of bytes 3287040
        ftp remote host
        binary
        hash
        cd wherever
        ls                      # ie as usual
        restart 3287040
        get big_file.tgz

FTP will now start a new transfer, but add it to the existing file, and restarting at the 3287040 byte point. Which is what you want.

13.7 sendmail

Sendmail implements SMTP for incoming email, and outgoing also.

To configure it, see the sendmail section. To use it, install PINE or ELM (or an X11 mail-user-agent MUA of your choice).

13.8 NFS

Network file system, is how one unix box exports it’s files to another unix box (or a box that implements the NFS protocol).

It is mostly configured with /etc/exports, but both servers must have the correct daemons running.

13.9 ident

You don’t run this manually, but when you contact a remote host, it will usually call you back, and ask your machine who you are, using the ident protocol.

This usually just confirms who you logged in as, using the TCP/IP stream that you connected with as the selector.

DOS machines may return the name ”unknown”, as they don’t have a login system or username. Similarly proxy hosts may return equally vague informations.

ident can lie, it is after all a program running on your machine, you can substitute and code there. However it is very useful when the host machine isn’t a personal workstation, but a well administered server. rcp uses identp to help identify the caller.

If you run a web-server, you can log the identity of every calling user. You will see that many callers are ”unknown” or ”-”, which suggests that they are calling from DOS boxes, or proxy machines.

This makes it very easy to then call up ”talk”, and have a chat with whoever is calling your machine, or not if it is ”unknown”.

13.10 http

”hyper-text-transfer-protocol” is the protocol used by web servers, to transfer control information, text files, binary files and .html files. It is usually associated with port-80.

14 Sendmail

14.1 /etc/sendmail.cf - the monster

/etc/sendmail.cf is the configuration file that talls sendmail how to work. It is (arguably) not human readable. However there are m4 macros that make it easy to configure. You generate /etc/sendmail.cf from /etc/sendmail.mc

14.2 /etc/sendmail.mc - edit this

        divert(-1)
        include(`../m4/cf.m4')
        VERSIONID(`/etc/sendmail.mc - gets most people going')
        Cwlocalhost trix.trix.priv trix.dircon.co.uk
        define(`SMART_HOST', mailhost.dircon.co.uk )
        OSTYPE(linux)
        FEATURE(nouucp)
        MAILER(local)
        MAILER(smtp)
        FEATURE(nodns)

Note the relative path in include(‘../m4/cf.m4’), that hints which directory you should be in when running m4.

Don’t forget to substitute your names, in place of trix (etc). All outgoing email will be routed via your SMART HOST (preferably not mine, unless you want me kicked off).

14.3 Installing /etc/sendmail.mc –¿ /etc/sendmail.cf

        cd /usr/src/sendmail/cf         # so that m4 finds the other files
        m4 < /etc/sendmail.mc > /etc/sendmail.cf

This generates /etc/sendmail.cf from the above /etc/sendmail.mc file. After that the .mc file isn’t used, but /etc/is a sensible place for it.

If that worked, read-on, restart sendmail and test it (job done). You must restart sendmail for every change to the .cf file.

14.4 What is Sendmail?

Sendmail is all about receiving and transmitting email between machines. It delivers your mail into /usr/spool/mail/$LOGNAME, where you can read it.

You compose an EMAIL using pine or elm. It calls sendmail to send it. Sendmail accepts the message and either delevers it immediately or adds it to the queue to be processed.

To send a message, sendmail (usually) looks up the name of the destination host using the nameserver. The nameserver (after asking another nameserver) replies with the MX record for that host.

The MX record, (mail-exchange), is a ’top-two’ list of IP addresses, of the destination host and it’s backup mail exchanger. Sendmail than tries the hosts in that order, to find the most direct path, or the nearest intermediary.

With the above .mc file, sendmail sends it to the smart-host ie your ISP’s mailhost, and lets it do most of the work.

Sendmail calls that host in TCP/IP port 25, and expects it to talk SMTP.

14.5 Sample SMTP session - how it works

This is what happens behind the scenes, normally you use PINE or ELM to call sendmail to do this. To do this to localhost, you need sendmail installed to accept the call, but if you contact a remote host, you only need telnet.

If you ever get stuck and cannot SEND mail, you can do this manually. Use cut and paste to save some editing mistakes.

        # blank lines added for clarity
        # and markers in the margin
        gps@trix:~$ telnet localhost smtp
        Trying 127.0.0.1...
        Connected to localhost.
        Escape character is '^]'.
        220-trix.dircon.co.uk Sendmail 8.6.12/8.6.12 ready at Mon, 4 Mar 1996 00:18:21 GMT
        220 ESMTP spoken here
 -->    HELO
        250 trix.dircon.co.uk Hello gps@localhost [127.0.0.1], pleased to meet you
 -->    VRFY gps
        250 Graham Swallow <gps@trix.dircon.co.uk>
 -->    MAIL FROM:<gps@trix.dicon.co.uk>
        250 <gps@trix.dicon.co.uk>... Sender ok
 -->    RCPT TO:gps
        250 gps... Recipient ok
 -->    DATA
        354 Enter mail, end with "." on a line by itself

 -->    To: john
   |    From: Graham
   |    Subject: Junk Mail
   |    X-extra: Extra lines in the header for those who want them
   |    don't you just love it?
   |    G
 -->    .
        250 CAA00694 Message accepted for delivery
 -->    QUIT
        221 trix.dircon.co.uk closing connection
        Connection closed by foreign host.
        gps@trix:~$

Notice the strange To: and From: lines in the text part of the message! This is part of how spoofing works.

When your ISP or another internet user (directly) sends you an email, they connect to TCP/IP port 25 on your host, and expect it to talk SMTP. Sendmail is also the program that implements SMTP, and handles incomong email.

Sendmail also does various tricks like aliases, lists of users and delivering email to your scripts, for automatic processing. It also talks to machines that use different systems (uucp transports or different message formats).

14.6 Sendmail - requires ...

Get dial up Internet working (done). Select Sendmail (not Smail) from the N disks (Slackware). Ensure that your /etc/HOSTNAME is the proper email name, and that /etc/hosts is correct, with the full hostname first on the line after the actual address. Create your user. Check that your names get resolved (/etc/resolv.conf), so that ping www.InfoMagic.com works. (Without the address in /etc/hosts, it must have come from the nameserver).

14.7 Slackware - /etc/sendmail.cf

It is better to generate your own sendmail.cf file, but slackware comes with two prepared .cf files, that simply drop-in. However, they might not be right for you. When you install sendmail from the N disks, the following script gets run. NOTE: this will overwrite your own /etc/sendmail.cf file, but that’s easily replaced.

        cd /var/adm/setup
        ./setup.sendmail

Select option 1, ie the one that uses a nameserver. This tell sendmail to use MX (mail exchange) records, ie dns.

When I did this, I had problems when not connected to the Internet. Basically, sendmail requested the MX record for that host, but got nothing (no route to nameserver). Sendmail then immediately rejected my email (instead of putting it in a queue for later).

Even worse, sendmail wants to use DNS to confirm its own address. Local traffic won’t get sent until the modem comes back online!

I fixed this for me, by selecting nodns (in my own sendmail.mc) and by specifying a default route. Now all my email goes out via felix (mailhost.dircon.co.uk), but incoming mail can be accepted direct.

14.8 testing a new /etc/sendmail.cf

Restart sendmail and send a few messages. Start Internet (dip in or dial ppp tdc) and test that you can send and receive to/from your ISP.

tail -f /var/adm/messages &;    # start this once
killall sendmail        # ensure not using old .cf file!
ps -xa                  # none running
sendmail -bd -q 15m     # process queue every 15 minutes
telnet localhost smtp   # what your machine looks like HELO QUIT
echo help | sendmail user3      # yourself
mailq                           # view list in queue
sendmail -q                     # process queue now
pine                            # read mail in other window
echo help | sendmail user                       # yourself
echo help | sendmail user@hostname.domain       # yourself
dial_ppp tdc                    # connect to Internet -or-
dip_in                          # connect to Internet
ping isp-mailhost.domain        # your ISP's mailhost
# the long address is a special format that ROUTES
# that email to yourself via your service provider
# the 'quotes' make < and > meaningless to the shell
echo help | sendmail '<isp-mailhost.domain:user@hostname.domain>'
# watch /var/adm/messages # press CTRL-C to interrupt tail -f filename
ping news-digests.mit.edu       # we're both online
echo help | sendmail majordomo@news-digests.mit.edu
mailq

sendmail -q                     #  send it NOW
mailq
# DONE #

Because Slackware selected the dns sendmail.cf, and didn’t defined any SMART PATH, sendmail will attempt to call news-digests.mit.edu DIRECTLY. Sendmail uses DNS to get the most direct route.

If the modem is DOWN, your dns link will be down. Sendmail won’t be happy. It may decide that it can’t queue this for later, and bounce it back at you immediately.

If you remain on-line, mit.edu will reply directly to you. If you go off-line, your reply will be sent to your ’backup’ mailhost. IE your ISP’s mailhost, which will store it for 6 weeks or whatever.

You may need to run a command to tell your isp-mailhost you want to download now. I use finger @mailhost, your ISP will have told you what to do.

If you have POP instead of plain SMTP, your story may be different.

14.9 Sendmail Documentation

Remember that mc-3.1 can read groff formatted documents using the F3 key, without it you would need groff -Tascii -me op.me

DOCS
/usr/src/sendmail/cf/README - text lists many macros and names
/usr/src/sendmail/cf/README.linux - the two Slackware .mc files
/usr/src/sendmail/README.linux - the two Slackware .mc (different)
/usr/doc/sendmail/op/op.me - operators manual
/usr/doc/sendmail/FAQ -
-->    /usr/doc/sendmail/READ_ME - main README - lists most other docs
DEMOS
/usr/src/sendmail/cf/cf/tcpproto.mc
MAN PAGES and apps
mailaddr(7)
procmail
sendmail
deliver
(Write your list here)
USENET
comp.mail.sendmail

15 Sendmail - more to play with

If sendmail now works, fine. But if you want to do some experimenting, you may want a few scripts to help you, ie a script that sends a test message, just by running it.

You might also prefer to use an /etc/sendmail.mc file that has more comments in it, but still want a condensed version, with just the content in it.

Here are a few scripts that may help. I put them in /home/gps/bin, which is on may $PATH. Don’t forget to chmod 755 script.

15.1 no blank lines - (chmod 755 /usr/local/bin/no blank lines)

#!/bin/sh
# here blank lines includes TAB or SP
# elsewhere they indicate non-blank lines!
grep -v '^[      ]*$'
# eof # no_blank_lines

This script removes all blank lines. It reads from it’s STDIN and writes to STDOUT.

15.2 no comments - a shell script

#!/bin/sh
# [<TAB><SP>] - can be hard to see and read
# provides a very simplistic definition of 'comment'
# works with terminfo source and lots else
# '#' must be at the start of a line, or preceded by BLANK(s)
# messes up line numbers
# no protection of # 'eg # in quotes'
# [      ] is TAB SPACE in square brackets.
grep -v '^#' "$@" | sed 's,[     ][      ]*#.*,,'
# eof # no_comments #

This script removes comments. A comment must have at least one space or tab before the # character, or have the # at the start of the line.

15.3 no trail sp - a shell script

#!/bin/sh

        # removes spaces from the end of lines
        # [<TAB><SP>] - can be hard to see and read
        sed s,[  ]*$,,
<sect1> full_path_name - a shell script to get a full path name
<p>
<verb>
        #!/bin/sh
        [ $# = 1 ] || exit 1
        if expr match "$1" /  >/dev/null
        then
                echo "$1"       # already absolute
        else
                echo `pwd`/"$1"
        fi
        # eof # full_path_name #

This script outputs an absolute pathname, by prefixing it with ‘pwd‘ (unless it already is an absolute pathname). This then enables you to cd elsewhere.

15.4 HINT: Creating documents with CUT and PASTE

If you manually type in these examples (or others), be careful to get them right. You can save yourself a bit of work by using CUT and PASTE, but do be careful that special characters, such as TAB haven’t been converted to spaces!

With X11, highlight the text selection, by dragging with the left button over the text. Then use the RIGHT mouse button to paste it into a different window.

If the other window is xterm (eg running vi), remember to press SHIFT to tell xterm tu feed it via the keyboard channel, and also make sure that vi (or whatever) is in INSERT mode, otherwise the characters will be seen as key-commands, not typed text! (vi has a command for almost every letter!)

gpm does a similar job on text consoles. So you can use lynx, or copy from the .txt files. You can switch consoles and paste the text there.

If you don’t like VI, you can try pico the editor from the PINE package. It is very simple, and looks a bit strange, outside of PINE, but it works.

When pasting into vi, you might need to switch auto-indent off, otherwise it may staircase, adding the spaces at the start of each line to the next indent! : set noai

15.5 send 11 - a quick test utility

#!/bin/sh
# send a test email to the command line parameter
# used to test sendmail
addr="${1:-user@host.domain}" # default or override
sendmail -t <<-EOT-1 # eof also stops a HERE document zone
To: $addr
Subject: test mail addressed to $addr
        This is a test mail to see what happens
        when mail is sent to the address:
                 $addr
        using sendmail -t
        following dot may end the email
.
        or not!
EOT-1
echo "$0: sendmail $addr returned exit code $?"
# eof # send_11 #

This script shows you how to send an email automatically. The destination has a default, but can be specified on the command line. see man sh(1) for more explanation.

15.6 mc to cf - a shell script to install an mc file

#!/bin/sh
# converts .mc to .cf
# removes comments and keeps a minimised copy
# uses other scripts listed here
[ $# = 1 ] || exit 1
file=`full_path_name $1`
cd /usr/src/sendmail/cf         # normal location of file
no_comments $file       \
| no_trail_sp           \
| no_blank_lines        \
| tee $file.no_com      \
| m4                    \
> /etc/sendmail.cf

# some pople use:  mv /tmp/sendmail.cf /etc/sendmail.cf
# incase of fail half way through
killall sendmail        # still using old .cf file ?
mailq                   # view queue before starting
sendmail -bd -q 15m

Now you can make your sendmail.mc file executable. Running it installs it as the new configuration. That makes it easy to edit and test (you must be root to do this). Now your sendmail.mc file might look like:

15.7 sendmail.mc - with comments looks like:

So now you can write a sendmail.mc file, that contains comments, and even stray spaces at the end of the line. See also /usr/src/sendmail.

#!/usr/local/sbin/mc_to_cf
# the above line makes this an executable script
# with chmod 755 of course
# gets pre-processed by me then m4 to the .cf file
# divert(-1) is an m4 thing
divert(-1)
# include the sendmail V8 MACRO framework
include(`../m4/cf.m4')
# tell the reader where this came from
# which host it is intended for
VERSIONID(`my_file.mc - ravens config circa 96 ')
# list of hostnames that sendmail will accept email for
Cwlocalhost trix.trix.org trix.dircon.co.uk
# declare gateway or ISP machine
define(`SMART_HOST', mailhost.dircon.co.uk )
# Linux file layout FSSTND
OSTYPE(linux)
# 'uucp' is an overloaded term, often running over smtp!
# 'uucp' predates TCP/IP (it is an rs232 modem dialup scheme)
FEATURE(nouucp)

        # included anyway!
        MAILER(local)
        # use big cloud networking, smtp protocol
        MAILER(smtp)
        # dns seems like a good idea - BUT -
        FEATURE(nodns)

15.8 /usr/src/sendmail/cf

Compare this mail-conf-script with those in /usr/src/sendmail/cf. They are all much the same, with hardware names to make Linux users feel at home, or ’hp’ users get the ’correct’ pathnames. If you plough through them you may find interesting cases that handle BITNET to Internet to UUCP gateways, or categories of gateway types, and hosts within a gateway’s ’domain’ (an ambiguous word).

What are those configurations in /usr/src/sendmail/cf/? What shape networks are they handling?

15.9 ls -l /var/spool/mail/postmaster

Check this file rgularly, sendmail sends error rports here. Eg if someone send mail to wrong name@host.domain, they get a fail message, postmaster gets a copy of the original.

15.10 Sendmail site configurations

Remember that email gateways are different from TCP/IP gateways, though one machine might do both jobs. TCP/IP gateways, are really routers that direct IP packet traffic. EMAIL gateways do much the same, but with email messages, not TCP/IP packets.

The email gateway for a domain, handles incoming traffic bound for all local machines.

If the sender reaches the destination machine (wth TCP/IP:SMTP), the gateway is not used. Email within the domain may be direct, or through the gateway. The gateway expects to receive email addressed to a LIST of hosts, or domains.

A gateway can have a simple name, and route mail to machines in other LAN’s, eg user@company.com gets routed to ¡user@host.lan.building.town,country.company.com¿. Then that might be send to a gateway towards that domain. ie CInorder to reach user@host.lan 90.bodmin.uk.company.com, the email gets sent via user@pigeon.demon.co.uk

That routing could be a chain-list of addresses, or it could simply be the nearest gateway to user that would know the proper address.

If you only have a leaf PC connected to an Internet provider, you are a leaf attached to an intelligent gateway - your ISP’s mailhost.

15.11 Smart Host = LAN gateway

A LAN of PC’s can have peep-to-peer email. The sender has to know which host a user is on (From: user@crow.domain), or the network can be designed so that the sender replies to: user@domain, in which case the email is sent to the server/gateway, which looks up user in a databse to find that the next hop is to (or via) crow.domain.

If the destination address is outside of the LAN, it will probably have to go through a gateway (the gateway), so if the PC can’t reach the host directly it simply sends it to the gateway, whhich then has the responsibility of routing it.

15.12 Smart Host = WAN gateway (ISP)

If you have a single PC connected to the Internet via dial up, all your TCP/IP packets go through your ISP’s LAN (possibly 100 M ethernet not 10 M ethernet).

Your ISP will have an internal LAN that connects the various TCP/IP routers, name servers, terminal servers, and service hosts (mailhost, ftp.hosts, www.hosts). It is likely that your ISP have several LAN’s all threaded together.

If your packet traffic goes worldwide (as it does), there will be a spiders web of interconnections between ISP providers, LANS at the remote ISP and LANS at the far end.

Each connection requires that the packet be completely read in (eg 1.5K bytes) by the router, and then re-transmitted on the other side of the router (from wire to router to wire). Transmission on a wire shared by several hosts (eg ethernet not point-to-point), may require a wait for free air-time to become available. This is a tiny delay, but can lead to backlogs, where several packets are waiting in a queue to be transmitted next. The ISP side of your modem is a primary example of this, with ftp packets coming from several directions waiting to be transmitted at V34 speeds.

When all of the UK wants to access all of the US, the air-time providers like having a little capacity overload - before they have to swich on extra circuits that they rent from their providers. Statistically backlogs are few and far between - but how much so?

15.13 ISP smarthost is faster

If your ISP has a quality machine, it will be much faster to transfer email between it and you (data throughput), though there will be a total delay of delivery that takes twice as long. If your host completes sooner, it releases memory sooner, reducing swap, makeing your server faster.

If the remote host is overdriven, data throughput may be slow or even break. It makes more sense to let your ISP have that worry. It may even tolerate remote ISP’s going offline for a while.

If your smart host has a quality configuration, it will be able to bridge with other TYPES of networks, and know of routes through gateways (or their smart hosts). That saves you a lot of hassle, you just have to get the compuserve address right, or the JANET address correct, your ISP does the work.

15.14 ISP smarthost is slower

This is great at 3am in 1996, but at 11:30 in 1998 the picture may be totally different. If your mailhost.isp.com is getting old, overdriven, etc you may not be happy with the service.

Similarly, what happens tomorrow and all next week, when the ISP’s mailhost goes AWOL? Presumably, they struggle to get basic connectivity back, and dns lookups are still fast and relatively few.

At that time, you would stop using the smar-thost, and start to go directly to the remote ISP’s mailhost, or the end host if it is on-line.

15.15 One Hop is faster

if you are running an interactive multi-media discussion with a friend, simultaneously logged-on. One stop EMAIL is faster than 2 or even 3, even it it runs at a slower throughput.

15.16 Direct is more private

in addition, you know your emaail went through the ISP’s packet routers, not through the email gateways (and hence onto disk, along with log-files). You trust your ISP, it’s unlikely that they will ’tap-into’ your lines, but who works for them? (Ususally these people are too busy, too well paid, and email is boring). BUT ...

EG Your ISP may well collect traffic statistics (From site, To site, When, N bytes) that are retained and archived. How would you feel to find out that a debt collection agency had its email summary log, sold on a weekly basis? You would not be told.

Using the SMART HOST is usually a good idea.

16 Configurations on the end host

As well as routing messages, sendmail also processes them. Human inginuity being what it is, the range of possible processes, and ways of invoking them are many.

16.1 Typical Sendmail

16.1.1 Rejection

Email does not normally get a delivery confirmation, except for the nearest neighbour in the hop. However email can be rejected, either immediately (smtp-norm), later (uucp-norm) or never.

A typical reason is ”No such person known at this host”. SMTP knows by looking in /etc/passwd that the user exists, or by looking in its aliases database, or ... other. It is advantageous to respond immediately if possible, as the connection is open and active, especially if the comms are end-to-end direct.

One example of this is FEATURE(redirect), if enabled, will lookup the name in the aliases list. If the result is user@host.elsewhere.REDIRECT, the callers email will fail, but they get a nice diagnostic, telling them where to go.

16.1.2 Confirmation

If you wish to achnoledge all email you receive, with a standard ”Thankyou for yor email, Subject: RE: Text our-ref 1234, this is an automated reply, etc” email, you want it to happen whilst the user is still online, with a direct focus, avoiding smarthosts. You need to get sendmail to pass thhe message through a script (a bit like cgi really), as well as queuing the email for delivery.

The script belongs to the specific user (eg sales@, marketing@, admin@, each getting a different reply), and could be on your server (under your control), or on the ISP’s server - which should give a faster response, and you only need to dial-in once every hour.

Users that go on vacation may with

Generally: deliver(1) can run ˜ /.deliver (of target mailbox) with a full toolbox of access environment variables. The manual quotes an example:

       (cat $HEADER; tr '[A-Z]' '[a-z]' < $BODY) | deliver -n "$1"

Once the system adminstrators has set up the system, either allowing each user to write their own .deliver, or install one of a pre-agreed list of scripts (using a menu) -then- the user ia autonomous, and can adjust their own configuration day-or-night, as many times as they wish.

It is up to the user how often they want to go on holiday, and have a note saying whatever is up to date information (back soon ...). These may be administered (by general agreement), by line managers who have group access to a list of users files (group-name = managers-role).

16.1.3 Forward.

Users with several machines, that move around can redirect their email (like telephone follow-me’s), to where they are (the home machine), or the currently assigned receptionist. People who change their name by deed-poll get a new email address, and .forward from their old login name. To save time searching through /albatros/home2/name, - which may be spun-down or NFS (possibly broken), sendmail can be told not to pick ˜ /.forward (the default) but any sequence you can encode into the ’J’ option. IE a central directory. SEE : op.me2.5”.forwardF iles” (use mc-3.1 to view).

16.1.4 Additional capabilities

16.1.5 Printing by email

Direct iInternet connectivity is great when its available, but email can get through all sorts of fire-walls, and run efficiently as batch jobs. (Though the limited range of btes available out of 256 is disappointing).

A DTP bureau, (eg the bosses office upstairs with the colour laser, but no time for riff raff to use it), can make the printer available be email. A customer transmits a file (eg postscript packed with uuencode) to the printer queue, and an operator guides it thru, possibly after previewing it for sensible page options.r

The sender may have a less sophisticated PC to transmit from, and email multi-media is ideal as a basic, testable transport - ftp with cover notes. V34 modems, the -slow- part of the journey, have good compression of uuencoded text (unmeasured=???).

16.1.6 FAX by email

Since sendmail can deliver to a script, you can do pretty much anything. one example is to extract a phone number (prefixed from an approved list), a file format (postscript, groff, plain text, tif, ... ) and send the document as a FAX, possibly keeping a LOG or archive record.

A centralised service, available from ¡many-places¿. You could even route international FAXES over the Internet (but others might find the number).

16.1.7 Majordomo @ bbs host.domain

Please remember that (yet again) I’m telling you what might be possible, not HOW to debug it. Unless you see an article elsewhere And I’m covering subjects I’ve never touched. Get excited about the ideas, but don’t bet your company car on them unless: YOU MAKE THAT CHOICE.

THIS IS CONJECTURE, GUESSWORK, DREAMING AND BALONEY

You can use majordomo, listmail, procmail, .forward or your scripts to act as document servers, which send documents on request, or add users to mailing lists (bandwidth permitting). You could add HTML as a from-end to browse the documents ”online”, and request documents in ¡selected format=groff source¿.

A sort of FAX-BACK, but in high quality, grep-able formats (or even a compressed tar archive, that expands to HTML + gif’s, giving the same as the on-line brochures, but not at 14.4 K modem speeds, and offline).

Majordomo is used by many kind universities (etc) to provide a BBS service, for approved services, to the general public. Excessive use of bandwidth often leads to actual improved services, as popular services are obviously fulfilling a need, and get modest facilities allocated.

16.2 More on configuration options

Having strayed from the issue of installing sendmail for ’leaf’ access to Internet email, i hope you see how the sendmail.cf file (amoungs others) has built up a complex combination of configuration options. This should encourage you when browsing the DOC files listed above, and searching for others, eg man(1) pages such as mailaddr(7).

16.2.1 Cw localhost trix.trix.org trix.dircon.co.uk

If the host is a gateway (propername ”trix”), it may be sitting on two networks. The gateway to and from the Internet is called trix.dircon, the gateway to/from the LAN is trix.trix.org.

This host has to receive email from either side, and accept it as intended for ’here’. Cw defines a list of names that the gateway recognises as itself.

16.2.2 FEATURE(use cw file)

If the Cw list grows too long, it can be transfered to /etc/sendmail.cw, one name per line. op.me1.2nearline343 src/sendmail/cf/READMEL − 285

Obviously you could relocate that file (not a good idea, unless it is to an optimised virtual file system, that accesses the data faster, using less space (and disk head seeks). SEE : cf/READMEL − 1053”confCW F ILE”

16.2.3 MASQUERADE ASi(trix.dircon.co.uk)

See following text ...

16.2.4 More On Names

Every machine on the LAN (Private not Internet), has a name like raven.trix.org. Neither its EMAIL hostaddr, nor its LAN IP ADDR is available for use on the Internet (other than ¡trix.dircon.co.uk:user@raven¿ ).

You can put a routed address ¡gw1,gw2:user@host.domain¿ in the REPLY TO, or you could hide the internal topology (which changes), so that email is simply ¡user@trix.dircon.co.uk¿. The gateway has to do some intelligent routing. The workstation has to accept mail addressed to raven.trix.org -or- trix.dircon.co.uk (-or- localhost), and for the purpose of sending mail, it should consider itself to BE the originating ”trix.dircon.co.uk”, and put that in all From: headers (see also pine(1) elm(1) sendmail(1) smail(?)).

/etc/HOSTNAME would contain raven.trix.org. (the trix in domainname(trix,org) does not have to be the name of the gateway, but it makes sense. If you find it confusing, it is because you haven’t accepted it yet. Try looking at it the other way around. Name the gateway after the company (or site) that it contains. eg users@sparrow.NW10.org manages to reserve the name NW10.demon.co.uk from the ISP. NW10 is a UK PostCode zone (zip code).

Other users in the NW10 district have lost the opportunity to do that themselves, but if you do that for every size where you have an account, your network maps will make sense to you. If PostCodes are not your ideal name, think of an abstract collection of ¡use your imagination¿. Each site can have local names that follow a local scheme. It will make your life easier if all hosts have unique basenames.

You then purchase a company email name (such as heinz.com) which only really has one site - the central office that accepts and re-routes email from people who don’t know the site names. That site would probably be a permanent connection with a #5000 pa leased line.

The /etc/HOSTNAME is effectively the name of the Ethernet card on the LAN: sparrow.NW10.org, or even sparrow.lan 67.heinz.com (Please excuse me borrowing a well known trade name for my example, substitute pigeon.lan 67.¡your-name-here¿.com (presumably the local EMAIL server).

Every host needs a UNIQUE TCP/IP NAME, to validate and convey its IP ADDR (albeit private names.org on private addresses 192.168.67.xxx ).

16.3 /etc/aliases

This file allows you to allocate EMAIL names for users, that differ from their login names. eg my login is ”gps”, but you can send email to any of my aliases, provided I have edited /etc/aliases.

Occasionally names will conflict, however in a large company (¿10,000), there are supprisingly few conflicts of the basic scheme of G.P.Swallow.

Regrettable /etc/aliases is NOT for redirection from the gateway, however when you arrive at your leaf host, you can allow a list of aliases. For small companies (with only one MAIL server), you can create multimple schemes:

user_1016: gps          # thats the central db's tag
gps_1016: gps           # make nicer for me
Graham_Swallow: gps     # unique so far
G_P_Swallow: gps        # unique so far, slightly boring
G.P.Swallow: gps        # I don't like dots in the user_name
Graham: gps             # local mail is subjectively unique
c_o_l_a: gps            # majordome sends digestified feed to ... me

16.4 Other configuration parameters

Now edit the installed /etc/sendmail.cf file, adding the following declarations (find them and add the otherwise blank paramater). Note they are NOT indented at all.

16.4.1 DS¡smarthost¿

The smarthost (smartpath) is your ISP’s mail server. It should have a full configuration, and be able to send to UUCP domains that you have never heard of.

        DSmailhost.dircon.co.uk

If you don’t do that, sendmail should still work. It will call the nameserver, to get the MX records of the destination. If the destination host is OFF-LINE, the MX records should specify a backup host (ie your friend’s ISP’s mail-host), which sendmail will send to.

However, all this takes time, and may result in a connection to an overloaded server, and long delays sending your mail. Sending to your smarthost first will probably be MUCH faster (if your ISP is OK).

If you compose your EMAIL when SLIP (PPP) is down, sendmail will write a fault to /var/adm/messages, and fall back to the smarthost, putting the email into a queue. To send the queue, fire up SLIP and run sendmail -q in the dip in script (or wait for 15 minutes for the next batch run).

        sendmail -q     # attempt to send the queue NOW

16.5 pulling mail off your server

If you are always connected, your ISP will probably forward your mail immediately. Otherwise it batches up the mail, and waits for you to dial in.

My ISP has a simple mechanism, where I finger @mailhost, and it then prints a simple message (4 mail items waiting for you), and starts sending them. In addition, the finger remains connected until they are sent. I put the relevent command in my dip in script so that it always runs.

Actually I do it twice, to confirm that nothing is left. (My ISP has a bug where there is often 1 left in the queue).

16.5.1 /etc/HOSTNAME

Ensure that your machine has its PROPER email name in /etc/HOSTNAME.

Otherwise your sendmail may refuse mail not addressed to itself, or your ISP my refuse to send to a host with the wrong name in its SMTP banner. To see how your host announces itself (and what it believes its primary name to be) try:

        telnet localhost smtp
        Trying 127.0.0.1...
        Connected to localhost.
        Escape character is '^]'.
        220-trix.dircon.co.uk Sendmail 8.6.12/8.6.9 ready at Sat, 27 Jan 1996
        04:06:10 GMT
        220 ESMTP spoken here
        quit
        221 trix.dircon.co.uk closing connection
        Connection closed by foreign host.

16.5.2 faking your hostname

I can’t get this to work! I want to rename my box to ”raven”, and the DOCS say I can, but ... I tried the following two parameters in sendmail.cf, but got nowhere. Your milage may vary. grep sendmail.cw /usr/src/sendmail.cf.obj/*.cf

In theory, this is how you configure a LAN of hosts OFF the internet with a gateway on BOTH. Every machine Masquerades as the ’proper’ Internet gateway when sending mail (so replies work). They all use the gateway as the smart host. The smarthost uses aliases to send the messages back to the correct host (you must configure a comprehensive list of aliases). Each host accepts mail as trix.dircon.co.uk AND as itsname.raven.org.

        Cwlocalhost trix.dircon.co.uk raven.trix.org
        DMtrix.dircon.co.uk

16.5.3 Faking your name

Login names should be terse and unique, email names may be aliased to the login name. Edit /etc/aliases (no indent) then run newaliases. Test immediately.

        Graham_Swallow: gps
        Graham.Swallow: gps
        G.P.Swallow: gps
        Graham: gps

16.6 ¡smarthost.domain:user@yourhost.domain¿

Test mail route to and from smarthost.

This is the syntax that tells SMTP mail to route email firstly via your smarthost, then from there to yourhost. Its how you test that you can send mail to your smarthost, and it can send to you.

If you test to and from a friends machine, you may go through your smart hosts anyway.

It is also how you route email to an ’private’ email address (that is not known on the Internet, via a gateway that does recognise the address. If you put it into your Reply-to, it should work. However, users (and users on remote sites, who can’t reach you to find out what’s wrong) will get it muddled.

An alternative, is to send email to a majordomo, asking it for help. If the response comes back inseconds, you know that the other host is not overloaded, so your email is not being a pest.

16.7 smail not sendmail

I used to use smail and was very happy with it, but it may have been a tad slower, and now I get mail returned when the network is unreachable (ie AFTER a successful connection, then dip out, then compose). This MAY be solved by using the dummy network, or by editing the configuration to timout after 3 days.

sendmail (in the same circumstance) reports the timeout to /var/adm/messages, but requeues the job to the smarthost.

17 knews

knews is an X11 news reader, that connects to a local or remote news server using NNTP. There are other packages, but knews is one of the best.

This took me about an hour to install, but I didn’t need to do much.

17.1 Other news

If you have X11 running, the fast route to news is netscape or mosaic. They’re actually quite slow, but are excellent www/ftp/news browsers. They drop in and run, with the minimum of configuration (user information, $NNTPSERVER).

If you don’t have X11 running, PINE is a fast news reader, with only a few bugs, and a fast start up time. If you don’t want long phone calls, you want skim.

skim fetches all new subject lines, for groups you listed. You read them and select the lines you want. It then fetches the texts for the subject lines you tagged. Each phone call would be for only a few minutes. You read them off-line.

Other readers which connect to $NNTPSERVER vary. Some start up quickly, others take a few minutes whilst reading the list of lists. I guess there are as many news readers as email readers! A slow startup can lead to better threading, or just a slow start.

It takes about 5 minutes to read the active file, 5 more retrieving group descriptions. Then another 5 minutes to fetch the group (with a 6% marker). These can be switched off, by telling knews NOT ro read the active file and NOT to download the descriptions file. I don’t know how to make it download them once and reuse them!

17.2 knews thread tree

When you select View Thread , or when you navigate the lists with the cursor arrow keys, knews gives you a tree view of the thread, showing who replied to who’s message. Since this tree uses up a lot of screen space vertically, it can be scrolled by ’panning’ with the middle mouse button.

The window has two main panels, the top panel is the tree, the bottom panel is the message text. Message text is well formatted, with quoted text in a different font. URLS in the message are not highlighted, but are active.

When the mouse is over the tree panel, the cursor keys navigate the tree, and the current message text is shown in the lower window.

Regrettably, the cursor keys continued to do this in the lower window, so you have to use the scroll bars. This isn’t always clear, as getting the next message may take a few seconds, (but is usually faster then scrolling the desktop between the two panels).

There is a way of getting the two panels seperate instead of upper/lower. This makes it easier with less work scrolling the 640x480 desktop view, just to go to the next thread. I also made the tree use less space between lines, to get a better view.

17.3 Installing

• http://www.matematik.su.se/users/kjj/knews.html

• ftp://ftp.matematik.su.se/pub/kjj/ knews-0.9.7.tar.gz

Fetch the file, untar it. Read the README and INSTALL. Locate the files it tells you to customise, read them, chack both MAIL COMMAND and DOMAIN HACK.

but don’t expect to have to change much, I didn’t need to with 0.9.6, but 0.9.7 needed MAIL COMMAND defining in configure.h (I have /usr/sbin/sendmail).

NOTE You must make sure that configure.h declares the following

        #define DOMAIN_HACK     0

Otherwise knews will do for you what it did for me, and your postings will appear to be from

        gps@dircon.co.uk        - wrong
        gps@trix.dircon.co.uk   - right

The documentation says that any user can install it (eg $HOME/bin/knews), but root can install it for everybody on the system.

        vi configure.h
        xmkmf
        make Makefiles
        make clean
        make
        make install.man
        make install
        vi /var/X11R6/lib/app-defaults/Knews
## un comment the netscape line
        cp /etc/HOSTNAME /etc/knews.domain.name # FULL host.domain.name
        su - gps -c knews &

I did have to customise files after installing, but these were set in the user’s HOME directory, and didn’t require re-compiling.

17.4 Running

I have export NNTPSERVER=news.dircon.co.uk in my /etc/profile. That’s how knews knows who to call.

knews then appeared to be hung, but it was downloading the map of the news server. I left it and came back to find myself subscribed to news.answers and news.newusers. No problem, View-All-groups gave me the flat list and after selecting all of c.o.l.*, the subscribe button got me there.

If you locate one of the windows horizontal rules, the mouse becomes a finger that raises or lowers the window panel boundries. I wish my sash windows did the same!

17.5 Save message

The easiest was Post/forward by mail, which popped up a dialog box, I typed in ’gps’, pressed OK and emailed the message to myself. To stop me irritationg myself too much, it didn’t remember the address, so you have to type it again next time.

The Save button, gives you a real set of options, including sending the text to a pipeline or a file. (Click on the pipe command field to select it). Since the default command pipe is less running in an xterm, you have a quick way of seeing what difference the other options make.

17.6 Post / Follow up and reply

The Post button, gives a menu. Selecting Follow-up-and-reply dropped me in vi running in an xterm, with the exact references showing.

Resizing the xterm window made it a full page. Blah-Blah-Blah Zed-Zed Send

17.7 Post+Mail dialog box

After editing the posting, it is scanned for lines longer than 75 characters giving you a chance to edit again before sending.

It also scans after editing for the return addresses, so that you can cut+paste an email return address from the text into the header.

It just needs some X11 config parameters setting, and its own rc files. Then clicking on a URL with the middle button pushes netscape into life.

17.8 Configuring

man knews has all the parameters in readable format.

17.9 organization

A string used to construct the ’Organization:’ header in the articles you post. The default is $NEWSORG if set, otherwise $ORGANIZATION if set, otherwise nothing. IE you can put this in /etc/profile.

17.10 $HOME/.knews/config-news.dircon.co.uk

This file gets created by knews, for each news server it contacts. It starts full of comments, that show the current settings of most things. To change any setting, uncomment that line and edit it.

The options are documented in man knews , and only apply to that news server.

  readActiveFile:               False
  retrieveDescriptions:         False
  fillNewsrcFile:               True
  descriptionsFile:             ~/.knews/.descriptions-%s
  saveThreadInfo:               True
  *keepThreadInfo:              Subscribed
  *sortThreads:                 -date
  *quoteString:                  >
  *attribution:                 In article %m,\n%f writes:
  *cacheAheadSize:              32
  *cacheTrailSize:              32

17.11 xrdb $HOME/.xrc.knews

This command reads your settings into the X options database. You can have one file per X11 application, or one shared file. You don’t have to edit /var/X11R6/lib/app-defaults/Knews.

        Knews.separateWindows: True     # actually I prefer not
        Knews.urlCommand:      netscape -remote 'openUrl(%s)'

17.12 Where is news?

News is held on the Internet by several news servers. Local special interest groups may setup their news servers to retain articles for months.

Your ISP (probably) has a full news feed and cache that lasts for 2 weeks or so. You connect to that news server using NNTP (over TCL/IP).

knews fetches the subject lines and the article texts as it needs to. You have to remain on-line to read them.

You can setup your own news server, which acts as an automatically driven news reader, to fetch all texts to your local machine. You then point knews at the local server. This means that you can read news off-line, and that you can have private news groups. It also means you are using a lot of disk space, are comitting to a lot of modem traffic, and have to do additional configuration work (how long do articles live before they expire?)

knews comes with knewsd to do this, but I didn’t use it. What I really want is a news/www cache that retains documents for a week, so that I can browse quickly, and re-read off-line. But I also want to tag each www page for content and deletability,

18 xrn

18.1 comp.os.linux.announce

Now that you have knews, subscribe to and look in c.o.l.a for the following: xrn, srln, slang

18.2 xrn

x-read-news is a sophisticated bench, with an old style appearence, and no tree of articles. However it is excellent fro use with knews, as it selects the groups that go into .newsrc

18.3 SLANG

This isn’t a news reader but you install it for slrn.

        ./configure
        make
        make install    # root

18.4 slrn

This works on the console, and in a colour xterm. It uses the SLANG VDU library, which you might fetch and install.

        ./configure     # I think the domain went into a file somewhere
        make
        make install    # root

18.5 Make:gcc:ld: SIGNAL 11

damn

cd /gps_sess/9605/0526/slrn/src/objs; gcc slrn.o group.o misc.o clientlib.o
nntp.o art.o post.o startup.o help.o hash.o score.o uudecode.o mime.o menu.o
-o slrn -L/usr/lib -lslang
gcc: Internal compiler error: program ld got fatal signal 11
        ftp space.mit.edu
        binary
        hash
        cd /pub/davis/slrn
        ls

        mget ...
        cd ../slang
        ls
        mget ...
        quit

19 apache www server

Apache is a free clone of httpd, a www server. It serves web files to browsers, both over the LAN and over the Internet.

You will install apache to allow anonymous http access to files in /home/ftp. This allows users to see the same files whether they use a http browser, or plain old ftp.

You can create your HOME pages, and test them, before sending them to your ISP for 24 hour availability.

If you are running a web server for internal documents, this server will be for generally public documents (like the quality manual), to be accessed from user’s PC’s on the LAN (or remotely, where you design access into your networks).

Private documents will need additional configuration, or a blocking gatway bridge (firewall) that prevents connection for unrecognised PC’s and all proxy servers, who would fetch files for unknown PC’s.

If your read the docs, you can reconfigure apache to serve different document trees from different IP addresses, eg your LAN IP ADDR and your Internet IP ADDR. Normally, you want all document trees to be the same, regardless of how the caller connected.

19.1 www.apache.org

http://www.apache.org is their home page, where you will find the source to download. I got arache-1.0.2.tar.gz. You might also find it elsewhere, eg ftp.ast.cam.ac.uk.

        tar -zxf apache-1.0.2.tar.gz -C /usr/src
        cd /usr/src/apache-1.0.2

This creates the directory /usr/src/apache-1.0.2 and the files in it.

19.2 /usr/local/etc/httpd

After installing the files it becomes clear that /usr/local/etc/httpd is a supported installation directory, for some files (eg all files). ie: it is an alias for apache-1.0.2

I decided to keep /usr/local/etc/http as the base dir, bit you might like to relocate it. This is easilly done, just edit the httpd.conf file(s).

Clearly /tmp/pkg ftp is NOT a suitable installation location, because traditionally things in /tmp get deleted. After testing in /tmp/pkgs ftp you could move the package into /usr/src/apache-1.02, and re-set the httpd link. If /tmp and /usr/src are on the same partition, the mv command will be very quick and safe, otherwise use mc to relocate the files.

You can even pick which disk the files go onto, for performence reasons, or simplicity. The /usr/local/etc/httpd link is a convenience, that saves editing Makefiles and config files. The files apprear to be there, but are actually at the other end of the symbolic link pointer(s).

#       Remember usage: cp     [something_real] [new_copy]
#       Remember usage: ln     [something_real] [new_fake]
#       Remember usage: ln -s  [something_real] [new_fake]
#       Remember no check on whether [something real] exists or not!
        ln -s /usr/src/apache-1.02 /usr/src/apache
        ln -s /usr/src/apache      /usr/local/etc/httpd

You can easily move it around, and you can easily switch to a test version and back, by replacing that link.

#       switch from 1.02 to 1.03 to test new release
        ln -sf /usr/local/apache-1.03 /usr/src/apache
        ln -sf /usr/local/apache-1.02 /usr/src/apache # and back

Editing access.conf is another way of changing these parameters.

        ln -s /etc/apache_

19.3 httpd/htdocs -¿ /home/ftp

By default configuration, apache treats /usr/local/etc/httpd/htdocs as the root directory for www pathnames. You can change it in the configuration file, or make it point to what you want.

        ln -sf /usr/local/etc/htdocs /home/ftp

Apache will now run (if you compile it and start it, see rc.local). There is no other VITAL configuration to be done, but you should familiarise yourself with the configuration files, and make a few cosmetic changes.

19.4 /etc/httpd

You don’t have to do this (I didn’t), but some people like it to be /etc/httpd/. If you have to, you can make them happy with:

        ln -sf /usr/local/etc/httpd /etc/.

Don’t get confused, pick one directory as the ’true’ location. I chose /usr/local/etc/httpd because that was what I found in the makefile, but the next release might be something else, one of:

• /usr/lib/apache

• /usr/src/apache

• /usr/src/apache-1.02

• /usr/lib/httpd

• /usr/local/apache

• /usr/local/etc/httpd

• /usr/apache

• /home/apache

• /etc/apache

• (your-choice). Make all the other links point to that location (or phase them out). That location points to the real physical location, eg /hdc2/apache/apache-1.0.2

19.4.1 Relcating apache The physical location can be relocated, anytime you need to reorganise your disks, by keeping the ’one true’ location, as a link to physical . ie /usr/lib/apache -¿ /hdc2/apache/apache-1.0.2 If you need to conform to some-elses configuration, you make their location exist as a link pointing to your (/etc/httpd breaks Linux FSSTND, but is very catchy).

        bad location  ideal location     current package location
        /etc/httpd -> /usr/lib/apache -> /hdc2/spache/apache-1.0.2

The files are not oversize, so there is not no benefit from seperating the source from the binaries. Other packages may have a ’make install’ that copies the binaries to /usr/bin, configuration files to /etc, log files to /var/log, and leaves the source (and .o) files to be deleted.

19.5 No configuration changes NECESSARY.

There isn’t a Makefile in the top directory, you will have to look in each subdir (ie apache-1.0.2/src). You don’t need to be root to compile it, but you do to start it.

19.5.1 README files and Configuration files • README - tells you some

• src/INSTALL - tells you more • src/Configuration - needs to be edited

• conf/* - defines dir and file locations (etc)

Installation is simple but not immediate. You have options to control how http will access your machine, and where files go. These are controlled by text files, not just the binary, so compile it to be sure you can.

The text configuration files are in the apache/conf directory.

19.5.2 cd ./src ; vi Configuration

I made the following change to ./src/Configuration:

        # For SunOS 4
        #AUX_CFLAGS= -DSUNOS4
        # For Linux -m486 ONLY IF YOU HAVE 486 BINARY SUPPORT IN KERNEL
        AUX_CFLAGS= -DLINUX

19.5.3 Configure

This took less than a second and created a new Makefile and modules.c

19.5.4 make

This took about 3 minutes, and produced zero warnings.

19.6 Installation - Configuration

My ISP server does not allow FTP access to WWW areas (except for me to create my own pages). This is a pain in the neck, as I have to setup URL’s instead of saying, ok ftp and look around.

I intend to set up my server differently, where /home/ftp is visible to browsers.

If you install the RedHat package, you get something different, but by following these instructions, you will be able to choose exactly what you want.

19.7 /usr/local/etc/httpd -¿ /usr/local/apache-1.0.2/.

This makes it easy to switch to and from a different version of apache, or to ’install’ the binaries and delete the source files. Use the command:

        ln -s /usr/local/apache-1.0.2/. /usr/local/etc/httpd

This means that the ./cgi-bin/. scripts will be taken from there, as well as the ./conf/. files and ./logs/. files etc.

19.8 /home/ftp is root directory

        ln -s /home/ftp /usr/local/etc/httpd/htdocs     -or-
        ln -s /home/ftp /usr/local/apache-1.0.2/htdocs

htdocs is the ’apparent’ root of the www directories. Files in this directory are visible over the www. You don;t have to create the link, you could edit conf/access.conf instead.

By removing this directory, and creating a link to the /home/ftp directory, apache will think that /home/ftp is the root of visible pages. If you wish, you can collect www files into a www subdir.

        cd /home/ftp
        mkdir www
        chown gps /home/ftp/www
        chmod 755 /home/ftp/www

You should create /home/ftp/index.html as a ”welcome to this machine” page, it apache doen’t find an index.html, it generates one, as a ftp style list of files in the directory.

Your  URL’s  will  be  relative,  but  when

people keep bookmarks, they will appear as http://host.isp.com/www/my page.html. If you later decide to make www the root directory for httpd, you can simply create www/www as a symbolic link to ’.’, until everybody updates their bookmarks (forever).

The chown gps, is simply to allow a specific user to control the www directory. 755 or 777 doesn’t matter to httpd, as it should never write there, it just depends on your local users - ie grant yourself access by chown or chgrp.

My ISP gives me a root directory that looks like /trix from some angles, so to confuse myself even more I mimic it just in case!.

        cd /home/ftp
        ln -s . trix
        cd /home/ftp/www

This allows me to use the same pathnames in page-hit counters, quoting /trix/index.html as the page name. It’s easier than thinking.

19.9 /home/gps/public html

Don’t do this until you need to:

Files in this $HOME/public html will be available as http://trix/˜ gps/filename. Note that they won’t be available over ftp, unless you do something.

        mkdir -p /home/ftp/www/gps
        chown gps /home/ftp/www/gps

        ln -s /home/ftp/www/gps /home/gps/public_html
-or-
        ln -s /home/ftp /home/gps/public_html

19.10 Beware: httpd has more access then ftpd

The ftp daemon uses chroot to prevent itself from accessing files outside of /home/ftp. This is why /home/ftp/etc/passwd exists - the real /etc/passwd is not available, and programs (eg ls) need it for user names.

A symbolic link link within /home/ftp to outside, won’t work! It will get interpreted as though /home/ftp was root ’/’, staying inside /home/ftp and not what you intended.

Apache doesn’t use chroot, instead it does it’s own protection, from straying, by STARTING in the htdocs directory. Any symbolic links encountered will get followed within the system as a whole, and not be constrained. Don’t use

        ln -s / /home/ftp/root  # No, No

Unless you want apache to allow browsing of all of your system! Note that standard file permissions still apply, and apache is supposed to run as a plain user, however this is still a head start to many hackers, who can search your system for weaknesses and hints.

You should scan your machine for any symbolic links in /home/ftp/www and also in /home/username/public html, to make sure that someone isn’t exporting /. (They still have acces permissions of the ’nobody’ user, but the less they know, the harder it is to crack).

To use chroot, (to be sure that users don’t go outside /home/ftp), you would chroot /home/ftp and start httpd. Very few people would do this.

19.11 apache/conf/.

The conf directory appears as /usr/local/apache-1.0.2/conf/. and /usr/local/etc/httpd/conf/.

You want to copy and edit all the -dist files making several changes, to match your system. Keep all the /usr/local/etc pathnames as they are, but change details like the webmaster email address, and so on. (Actually that’s the only change you need to make, and if you don’t people will soon find a way to you via postmaster, root, or whatever you put in your pages.

        cd /usr/local/etc/httpd/conf/.
        cp -p access.conf-dist access.conf
        vi access.conf
        ... etc ...

19.11.1 access.conf - no change

19.11.2 httpd.conf

--->    ServerAdmin webmaster@trix.dircon.co.uk
        ServerRoot /usr/local/etc/httpd (unchanged)
      # BindAddress * -or- only allow LAN access not Internet access
        ErrorLog (you decide)
      # ServerName      (leave commented out for the default)
      # CacheNegociatedDocs (would effect your page hit count!)

19.11.3 srm.conf

        DocumentRoot /usr/local/etc/httpd/htdocs
        UserDir public_html (or www in users home dir)

19.12 /etc/aliases

Remember to run newaliases after adding the following entry. You could also alias it to postmaster, to yourself.

        webmaster: gps

19.13 /usr/local/etc/httpd/conf/mime.types

This tells the server how to handle files, eg those in ftp like browsing. You can allow apache to recognise DOS truncated filenames by editing the following line:

        text/html       html htm

19.14 /etc/rc.d/rc.local

Edit rc.local to call /usr/local/etc/httpd/conf/rc.apache, and create rc.apache, so that the following is run every time you boot:

  echo "Starting Apache ..."
  /usr/local/etc/httpd/src/httpd -f /usr/local/etc/httpd/conf/httpd.conf

Run rc.apache now to see that is is correct, (don’t reboot).

19.15 Completely redesigned layout

So far this has been keeping everything in /usr/local/etc/http. By doing so, all the pre-supplied config files needed vary little editing. If /usr/local/etc/http is a symb-link to /usr/src/apache/ you can easily switch versions and sets of configuration files.

Now that you have something that works, you may wish to start again, and do it completely differently. This time you decide where the files will go, and what they are called. It is no more work to prepare customised config files, that adapt apache to your system, than it is to adopt those files unchanged, and adapt your file system to apache.

At this point you have a dozen options, all of which make sense for different reasons. Write down what you want, and make apache conform to that. Try to figure out what the Linux FSSTND is, and how you may prefer to have things a non standard way. Do you want all log files and config files together? or in /var/log.

20 Copywrite and DISCLAIMER are in the Base Station

The Copywrite note and DISCLAIMER notices are currently common to each Issue, and appear in the Base Station. Click above to find them.)

You can locate Raven at

• http://sunsite.unc.edu/pub/Linux/docs/Raven/

• http://beyond.malmo.lth.se/˜ gps/Raven

• http://trix.dircon.co.uk/Raven

• http://www.users.dircon.co.uk/˜ trix

If you are having problems locating them, please contact me by email. gps@trix.dircon.co.uk

Raven is copywrite Graham Swallow, it is try-before-you-buy shareware. The authors cannot accept any liability for the content of this magazine. It is up to you to check that any actions you take, makes sense, matches other documentation, and work on a test system.

This is a summary. Please locate and read the actual notices.