This site uses advanced css techniques
We've had to put our 3B2 on the internet lately, and in the process have tripped across quite a few tidbits of interest.
NOTE - This is not a tutorial on TCP/IP in general, so if this is your first attempt at networking, the 3B2 is probably not going to be a very pleasant or useful platform for learning. Go get a Linux box for that. But if you are TCP-savvy but don't know the 3B2, this page is for you.
NOTE2 - 3B2 computers probably should not ever be put directly on the internet. The software is very, very old, probably full of bugs and vulnerabilities, and it's not going to be easy to build much of the new software. For instance, there is no released ANSI C or C++ compiler for this platform, so that cuts out on a large raft of software. Please be very careful.
Most of the TCP/IP utilities are found in the "usual" place of
/usr/bin
, but the server and diagnostic commands are
hidden away in /usr/etc
.
Most of the utilities here are not run by the user, but (in particular),
ping
, ifconfig
, and route
are in /usr/etc
. Of particular note is that
/usr/etc
is not in the $PATH
in the
/etc/rc.d/S86win3b
startup script, so full paths must
be used in that script.
Setting these parameters is done in the file /etc/rc.d/SS86win3b
look for the shell comment "Put ifconfig commands here". Add lines like this:
# # Put ifconfig commands here # /usr/etc/ifconfig en0 broadcast 192.168.1.255 netmask 255.255.255.0 /usr/etc/route add default 192.168.1.254 1 ...
These parameters can be entered directly on the command line, but it's wise to do a reboot to be sure they'll be set on a permanent basis. Though the netmask will often be set correctly based on the class of the address, but I prefer to set these explicitly.
When a network client (telnet, ping, ftp, etc.) needs to convert a name to an IP address, the resolver library bound into the client performs that task. Typically this resolver client look in the /etc/hosts file, consults /etc/resolv.conf to find a nameserver to query, or both.
Many 3B2 systems inside a network don't need the full nameserver capabilities, so the $NONAMESERVER environment variable tells the resolver library to only consult /etc/hosts - this saves some time for the client.
But to actually use a nameserver, this environment variable must be unset where found. It's normally set in /etc/profile for direct user logins, but is also found in the /etc/rc2.d/S86win3b networking startup script used by the daemons: it must be disabled in all places. A reboot is probably necessary for S86win3b script change to take effect.
For a computer inside a network with no contact with the outside world, the networking configuration works well enough, but once it connects to the internet it often fails in maddenly non-obvious ways. We recently connected our 3B2 to the internet for a customer data-recovery project, and we were getting mysterious errors when remote users tried to telnet in:
Telnetd: Can't I_POP tirdwr(##) Telnetd: Can't I_PUSH timod(##)
(we can't remember which of these it was).
The user eventually got a connection-timed-out message ( not "connection refused" ). Only when we put an Ethernet sniffer on the wire did we realize what the problem was: the 3B2 IP stack's TTL was too low. The TTL - "time to live" - is a kind of "hop count" that is decremented at each router. When the TTL reaches zero, the packet is discarded: it's designed to keep misdirected traffic from bouncing around on the internet forever.
A TTL of 15 is fine for an office, and it may have been OK for the internet 15 years ago, but these days is not even remotely close. The telnet packets arrive from the outside world correctly, but when the 3B2 sends the responses, the time out in transit and are lost. The router that's throwing it away sends an informational packet back to us (ICMP_TIME_EXCEEDED), and the IP stack tears down the connection. In the process it displays the message that drove us nuts for so long.
Fortunately, this is easy to fix.
* IP time-to-live
IP_TTL = 0x0f
The actual number in your file might be different, but here
we see that 0x0f is hexadecimal for "15", and this is way
too low. I prefer to set mine to 64, and you should edit the ip
file to contain the line IP_TTL = 64
. It's allowed
to be in decimal and not hex, and easier to read to boot.
# cd /boot # mkboot IP # touch /etc/systemThe touch command tells the system to rebuild the kernel automatically on next reboot.
# cd / # /etc/shutdown -g0 -y -i6
When the system (eventually) returns to multiuser mode, it will have the new, higher TTL. On my 3B2/622 it takes about 8 minutes to do the full rebuild and reboot.