By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,335 Members | 1,385 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,335 IT Pros & Developers. It's quick & easy.

How do I determine my WAN address?

P: n/a
I need to find out the IP address of my local network on the WAN. There is
alot of information on getting my local machine IP address but I can't find
anything for getting the IP address my network is on.

I was thinking I could make a HTTP Request to a server which displays your
IP address as they see it and scrape it out of the response but I was hoping
for a method which is less dependent on some server out on the web...
May 17 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
MrNobody,

What do you mean the IP address of your network? There is no such
thing. Your network is composed of different machines all connected to each
other. There is no single one IP address for the network.

What are you trying to do?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
I need to find out the IP address of my local network on the WAN. There is
alot of information on getting my local machine IP address but I can't
find
anything for getting the IP address my network is on.

I was thinking I could make a HTTP Request to a server which displays your
IP address as they see it and scrape it out of the response but I was
hoping
for a method which is less dependent on some server out on the web...

May 17 '06 #2

P: n/a
Hi,

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eP**************@TK2MSFTNGP05.phx.gbl...
MrNobody,

What do you mean the IP address of your network? There is no such
thing. Your network is composed of different machines all connected to
each other. There is no single one IP address for the network.

What are you trying to do?


I think he means the IP of the gateway he use to connect to the internet.
"Wan address" is how it;s usually described in most of the DSL modems
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
May 17 '06 #3

P: n/a
I was thinking I could make a HTTP Request to a server which displays your
IP address as they see it and scrape it out of the response but I was
hoping
for a method which is less dependent on some server out on the web...


Hi,

unfortunatelly it's the only way I know of. you may use a couple of them
just in case one fails
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
May 17 '06 #4

P: n/a
You playing the semantics game with me right?

The IP address of my network as seen outside my network.

For example, if I wanted to connect to a machine on my home network from
outside, I don't try conatacting the IP address I get when I type ipconfig
in the command prompt when I'm on that target machine at home, because that
is an IP address only known to my home network- and this is what most
examples of determining IP address gives you. Instead I have to connect to
my router's web interface to see what my WAN IP address is. Then I can
forward the request to the target machine.

So I need the IP address which my ISP has assigned to my home whether it's
going to a router, a computer, a switch- whatever (it's not static IP so
tht's why I need a way to find out via C#)
May 17 '06 #5

P: n/a
When you try and connect to your home network, you are connecting to a
single machine/device with a single IP address. The network itself doesn't
have one single address that you connect to. Rather, you have a point that
you expose which will grant you access, such as a proxy server, a router, a
VPN server, etc, etc.

You could see it as semantics, but I consider a network to be a
multitude of devices, each with their own IP address. The network itself
doesn't have a single address, just the connection point you use to get to
the network, whatever that connection point is.

As for the answer to your question, it will depend on the router itself.
Some routers have an API that they expose which will allow you to get router
information from it. So based on the brand of your router, you should check
that route first.

If that doesn't work, most routers have a way of connecting through a
web browser to the router itself to get information about the router
(including the IP address it has on the Internet). You should be able to
make a request to that and then scrape that information.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
You playing the semantics game with me right?

The IP address of my network as seen outside my network.

For example, if I wanted to connect to a machine on my home network from
outside, I don't try conatacting the IP address I get when I type
ipconfig
in the command prompt when I'm on that target machine at home, because
that
is an IP address only known to my home network- and this is what most
examples of determining IP address gives you. Instead I have to connect
to
my router's web interface to see what my WAN IP address is. Then I can
forward the request to the target machine.

So I need the IP address which my ISP has assigned to my home whether it's
going to a router, a computer, a switch- whatever (it's not static IP so
tht's why I need a way to find out via C#)

May 17 '06 #6

P: n/a
Hi,

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
You playing the semantics game with me right?
More likely you did not explain correctly what you wanted in the first
place.
The IP address of my network as seen outside my network.
This also is incorrect, you may have several IPs assigned to your network by
your service provider.
For example, if I wanted to connect to a machine on my home network from
outside,
In most cases you will have another problem, you need to configure the
router to forward those packages to the correct internal computer.
Also none of the solutions given here will solve this problem, You
originally asked how to know the "external" IP from the internal network.
I don't try conatacting the IP address I get when I type ipconfig
in the command prompt when I'm on that target machine at home, because
that
is an IP address only known to my home network- and this is what most
examples of determining IP address gives you. Instead I have to connect
to
my router's web interface to see what my WAN IP address is. Then I can
forward the request to the target machine.

So I need the IP address which my ISP has assigned to my home whether it's
going to a router, a computer, a switch- whatever (it's not static IP so
tht's why I need a way to find out via C#)


May 17 '06 #7

P: n/a
If that doesn't work, most routers have a way of connecting through a
web browser to the router itself to get information about the router
(including the IP address it has on the Internet). You should be able to
make a request to that and then scrape that information.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com


Ah, good idea! Was thinking about contacting external servers for this when
I could just get it off my router's web interface.

Thanks for the help
May 17 '06 #8

P: n/a
Hi,

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
If that doesn't work, most routers have a way of connecting through a
web browser to the router itself to get information about the router
(including the IP address it has on the Internet). You should be able to
make a request to that and then scrape that information.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com


Ah, good idea! Was thinking about contacting external servers for this
when
I could just get it off my router's web interface.

I would go for the external servers. The router can be changed, more
important the password of the router can change more often. even it's
possible that you need to create a seesion.
May 18 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.