[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>&nbsp;</div>
<FONT COLOR=3D"#000080"></FONT><div><FONT COLOR=3D"#000080">&gt;if=
 you're running on a Unix system, you can use the 'ifconfig'=
 file</FONT><br>
<FONT COLOR=3D"#000080">&gt;to</FONT><br>
<FONT COLOR=3D"#000080">&gt;read your ip address. &nbsp;For=
 example:</FONT><br>
<br></div>
<div>You can do exactly the same on Windows. Here, on XP, we can=
 do:<br></div>
<div>&nbsp;</div>
<div>c:\&gt; ipconfig &gt;&gt; ip_number.txt<br></div>
<div>&nbsp;</div>
<div>This produces a file ip_number.txt like so:<br></div>
<div>&nbsp;</div>
<div>###<br></div>
<div>Windows IP Configuration<br></div>
<div>&nbsp;</div>
<div>Ethernet adapter Local Area Connection:<br></div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 Connection-specific DNS Suffix&nbsp; . :=
 student.harvard.edu<br></div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IP Address. . . .=
 . . . . . . . . : 140.247.173.24<br></div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Subnet Mask . . .=
 . . . . . . . . : 255.255.255.0<br></div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Default Gateway .=
 . . . . . . . . : 140.247.173.1<br></div>
<div>###<br></div>
<div>&nbsp;</div>
<div>It should not be too hard to parse this file for the=
 number.<br></div>
<div>&nbsp;</div>
<div>Cheers, <br></div>
<div>&nbsp;</div>
<div>Pijus<br></div>
<div>&nbsp;</div>
<div><br>
<br></div>
<div>-- <br></div>
<div>&quot;Those who can make you believe absurdities<br></div>
<div>can make you commit atrocities&quot; - Voltaire<br></div>
</body></html>