Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Virtual PC

Vista - How can the guest know the outside IP it is using?

Reply
 
Old 12-17-2008   #1 (permalink)
Bo Berglund


 
 

How can the guest know the outside IP it is using?

Say that I have a Windows guest (XP or similar) set to obtain its IP
address automatically.
On the guest settings I have selected the host NIC.
The host NIC is connected to a router, which in turn is connected to
an ADSL modem. The router provides private IP addresses to all
connected internal NIC:s in the 192.168.x.x range.

The router holds a fixed IP address to the Internet or is getting its
address via DHCP from the ISP.

Now I would like to know how the guest can find out the IP address the
ISP has assigned to the router's external interface (fixed or by
DHCP).

Is there a simple command that can get this info into a program
running on the guest?

--

Bo Berglund (Sweden)

My System SpecsSystem Spec
Old 12-17-2008   #2 (permalink)
Grand_Poobah


 
 

Re: How can the guest know the outside IP it is using?

--->
Quote:

> Say that I have a Windows guest (XP or similar) set to obtain its IP
> address automatically.
> On the guest settings I have selected the host NIC.
> The host NIC is connected to a router, which in turn is connected to
> an ADSL modem. The router provides private IP addresses to all
> connected internal NIC:s in the 192.168.x.x range.
>
> The router holds a fixed IP address to the Internet or is getting its
> address via DHCP from the ISP.
>
> Now I would like to know how the guest can find out the IP address the
> ISP has assigned to the router's external interface (fixed or by
> DHCP).
>
> Is there a simple command that can get this info into a program
> running on the guest?
>
Can you get to the Web? If so, try going to "www.whatismyip.com" with a
script and extract the returned IP address from the page. I have not
tried this, but it sound feasible.

GP
My System SpecsSystem Spec
Old 12-17-2008   #3 (permalink)
Mark Rae [MVP]


 
 

Re: How can the guest know the outside IP it is using?

"Bo Berglund" <boberglund@xxxxxx> wrote in message
news:sktik4pq4hojvlu9lpk3hs44rbhlg649li@xxxxxx
Quote:

> Now I would like to know how the guest can find out the IP address the
> ISP has assigned to the router's external interface (fixed or by DHCP).
http://www.whatismyip.org/


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

My System SpecsSystem Spec
Old 12-17-2008   #4 (permalink)
Grand_Poobah


 
 

Re: How can the guest know the outside IP it is using?

--->
Quote:

> "Bo Berglund" <boberglund@xxxxxx> wrote in message
> news:sktik4pq4hojvlu9lpk3hs44rbhlg649li@xxxxxx
>
Quote:

>> Now I would like to know how the guest can find out the IP address the
>> ISP has assigned to the router's external interface (fixed or by DHCP).
>
> http://www.whatismyip.org/
>
>
True. But the rest of the post said:

"Is there a simple command that can get this info into a program
running on the guest?"

That's a bit more complicated I'd think.

GP
My System SpecsSystem Spec
Old 12-17-2008   #5 (permalink)
Bo Berglund


 
 

Re: How can the guest know the outside IP it is using?

On Wed, 17 Dec 2008 17:09:57 -0500, Grand_Poobah
<whatever@xxxxxx> wrote:
Quote:

>--->
Quote:

>> Say that I have a Windows guest (XP or similar) set to obtain its IP
>> address automatically.
>> On the guest settings I have selected the host NIC.
>> The host NIC is connected to a router, which in turn is connected to
>> an ADSL modem. The router provides private IP addresses to all
>> connected internal NIC:s in the 192.168.x.x range.
>>
>> The router holds a fixed IP address to the Internet or is getting its
>> address via DHCP from the ISP.
>>
>> Now I would like to know how the guest can find out the IP address the
>> ISP has assigned to the router's external interface (fixed or by
>> DHCP).
>>
>> Is there a simple command that can get this info into a program
>> running on the guest?
>>
>
>Can you get to the Web? If so, try going to "www.whatismyip.com" with a
>script and extract the returned IP address from the page. I have not
>tried this, but it sound feasible.
>
>GP
Thanks, this works in a visual sort of way....

