Re: IP in the Windows registry

From: Dave Houghton (mulinux@blueyonder.co.uk)
Date: Fri Nov 22 2002 - 18:24:14 CET


22/11/2002 13:22:11, Michele Andreoli <m.andreoli@tin.it> wrote:

>On Thu, Nov 21, 2002 at 11:00:52PM -0000, Dave Houghton nicely wrote:
>
>> Fails on Win ME as well
>
>So, this passwd works only with XP???
>
>>
>> Have you tried /sbin/myip on a machine whose external ip is configured using dhcp as the registry entries
(at
>> least in 98/Me) are not in the same place as a fixed ip machine
>
>Worked? No? How to fix?
>

Win 98/ME:-

HKEY_LOCAL_MACHINE\System\CurrentControl\Services\VxD\DHCP\DhcpInfoXX

where xx is 2 digit numeric value from 00 for first dhcp configured eth card, 01 for 2nd etc
value stored as DhcpIPAddress.
Only problem is ip is stored as four hex bytes ie for my current ip 62.30.21.165:- 3e 1e 15 a5

Win2000 and presumably Xp:-

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
 sub keys that follow contain somewhere

"IpAddress" of type REG_MULTI_SZ (multiple nul-terminated strings), which contains all the static IP
addresses or "0.0.0.0" if there are none;

"DhcpIpAddress" (optional) of type REG_SZ (nul-terminated string), which contains the dynamic IP
address.

If I change the DIR variable in /sbin/myip as appropriate for win98/Me (dhcp in my routers case, static for
rest of network) then the correct ip is mailed to me.

Incidentally the registry ip entry for dial up connection gets even more involvedbut hopefully that won't be an
issue in your case.

I've still got the passwd dll problem and thus no sshd login but I think I've solved that if I can get the
netapi32.dll source. It would appear that the NetApiBufferFree function was not compiled into the dll. This
won't matter for XP as it obviously works for you, but is required for 9x/me.

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:23 CET