<br><br><div><span class="gmail_quote">On 11/9/06, <b class="gmail_sendername">Tim Williams</b> <<a href="mailto:tim@tdw.net">tim@tdw.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 8 Nov 2006 15:35:31 -0800, NicolasG <<a href="mailto:nicolasg@gmail.com">nicolasg@gmail.com</a>> wrote:<br>> How can I use python to get the real IP address of my DSL router (when<br>> my PC is part of the local home LAN) ?
<br><br>The router will the PC's default gateway IP address,  if you are on a<br>windows platform,  you can view it by typing IPCONFIG (enter) from a<br>command prompt.</blockquote><div><br>This is the  router local IP, I need to get the router "outside" IP witch is the real one. 
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">A quick google, gave me this,  look at the comments at the end for an<br>example of finding the Default Gateway IP address using Python
<br><br><a href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/162994">http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/162994</a></blockquote><div><br><pre class="code"><span class="syntaxkeyword">import
</span> win32api raise the error "module not exsit"<br>and <br>socket.gethostbyname(name)</pre>the router doesn't have a hostname.<br><br>cheers ;)<br clear="all"></div></div><br>-- <br>Nicolas G<br><br>Skype: nicolasg_
<br>mobile: +30 69 45 714 578