But I did want some trick to give me this info programmatically
because I need my virtual W2003 server to discover the IP regularly.

I run this guest in Virtual Server 24/7 to act as my VPN gateway from
outside into my internal network.
For a couple of years I have used an ISP who has given me a fixed
address, but now I have to switch to a different provider, which only
supplies DHCP addresses.
So I need some way to know what is the current external address my
router uses since that is the address I need to point my VPN
connection at.
The plan was to have the W2003 server regularly check the external
address and then publish it in a webpage on a private homepage at the
ISP where I can look it up if the connection fails.

Maybe there is a better solution?

--

Bo Berglund (Sweden)
My System SpecsSystem Spec
Old 12-17-2008   #6 (permalink)
Bo Berglund


 
 

Re: How can the guest know the outside IP it is using?

On Wed, 17 Dec 2008 22:18:54 -0000, "Mark Rae [MVP]"
<mark@xxxxxx> wrote:
Quote:

>"Bo Berglund" <boberglund@xxxxxx> wrote in message
>news:sktik4pq4hojvlu9lpk3hs44rbhlg649li@xxxxxx
>
Quote:

>> Now I would like to know how the guest can find out the IP address the
>> ISP has assigned to the router's external interface (fixed or by DHCP).
>
>http://www.whatismyip.org/
Or better yet:
http://www.whatismyip.com/automation/n09230945.asp

This gives me just the IP address as the return page, should be easier
to automate. :-)

--

Bo Berglund (Sweden)
My System SpecsSystem Spec
Old 12-17-2008   #7 (permalink)
Grand_Poobah


 
 

Re: How can the guest know the outside IP it is using?

--->
Quote:

> On Wed, 17 Dec 2008 17:09:57 -0500, Grand_Poobah
> <whatever@xxxxxx> wrote:
>
Quote:

>> --->
Quote:

>>> Say that I have a Windows guest (XP or similar) set to obtain its IP
>>> address automatically.
>>> On the guest settings I have selected the host NIC.
>>> The host NIC is connected to a router, which in turn is connected to
>>> an ADSL modem. The router provides private IP addresses to all
>>> connected internal NIC:s in the 192.168.x.x range.
>>>
>>> The router holds a fixed IP address to the Internet or is getting its
>>> address via DHCP from the ISP.
>>>
>>> Now I would like to know how the guest can find out the IP address the
>>> ISP has assigned to the router's external interface (fixed or by
>>> DHCP).
>>>
>>> Is there a simple command that can get this info into a program
>>> running on the guest?
>>>
>> Can you get to the Web? If so, try going to "www.whatismyip.com" with a
>> script and extract the returned IP address from the page. I have not
>> tried this, but it sound feasible.
>>
>> GP
>
> Thanks, this works in a visual sort of way....
>
> But I did want some trick to give me this info programmatically
> because I need my virtual W2003 server to discover the IP regularly.
>
> I run this guest in Virtual Server 24/7 to act as my VPN gateway from
> outside into my internal network.
> For a couple of years I have used an ISP who has given me a fixed
> address, but now I have to switch to a different provider, which only
> supplies DHCP addresses.
> So I need some way to know what is the current external address my
> router uses since that is the address I need to point my VPN
> connection at.
> The plan was to have the W2003 server regularly check the external
> address and then publish it in a webpage on a private homepage at the
> ISP where I can look it up if the connection fails.
>
> Maybe there is a better solution?
>
I, personally, haven't done it, but there are "stripper" programs that
can run under scripting control that will 'strip' all the text off a web
page. You run this and look for the page:

www.whatismyip.com/automation/n09230945.asp

