Previous Next Table of Contents

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.


Previous Next Table of Contents