About IP change

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a router plugged to my pc. I would like to know if there is a way of knowing the WAN side ip through C# code. What I want to do is being alerted about changes of my router WAN side ip.

Thanks
 
There's no way to know from the inside, unless your router has some sort of
API (very unlikely) or has SNMP available. If it has SNMP information
available, you may be able to find out, but SNMP is a big can of worms.

There are sites, such as www.whatismyip.com which, assuming you're using NAT
inside the router, will tell you what the routers IP address is, so you
could get the page and parse the IP address out of it.

Other than those options, I'm not sure what else you could do.

Iker Llanos said:
I have a router plugged to my pc. I would like to know if there is a way
of knowing the WAN side ip through C# code. What I want to do is being
alerted about changes of my router WAN side ip.
 
1) If the router has a telnet interface, you could kinda script it and parse
the output of the command.
2) If web interface, you could scrape the html (ug.) Or do the same thing
with something like www.network-tools.com
3) If you had access to (hosting co., friend, etc) another windows box on
the outside, you could create a remoting/web service on that box that
returns your IP to you when ever you call that method.
Probably others. hth
--
William Stacey, MVP

Iker Llanos said:
I have a router plugged to my pc. I would like to know if there is a way
of knowing the WAN side ip through C# code. What I want to do is being
alerted about changes of my router WAN side ip.
 
Back
Top