This page is what is showing your IP address. whatismyip.com tells this
to you if you look in your browser and "Show page source". Look for the
instructions for using this page.

GP
My System SpecsSystem Spec
Old 12-17-2008   #8 (permalink)
Bo Berglund


 
 

Re: How can the guest know the outside IP it is using?

On Wed, 17 Dec 2008 23:30:44 +0100, Bo Berglund <boberglund@xxxxxx>
wrote:
Quote:

>On Wed, 17 Dec 2008 22:18:54 -0000, "Mark Rae [MVP]"
><mark@xxxxxx> wrote:
>
Quote:

>>"Bo Berglund" <boberglund@xxxxxx> wrote in message
>>news:sktik4pq4hojvlu9lpk3hs44rbhlg649li@xxxxxx
>>
Quote:

>>> Now I would like to know how the guest can find out the IP address the
>>> ISP has assigned to the router's external interface (fixed or by DHCP).
>>
>>http://www.whatismyip.org/
>
>Or better yet:
>http://www.whatismyip.com/automation/n09230945.asp
>
>This gives me just the IP address as the return page, should be easier
>to automate. :-)
Done!
It took a Delphi console application totalling 33 lines of code
including whitespace and fixed stuff to retrieve the IP address from
http://www.whatismyip.com/automation/n09230945.asp and put it into a
string variable to print on the console.

Now I just have to upload the result into my website using FTP. :-)
Thanks for the link that made it all possible!

--

Bo Berglund (Sweden)
My System SpecsSystem Spec
Old 12-17-2008   #9 (permalink)
Grand_Poobah


 
 

Re: How can the guest know the outside IP it is using?

--->
Quote:

> On Wed, 17 Dec 2008 23:30:44 +0100, Bo Berglund <boberglund@xxxxxx>
> wrote:
>
Quote:

>> On Wed, 17 Dec 2008 22:18:54 -0000, "Mark Rae [MVP]"
>> <mark@xxxxxx> wrote:
>>
Quote:

>>> "Bo Berglund" <boberglund@xxxxxx> wrote in message
>>> news:sktik4pq4hojvlu9lpk3hs44rbhlg649li@xxxxxx
>>>
>>>> Now I would like to know how the guest can find out the IP address the
>>>> ISP has assigned to the router's external interface (fixed or by DHCP).
>>> http://www.whatismyip.org/
>> Or better yet:
>> http://www.whatismyip.com/automation/n09230945.asp
>>
>> This gives me just the IP address as the return page, should be easier
>> to automate. :-)
>
> Done!
> It took a Delphi console application totalling 33 lines of code
> including whitespace and fixed stuff to retrieve the IP address from
> http://www.whatismyip.com/automation/n09230945.asp and put it into a
> string variable to print on the console.
>
> Now I just have to upload the result into my website using FTP. :-)
> Thanks for the link that made it all possible!
>
No problem. Now, if I can get that stupid W2K to install we'd both be
happy.

GP
My System SpecsSystem Spec
Old 12-17-2008   #10 (permalink)
Mark Rae [MVP]


 
 

Re: How can the guest know the outside IP it is using?

"Bo Berglund" <boberglund@xxxxxx> wrote in message
news:0bvik4hian7mml0dn1eisnuspi48f5aija@xxxxxx
Quote:
Quote:
Quote:

>>> Now I would like to know how the guest can find out the IP address the
>>> ISP has assigned to the router's external interface (fixed or by DHCP).
>>
>>http://www.whatismyip.org/
>
> Or better yet:
> http://www.whatismyip.com/automation/n09230945.asp
>
> This gives me just the IP address as the return page, should be easier
> to automate. :-)
Do a View Source on both pages - what's the difference...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Host: Vista, Guest: XP - using guest for MP3 player? Virtual PC
can I autorun a programme in a guest when starting guest? Virtual PC
Networking Guest to Host and Host to Guest Virtual PC
guest log in Vista account administration
guest log on????? Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46