From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9e943f880c63cc59,start X-Google-Attributes: gid1164f8,public From: John Chambers Subject: Why doesn't ifconfig work? Date: 1998/04/29 Message-ID: <354744C0.E2B6F10C@ral1.zko.dec.com>#1/1 X-Deja-AN: 348770416 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: Digital Equipment Corp (soon to be Compaq) Mime-Version: 1.0 Reply-To: jc@ral1.zko.dec.com Newsgroups: comp.sys.dec On this Digital Unix 4.0B system, and on another 4.0D system, the ifconfig command doesn't seem to be able to change IP addresses at all. It always gives a 1 exit status, implying that it thinks that it has worked, but in fact the address doesn't change. Here's some evidence: : id uid=0(root) gid=1(daemon) groups=0(system),3(mem),7(terminal),9(opr),12(lp),22(web) : ifconfig tu1 tu1: flags=c63 inet 10.1.1.1 netmask ffffff00 broadcast 10.1.1.255 ipmtu 1500 : ifconfig tu1 10.1.2.3 : ifconfig tu1 tu1: flags=c63 inet 10.1.1.1 netmask ffffff00 broadcast 10.1.1.255 ipmtu 1500 : ifconfig tu1 down : ifconfig tu1 tu1: flags=c62 inet 10.1.1.1 netmask ffffff00 broadcast 10.1.1.255 ipmtu 1500 : ifconfig tu1 10.1.2.3 : ifconfig tu1 tu1: flags=c63 inet 10.1.1.1 netmask ffffff00 broadcast 10.1.1.255 ipmtu 1500 : We can see from this that 1) I am indeed logged in as root, 2) ifconfig doesn't make any changes to the IP address, but 3) ifconfig can put the interface down and 4) The " ifconfig tu1 10.1.2.3" command doesn't change the address but it does put the interface back up! A long series of experiments with varations of the ifconfig command turned up consisten results: All sorts of things about the interface can be changed, but the IP address never changes. And sometimes changes (such as the up/down status) change spontaneously for no apparent reason. Any ideas what might be going wrong, or how to make it work? BTW, to forestall the obvious red herring: Yes, I have read "man 8 ifconfig", and I have seen the suggestion that netsetup be used. This is not relevant in our case, because the* intent* is to purposely misconfigure the interface. The application is a class exercise in which some judicious mis-configurations are done to a couple of machines, the student is told that "Such-and-such doesn't seem to work", and the student is to find and fix the problem. This situtation absolutely requires that we be able to dynamically mis-configure the machines (and restore their correct configuration later with a cleanup script). Telling us how to "do it right" isn't a useful answer. We need to be able to change the configuration on the fly, and then soon after that, we need to be able to change it back.