Next Previous Contents

2. How do I connect to the rest of the world?

It will be assumed that we have installed the essential networking software modules from your Linux distribution, and that you have set up which serial port that is to be used for the /dev/modem.

The default configuration will usually only allow direct access to /dev/modem as user root.

To connect to ISP shell accounts directly, and to experiment with connection sequences, you may use the minicom program. It is pretty straight forward to use.

2.1 The basic configuration

Configuration of the machine for use on the net should be done as user root. Before proceeding any further, ensure that the file /etc/hosts.deny contains the following line:


ALL: ALL
You would normally want to allow yourself, so add the following line to /etc/hosts.allow:

ALL: LOCAL
Or if you insist:

ALL: 127.0.0.1
For the following, note that it is meant for those connected via PPP and with a dynamic IP address. If you have the benefit of a fixed connection, there will be some differences.

It is nice to have a name connected to the machine, a name that the dynamic IP user really can select as he or she pleases. Put the name in /etc/HOSTNAME:


roderick

The next step is to set up the name server in /etc/resolv.conf:


search .
nameserver 193.212.1.0
<nidx>nameserver
The name server must be specified by a numeric IP address, and will be different from ISP to ISP. If required, you can have up to three different servers, each on a separate line. They will be requested in the sequence in which they are listed.

If you want to be able to use names like somemachine as an abbreviation for somemachine.acme.xz, you must replace the first line with:


search acme.xz

A certain minimum of configuration will also be required in /etc/hosts. Most users will be able to manage with:


127.0.0.1       localhost
0.0.0.0         roderick
Those with a fixed IP-address will obviously replace 0.0.0.0 with that.

Likewise, a minimum /etc/networks is:


loopback        127.0.0.0
localnet        0.0.0.0

You should also set your external mail domain in /etc/mailname:


acme.xz

The username and password at the ISP must be specified in /etc/ppp/pap-secrets


dirk * PrettySecret

For those ISPs using CHAP instead of PAP the filename is /etc/ppp/chap-secrets.

Finally, the nitty gritty regarding the connection procedure itself must be specified before PPP can be initiated. This is done in /etc/ppp/chatscript:


TIMEOUT 5
"" ATZ
OK ATDT12345678
ABORT "NO CARRIER"
ABORT BUSY
ABORT "NO DIALTONE"
ABORT WAITING
TIMEOUT 45
CONNECT ""
TIMEOUT 5
"name:" ppp
Details here may have to be tuned somewhat. The phone number in the third line must of course be set as required. Some users may need to replace the ATZ modem initialization string with something more tailored for the modem being used. The last line specifies that one is expecting a prompt that ends with name:, and that the response should be ppp when it arrives. Other systems may have other login procedures.

To actually initiate a call, the PPP protocol may be initiated by issuing the following command:


exec pppd connect \
     'chat -v -f /etc/ppp/chatscript' \
      -detach crtscts modem defaultroute \
      user dirk \
      /dev/modem 38400
We should now be on-air, and stay up until the program is killed by typing a ctrl-C. Any messages concerning the connection will be appended to the system logs. To read them, try:

tail /var/adm/messages
or

dmesg

As long as PPP is up, you will have direct access to the Internet and may use programs like ftp, ncftp, rlogin, telnet, finger etc. All these programs should be part of the network package.

Further information concerning PPP is also available from:

/usr/lib/ppp/README.linux

/usr/lib/ppp/README.linux-chat

Finally, an additional word about security The file /etc/inetd.conf lists all services that your machine will offer externally. With the /etc/hosts.deny file we have made, no external access will be allowed. For those who need it, access must be allowed explicitly in /etc/hosts.allow. Local traffic may be allowed by:


ALL: LOCAL
See also man 5 hosts_access.

A final minor issue: A certain confusion exists regarding the names of the POP protocols. A definition in /etc/services compatible with just about everything is:


pop2            109/tcp         pop-2           # PostOffice V.2
pop3            110/tcp         pop-3 pop       # PostOffice V.3

ALT: Instead of chatscript, one might use the much more flexible dip. But not in connection with diald.

ALT: Those fortunate enough to have a permanent TCP/IP connection via e.g. an Ethernet may safely ignore anything about PPP and rather start concentrating about setting up their network card.

ALT: Others may not have the possibility of using PPP, but may be able to use SLIP instead, for which there is support in much the same manner as for PPP. Another possibility is UUCP Others again may have to rely on exchange of news and email be means of SOUP A description for the latter case may be found in:

ftp://ftp.sol.no/user/bjorn/Linux-offline.tgz

The TERM program is also an option. Refer to the Term-HOWTO.


Next Previous Contents