Computer Hope

Microsoft => Microsoft Windows => Windows XP => Topic started by: Xeratul on July 06, 2006, 09:50:24 PM

Title: Script to identify Static/Dynamic IP?
Post by: Xeratul on July 06, 2006, 09:50:24 PM
Is it possible to have a VB script or something similar determine whether the machine on which it is ran has its connection to the internet through a dynamic or static IP address, and echo the result into a text file or something?

I don't have a problem or anything. I'm just curious. ;)
Title: Re: Script to identify Static/Dynamic IP?
Post by: Rob Pomeroy on July 07, 2006, 03:35:58 AM
I suppose so, but it would be hard to cover all cases.

Case 1: PC connected to the internet through modem.  Check DHCP lease information to determine whether IP is dynamic or static.

Case 2: PC connected to to internet via router.  Can determine is PC has dynamic IP on LAN, but would need to query router (or some external server) to determine if the LAN itself had a dynamic or static IP...

Case 3: More complicated network configuration; LAN segments connected by bridges, IP tunnels, etc.

Could be tricky.