Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!rutgers!sunybcs!uhura.cc.rochester.edu!leadley From: leadley@uhura.cc.rochester.edu (Scott Leadley) Newsgroups: comp.unix.wizards Subject: Re: Determining one's own IP address. Message-ID: <4429@ur-cc.UUCP> Date: 8 Dec 89 20:48:29 GMT References: <601@bmers58.UUCP> Reply-To: leadley@uhura.cc.rochester.edu (Scott Leadley) Organization: University of Rochester Lines: 20 In article <601@bmers58.UUCP> davem@bnr-public.UUCP () writes: >How can one determine his own IP address without looking it up in the >hosts file? Assuming (a lot of things, but primarily that) you wish to do this from the shell command line and that you know the network interface name: % ifconfig de0 ^^^ VAX-ism, substitute the correct name here de0: flags=63 inet xxx.xxx.xxx.xxx netmask ffffff00 broadcast xxx.xxx.xxx.xxx If you don't know what interfaces are connected to the machine try: % netstat -i Name Mtu Network Address Ipkts Ierrs Opkts O... de0 1500 x-net x-machine 15890511 4 14812969... lo0 1536 127 localhost 134349 0 134349 0... -- Scott Leadley - leadley@cc.rochester.edu