From: Matt Welsh (mdw@db.TC.Cornell.EDU)
Date: 12/06/92


From: mdw@db.TC.Cornell.EDU (Matt Welsh)
Subject: Configuring TCP/IP for Linux, some notes
Date: Mon, 7 Dec 1992 05:22:32 GMT


"How I put my 0.98.5 Linux machine on the Net at 4:30 in the morning."

I'm writing this up for everyone who's having problems getting
networking to work under Linux. Basically these are notes from
last night. I'm typing this message on my Linux box now, telnetted
to tc.cornell.edu, and am quite happy about it.

These notes cover how to get TCP/IP setup for 0.98.5 or 0.98.6.
It includes how to do it if you're only going to use loopback.
It also includes how to patch in the ne2000 card driver, if you
have that.

-- You need: Sources for kernel 0.98.5 or newer.
             GCC 2.2.2d or newer.
             /lib/libc.2.2.2 (SLS has this. I don't know where it
               is otherwise).
             tcpip-0.8.tar.Z (from sunsite.unc.edu:/pub/Linux/system/Network)
             tcpip-0.8-fixes.tar.Z (found in same place on sunsite)
             tcp098pl5.p1, tcp098pl5.p2, tcp098pl5.p3 (same place)
               (only if you have 0.98.5. They are in 0.98.6 already).
             If you're installing NE2000 driver:
               8390.c, 8390.h, 3c503reg.h, Space.c
               Ask becker@super.org about this.

-- Got tcpip-0.8.tar.Z and tcpip-0.8-fixes.tar.Z from Sunsite.
   All of this stuff is in /pub/Linux/system/Network.
   The sources and diffs in this package are quite old and have
   been in the kernel for some time, so I ignored them. If you
   have at least 0.98.5 then all of the source code and diffs
   in this package are already there, so don't worry about them.
  
-- Got the tcp098pl5.p1 thru .p3 patches from Sunsite. I needed these
   because I'm running 0.98.pl5, so I applied them to the source in
   /usr/src/linux/net/tcp. If you have 0.98.6 these patches are already
   in there, so you don't need them.

-- Unpacked tcpip-0.8.tar.Z in a temporary dir. Took the 'bin.tar' there
   and uppacked it in /usr/bin. I got /lib/libc.2.2.2 from a friend's
   SLS-installed box and stuck it in /lib (because I didn't have it,
   and some of the tcpip stuff needs it). SLS comes with this lib.
   If you don't have it, I don't know where it is by itself.
   I can give it to you if you can't find it anywhere.

-- Unpacked inet.tar (from tcpip-0.8.tar.Z) in /usr/etc/inet. Unpacked
   tcpip-0.8-fixes.tar.Z over this in /usr/etc/inet.

-- Ran install.net. Since I'm connecting to the network, I set my
   IP address (128.253.153.54), Net address (128.253.153.0),
   router (128.253.153.1) and nameserver address. Set my domain name
   (which was arbitrary since I need to register in the .us domain).

-- Edited resolv.conf and hosts to reflect my temporary domain name
   and nameserver info. Install.net did a good job, but there were
   a few things I needed to make sure were right.

-- Edited /usr/include/linux/netinet/in.h to use <linux/socket.h> and
   not <sys/socket.h>.

---- Now, before you build the kernel, you need to install the
  NE2000 driver stuff (this doesn't apply if you're not going to use
  an NE2000, NE1000, or 3c503 ethernet card). Omit the following steps
  if you're just using the wd8003 card (or no card at all).

---- Got the 8390 driver code. This driver runs the ne2000, ne1000, and
  3c503 cards. It is in alpha, mail becker@super.org if you are interested.
  Got the files 8390.c, 8390.h, 3c503reg.h, and Space.c, put them all in
  /usr/src/linux/net/tcp. Note that this Space.c overwrites your old one.

---- Edited Space.c to change value of EI8390_IRQ. Also changed the
  #ifdef for the WD8003 card to something like
        #ifdef I_HAVE_NE2000_INSTEAD
  so that the wd8003 driver wouldn't get put in. I hear it causes problems
  with the ne2000 if you set them both for IRQ5.

---- Edited /usr/include/linux/config.h and took out
        #define CONFIG_DISTRIBUTION
     to force use of config.site.h instead.

---- Edited /usr/include/linux/config.site.h and added
        #define EI8390 0x300 /* base address */
        #define EI8390_IRQ 5 /* irq of card */
        #define EI_DEBUG 2 /* debug level */.

---- Edited /usr/src/linux/net/tcp/Makefile and added '8390.o' to OBJS.

---- Edited /usr/etc/inet/rc.net to config "eth_if" instead of "eth0".

---- Since I have a nameserver I don't want to configure named right now.
     So I did
        cd /usr/etc/inet
        mv named named.off
     to keep named from being configured at bootup time.

(The rest of this is no longer NE2000 configuration stuff)

-- To make the kernel did a make dep; make clean; make

-- Copied the new kernel to a floppy; rebooted; voila!

Now, it's not really that simple. There are numerous caveats. The main
one is: telnet and telnetd don't work. You can probably telnet out to
other machines okay, but telnetd is broken so you can't telnet to your
own machine. The fix? There is a new version of telnet and telnetd, which
are feature-laden and so far have worked great for me. They are in ALPHA,
but supposedly are to be released with a new TCP/IP package soon.

So, if you have problems telnetting into your machine, then you need
the new telnet. You'll know if you telnet to you own machine, it says
"connected to... whatever" and then closes the connection. If you don't
even get a connection, then things aren't set up right.

If you somehow have Pete Chown's new telnet, there are still bugs in telnetd,
which are fixed by an even newer version. All of this is to be released soon
so hold on. If you're really clamoring for a working telnet and telnetd,
talk to me. But the new binaries should be out soon.

NOTE: If you're only configuring for loopback you need to take out
the line in rc.net that runs config on eth0.

NOTE! SLS puts the TCP/IP stuff in /usr/inet instead of the right place
(/usr/etc/inet). If you can't seem to get things to work, make sure these
files are in the right place.

If you have any problems, just mail me (mdw@tc.cornell.edu). I'll be glad
to try and help. I hope I haven't forgotten anything. As long as you
set up everything in the canonical way it should work.

I think this is pretty complete. There are lots of problems, but
GO SLOW, make sure everything's setup right in all of your configuration
files (esp. rc.net, inetd.conf, services, hosts, resolv.conf, and so on).
Take notes while you do all of this stuff. Note anything out of the
ordinary. This will help GREATLY if you have inevitable problems and have
to ask others for help.

Good luck!
mdw

-- 
Matt Welsh     mdw@tc.cornell.edu     Cornell Theory Center
  "We're going away now. I fed the cat."