miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UPNP_GetExternalIPAddress returning wrong address

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs
View previous topic :: View next topic  
Author Message
costello



Joined: 25 Aug 2015
Posts: 1

PostPosted: Tue Aug 25, 2015 7:55 pm    Post subject: UPNP_GetExternalIPAddress returning wrong address Reply with quote

Dear Sirs,

I'm using UPNP_GetExternalIPAddress in ubuntu 14.04 and my code looks like this:

Code:

int status = UPNP_GetValidIGD(upnp_dev, &upnp_urls, &upnp_data, lan_address, sizeof(lan_address));
                // look up possible "status" values, the number "1" indicates a valid IGD was found
                QLOG_STR("UPNP_GetValidIGD = " + QString::number(status)) ;
                if ( status > 0 ) {
                    // get the external (WAN) IP address
                    char wan_address[64] = { 0 } ;
                    int getExternalError =
                        UPNP_GetExternalIPAddress(upnp_urls.controlURL, upnp_data.first.servicetype, wan_address);
                    QLOG_STR("Wan addr: " + QString(wan_address) + " error = " + QString::number(getExternalError)) ;

and the address I'm getting to wan_address is not the external IP addr of the router. I'm getting address 100.69.92.82 and that is not the correct one.

Options are that
1. I'm using UPNP_GetExternalIPAddress in wrong way?
2. The router in question is lying about the address (might be old telewell but not sure)
3. UPNP_GetExternalIPAddress as it is packed into ubuntu 14.04 is not fully functional?

Any suggestions?

--
Antti J, Oulu, Finland
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1469

PostPosted: Sun Oct 25, 2015 8:00 pm    Post subject: Reply with quote

well so what is 100.69.92.82 ?
see http://tools.ietf.org/html/rfc6598
miniupnpc is just returning what's the router publicizes. It is a bit strange the router is lying. it is more likely that the router get this address from the ISP which is then NATed when you reach the internet.

see what returns traceroute 8.8.8.8
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.