[Tutor] IP Address
Pijus Virketis
virketis@fas.harvard.edu
Wed, 22 May 2002 14:52:19 -0400
<HTML><HEAD>
<BASEFONT FACE=3D"Arial" SIZE=3D"2" COLOR=3D"#000000">
</HEAD>
<BODY>
<div> </div>
<FONT COLOR=3D"#000080"></FONT><div><FONT COLOR=3D"#000080">>if=
you're running on a Unix system, you can use the 'ifconfig'=
file</FONT><br>
<FONT COLOR=3D"#000080">>to</FONT><br>
<FONT COLOR=3D"#000080">>read your ip address. For=
example:</FONT><br>
<br></div>
<div>You can do exactly the same on Windows. Here, on XP, we can=
do:<br></div>
<div> </div>
<div>c:\> ipconfig >> ip_number.txt<br></div>
<div> </div>
<div>This produces a file ip_number.txt like so:<br></div>
<div> </div>
<div>###<br></div>
<div>Windows IP Configuration<br></div>
<div> </div>
<div>Ethernet adapter Local Area Connection:<br></div>
<div> </div>
<div> =
Connection-specific DNS Suffix . :=
student.harvard.edu<br></div>
<div> </div>
<div> IP Address. . . .=
. . . . . . . . : 140.247.173.24<br></div>
<div> </div>
<div> Subnet Mask . . .=
. . . . . . . . : 255.255.255.0<br></div>
<div> </div>
<div> Default Gateway .=
. . . . . . . . : 140.247.173.1<br></div>
<div>###<br></div>
<div> </div>
<div>It should not be too hard to parse this file for the=
number.<br></div>
<div> </div>
<div>Cheers, <br></div>
<div> </div>
<div>Pijus<br></div>
<div> </div>
<div><br>
<br></div>
<div>-- <br></div>
<div>"Those who can make you believe absurdities<br></div>
<div>can make you commit atrocities" - Voltaire<br></div>
</body></html>