[comp.sys.sun] ftp: bind: can't assign requested address

SYSRUTH@utorphys.bitnet (Ruth Milner, Systems Manager x2746) (05/13/89)

This question was asked on sun-spots recently, and three replies suggested
that the client's /etc/hosts table was probably not correct.

We also are seeing this problem, on a diskless 3/110 served off a 3/180,
both running 3.4. The /etc/hosts table is complete and up-to-date on both
the server and the client (which has its own copy). Its own address is in
/etc/hosts and is correct, and has been that way since day 1. It has been
rebooted a number of times since it was installed, and ftp has *never*
worked. Whenever the "ls" or "get" commands are typed in, it always comes
back with the above error.

Does anybody have any other ideas? I'm stumped. It's not absolutely vital
for local purposes, since rcp will work as well (the 3/110 is not actually
diskless, but it does not have an OS on its disk, just user programs and
data, and swap), but it would be nice to know why it doesn't work.

For the record: we are not running YP; inetd starts up the usual services
(same as on some diskless 3/50's served off the same 3/180, on all of
which ftp works) , /etc/networks is up-to-date, it is an NFS server for
its local disk (could this, combined with ND, interfere with ftp
somehow?). We are on the Internet and use subnetting; the server and
clients are of course on the same subnet.

Thanks in advance.

Ruth Milner
Systems Manager
University of Toronto Physics

dupuy@cs.columbia.edu (Alexander Dupuy) (05/20/89)

The messages describing the cause as being a problem with /etc/hosts were
only partly correct.  If /etc/hosts is incorrect, and you are running yp,
things will generally work, but you will see the FTP problems you
describe.  But the true cause of the problem is not /etc/hosts, it is the
interface configuration.

When a diskless machine boots, it determines its IP address via RARP,
allowing it to load /vmunix, etc.  But even though it knows the IP
address, it doesn't set the IP address in the kernel interface structure.
This must be done with ifconfig.  If the ifconfig in rc.boot fails for
whatever reason, either no entry in /etc/hosts, or other problems, things
will generally work, but you will see the "bind: can't assign requested
address" when running ftp.

A good way to check that this is the problem is to run "ifconfig xx0"
where xx is either ec, ie, or le, as appropriate.  You should see
something like this

ie0: flags=63<UP,BROADCAST,NOTRAILERS,RUNNING>
        inet 128.59.16.20 netmask ffff0000 broadcast 128.59.0.0

If the inet value is garbage, you have this problem.  Try running the
ifconfig commands from rc.boot manually, or edit rc.boot so that errors
messages from ifconfig won't go down the bitbucket (/dev/null).  Here's
the relevant piece of our modified 4.0 rc.boot file:

# 
# Configure primary network interface (and loopback) only.  Other interfaces
# are configured in rc.local.  Try to give some indication on the console if
# there are problems.
# 
opts="up -trailers netmask + broadcast cu-net"
loopopts="up netmask 255.0.0.0"

hostname $hostname
ifconfig ec0 $hostname $opts ||
ifconfig ie0 $hostname $opts ||
ifconfig le0 $hostname $opts ||
ifconfig lo0 $hostname $opts				>/dev/console 2>&1
ifconfig lo0 localhost $loopopts			>/dev/console 2>&1

If you have 3.x, something similar should work.

I remember this all being hashed out quite some time ago on sun-spots; perhaps
Phil should add this to his list of answers to frequently asked sun-spots
questions.

@alex

inet: dupuy@cs.columbia.edu
uucp: ...!rutgers!cs.columbia.edu!dupuy

SYSRUTH@utorphys.bitnet (Ruth Milner) (05/31/89)

I'd like to thank all those who responded to my earlier query about what
might be causing this error message on a diskless 3/110. There were some
excellent suggestions, and although none of them happened to be our
problem, they did point me in the right direction.

It was really very simple, and very silly <blush>. After building the
3/110's root from that of another diskless client, a 3/50, although we
remembered to change the hostname and so forth, we (read "I" :-( ) forgot
to make sure that the call to ifconfig from /etc/rc.boot was being run on
the correct interface. As a result, ifconfig was running on le0 instead of
ie0 (3/110's use the Intel chip, not the Lance chip). I'm suitably
embarrassed.

A simple "ifconfig ie0" showed that the correct Internet address was being
picked up, no doubt from rarp (otherwise it would not have booted at all).
However there must be other things set up by ifconfig which weren't being
configured properly as a result. Once the change was made and the system
rebooted, ftp ran fine. I'm posting this so that people who might be
seeing this error have one more trivial thing they can check before
starting to delve into kernel data structures.

If anyone who still has this problem after checking all the easy stuff is
interested in the nitty-gritties of other potential causes, drop me a line
and I'll forward the (quite long) messages which describe them.  Warning:
you'll need to know how to use adb to make any use of them.

Thanks again.

Ruth Milner
Systems Manager
University of Toronto Physics

sysruth@utorphys (BITNET)      sysruth@helios.physics.utoronto.ca (Internet)