Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: John Chambers <jc@ral1.zko.dec.com>
Subject: Re: Why doesn't ifconfig work?
Date: 1998/05/04	[thread overview]
Message-ID: <354DE12C.19D01C41@ral1.zko.dec.com> (raw)
In-Reply-To: 6iar3m$ot7$1@lead.zk3.dec.com


Eric Werme - replace nobody with werme wrote:
> This is one way:
>  # ifconfig tu1 down delete
>  tu1: delete inet address 10.1.1.1
>  # ifconfig tu1
>  tu1: flags=c62<BROADCAST,NOTRAILERS,RUNNING,MULTICAST,SIMPLEX>
>  # ifconfig tu1 10.1.2.3 netmask 255.255.255.0
> 
> This is much "slicker":
> 
>  # ifconfig tu1 10.1.1.1 netmask 255.255.255.0
>  tu1: flags=c63<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST,SIMPLEX>
>       inet 10.1.1.1 netmask ffffff00 broadcast 10.1.1.255 ipmtu 1500
>  # ifconfig tu1 alias 10.1.2.3 netmask 255.255.255.0
>  # ifconfig tu1 -alias 10.1.1.1
>  # ifconfig tu1
>  tu1: flags=c63<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST,SIMPLEX>
>       inet 10.1.2.3 netmask ffffff00 broadcast 10.1.2.255 ipmtu 1500

Hmmm ... The implications of this are that the ifconfig command on Dunix has a
subtle difference from how it works on other Unices:  If you just use it to assign
an address to an interface, the effect is apparently to add an alias, not to change
the primary address.  It appears that the usual meaning of "ifconfig tu1 10.1.2.3"
can't actually be done here; this command seems to be synonymous with "ifconfig
tu1 alias 10.1.2.3", and you need to use either the -alias option or the delete param
to get the usual effect of a change of address.

Rereading "man ifconfig" makes it clear that the man page is in fact confused on
the issue, and one can't actually determine how to change the address from the
man page.    It also strongly encourages one to use netsetup, which I in fact did,
but I must say that netsetup is a rather horrible thing to write an expect script for.
It is incredibly wordy, requiring a large script, but the worst of it is that it has a lot of
messages that are either identical or very similar, but which require very different
answers at different phases of the operation.  Writing a program to talk to netsetup
isn't for the faint of heart.  (Maybe it'd make a good worst-case example in a course
on expect ;-).  User friendly it may be, to someone with the intelligence of a human,
but it is one of the most programmer-hostile tools I've ever seen.

Anyway, since it looks like, with a slight paradigm shift (;-), ifconfig can actually
do the job in two or three commands (rather than dozens with netsetup), I'll
be able to write an expect script that uses it.  Thanks.



  reply	other threads:[~1998-05-04  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-29  4:00 Why doesn't ifconfig work? John Chambers
1998-04-30  4:00 ` Eric Werme - replace nobody with werme
1998-05-04  4:00   ` John Chambers [this message]
1998-05-10  4:00     ` Paul Repacholi ( prep )
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox