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 

Not working with multiple interfaces/IPs?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs
View previous topic :: View next topic  
Author Message
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Tue Feb 19, 2008 10:45 pm    Post subject: Not working with multiple interfaces/IPs? Reply with quote

Sorry, here is a dummy post so I can post with URLs

Last edited by jeff on Tue Feb 19, 2008 10:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Tue Feb 19, 2008 10:46 pm    Post subject: Reply with quote

Hello,

I compiled 1.0 on my Linux router. Linux 2.6.20, gcc 4.1.2, gentoo. My goal was to replace linux-igd, which did not work well for me.

NAT-PMP support is working fine with uTorrent. UPNP is not working and Windows is not recognizing the router as an IGD.

My network interfaces are lan0, lan1 (inactive), wlan0, and adsl0. I also have some tunnels set up. lan0 is internal, 192.168.1.253 & 192.168.1.254. adsl0 is external and has 6 IP addresses assigned to it.

If I run upnpscan I get this:

Code:
HTTP/1.1 200 OK
Cache-Control: max-age=120
ST: upnp:rootdevice
USN: uuid:c8eb69b2-48a5-465c-9000-bb29aeff202b::upnp:rootdevice
EXT:
Server: Linux/2.6.20-gentoo-r8 UPnP/1.0 miniupnpd/1.0
Location: http://192.168.1.254:5555/rootDesc.xml


I have copied the rootDesc output to a pastebin:

pastebin

The Microsoft IDG test, Test #5, reports this:
Code:
Result:

The operating system is Windows XP
UPnP is enabled by the firewall
UPnP services are running
UPnP Discovery is enabled
Detecting Internet Gateway Devices on the network
0 IGD(s) found
Failed to find any Internet Gateway Devices


If I run noeld's Universal Plug-and-Play Tester, 2.07 (44.5), it returns "search complete" with no UPnP devices available. I can clearly see queries going to miniupnpd with tcpdump, and responses coming back.

During this run, the following log output is generated by miniupnpd:
Code:
@4000000047bb581b2cc58664 miniupnpd[12291]: system uptime is 5189066 seconds
@4000000047bb581b2cd67654 miniupnpd[12291]: HTTP listening on port 5555
@4000000047bb581b2cd86284 miniupnpd[12291]: Listening for NAT-PMP traffic on port 5351
@4000000047bb581f0d70b25c miniupnpd[12291]: HTTP connection from 192.168.1.123:3272
@4000000047bb581f0d7394a4 miniupnpd[12291]: HTTP REQUEST : GET /rootDesc.xml (HTTP/1.1)
@4000000047bb582538d7c00c miniupnpd[12291]: SSDP M-SEARCH from 192.168.1.123:3275 ST: upnp:rootdevice
@4000000047bb58260002dc6c miniupnpd[12291]: HTTP connection from 192.168.1.123:3278
@4000000047bb58260006fb1c miniupnpd[12291]: HTTP REQUEST : GET /rootDesc.xml (HTTP/1.1)
@4000000047bb582838e36484 miniupnpd[12291]: SSDP M-SEARCH from 192.168.1.123:3275 ST: upnp:rootdevice
@4000000047bb582b38e40894 miniupnpd[12291]: SSDP M-SEARCH from 192.168.1.123:3275 ST: upnp:rootdevice
@4000000047bb582e1dce5154 miniupnpd[12291]: HTTP connection from 192.168.1.123:3280
@4000000047bb582e1dce5d0c miniupnpd[12291]: HTTP REQUEST : GET /rootDesc.xml (HTTP/1.1)


So clearly, the daemon is being found and communicated with.

If I run Mark Gellespie's UPnP Test Program v1.15, my Windows machine passes Test #1-#6 and fails test #7 and #8.

uTorrent also makes a bunch of upnp requests and then reverts to NAT-PMP, which works fine. So something is not right with the upnp responses, I guess.

This is my configuration:
Code:
ext_ifname=adsl0
ext_ip=[redacted]
listening_ip=192.168.1.254/24
port=5555
enable_natpmp=yes
bitrate_up=1000000
bitrate_down=10000000
secure_mode=no
presentation_url=
system_uptime=yes
notify_interval=60
clean_ruleset_interval=600
uuid=c8eb69b2-48a5-465c-9000-bb29aeff202b
serial=12345678
model_number=1
allow 1024-65535 192.168.1.0/24 1024-65535
deny 0-65535 0.0.0.0/0 0-65535


Would it help if I post a wireshark capture? Any suggestions where to look for the problem so I can narrow this down?

Thank you!
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Feb 20, 2008 12:14 am    Post subject: Reply with quote

maybe you should comment the presentation_url= line.
Appart from that, I'm wondering which Souce IP is used by MiniUPNPd SSDP packets ?
(both notifies and m-search responses)
if its 192.168.1.254, thats ok, but if its 192.168.1.253 that would lead to problems.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Wed Feb 20, 2008 3:32 am    Post subject: Reply with quote

The presentation_url line doesn't seem to matter. I set it to nothing since there is no web page to configure the device. I think that is what it is meant to point to?

SSDP packets are on port 5555? All the traffic I see in tcpdump uses the correct IP addresses (.254)
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Feb 20, 2008 11:38 am    Post subject: Reply with quote

jeff wrote:
SSDP packets are on port 5555? All the traffic I see in tcpdump uses the correct IP addresses (.254)

SSDP traffic is on port 1900
port 5555 is for HTTP traffic.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Wed Feb 20, 2008 3:06 pm    Post subject: Reply with quote

Could SSDP be a problem still even after HTTP requests are being made?

I captured this with wireshark:





What is the purpose of the "Ext" header in the response?

The XML in the response is the same as I posted above. Is there a tool I can use to determine if it is properly formed?
Back to top
View user's profile Send private message
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Wed Feb 20, 2008 3:19 pm    Post subject: Reply with quote

Here is the SSDP conversation:



Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Feb 20, 2008 4:32 pm    Post subject: Reply with quote

just something : Is 192.168.1.254 the default gateway for your windows machine ? Else it could refuse to use its UPnP IGD service.

To answer your questions :
1) SSDP is normally used only for discovery, so once it is done, it should not matter.
2) http://www.upnp.org/standardizeddcps/igd.asp maybe something here can help you to verify the XML data...
3) the EXT: header is mandatory in SSDP headers (because it is HTTP Extension) but is useless in standard HTTP traffic... I should remove it

Code:
diff -u -r1.45 upnphttp.c
--- upnphttp.c  10 Mar 2007 23:43:53 -0000      1.45
+++ upnphttp.c  20 Feb 2008 16:31:12 -0000
@@ -377,7 +377,7 @@
        "Content-Length: %d\r\n"
        /*"Server: miniupnpd/1.0 UPnP/1.0\r\n"*/
        "Server: " MINIUPNPD_SERVER_STRING "\r\n"
-       "Ext:\r\n"
+       /*"Ext:\r\n"*/
        "\r\n";
 /*
                "<?xml version=\"1.0\"?>\n"

_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Wed Feb 20, 2008 4:39 pm    Post subject: Reply with quote

I compiled miniupnpc to do more testing.

I discovered that with MULTIPLE_EXTERNAL_IP defined, I get the following:

Code:
$ ./upnpc-static  -s
upnpc : miniupnpc library test client. (c) 2006-2008 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
 desc: http://192.168.1.254:5555/rootDesc.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.1.254:5555/ctl/IPConn
Local LAN ip address : 192.168.1.100
Connection Type : IP_Routed
Status : Connected, uptime=5251706
MaxBitRateDown : 10000000 bps   MaxBitRateUp 1000000 bps
GetExternalIPAddress() returned -1
GetExternalIPAddress failed.
Bytes:   Sent: 4118738528       Recv: 116869440
Packets: Sent: 131328169        Recv: 106931953


I undefined it and now it successfully returns the external IP address I want it to use.

The -l option correctly shows mappings created with NAT-PMP.

I am able to add/delete mappings with -a and -d.

So obviously, miniupnpd is working. The question remains, why won't Windows acknowledge it? I tried restarting the UPNP services several times. I even rebooted.
Back to top
View user's profile Send private message
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Wed Feb 20, 2008 4:45 pm    Post subject: Reply with quote

miniupnp wrote:
just something : Is 192.168.1.254 the default gateway for your windows machine ? Else it could refuse to use its UPnP IGD service.


Yes.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Feb 20, 2008 5:21 pm    Post subject: Reply with quote

I just tested my miniupnpd with a laptop runing Win XP (and msn messenger Wink
I dont understand what happen :
Code:
Feb 20 18:12:08 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:14956 ST: urn:schemas-upnp-org:service:WANPPPConnection:1
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:27028
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP REQUEST : GET /rootDesc.xml (HTTP/1.1)
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:21556
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:08 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetStatusInfo
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:6993
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:08 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:44093
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:08 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#DeletePortMapping
Feb 20 18:12:08 fontarabie miniupnpd[5992]: DeletePortMapping: external port: 1249, protocol: UDP
Feb 20 18:12:08 fontarabie miniupnpd[5992]: removing redirect rule port 1249 UDP
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:26350
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:08 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:58801
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:08 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping
Feb 20 18:12:08 fontarabie miniupnpd[5992]: AddPortMapping: external port 37349 to 192.168.14.33:11032 protocol UDP for: MsnMsgr (192.168.14.3Feb 20 18:12:08 fontarabie miniupnpd[5992]: redirecting port 37349 to 192.168.14.33:11032 protocol UDP for: MsnMsgr (192.168.14.33:11032) 3734Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:2357
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:08 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping
Feb 20 18:12:08 fontarabie miniupnpd[5992]: AddPortMapping: external port 30451 to 192.168.14.33:15871 protocol TCP for: MsnMsgr (192.168.14.3
Feb 20 18:12:08 fontarabie miniupnpd[5992]: redirecting port 30451 to 192.168.14.33:15871 protocol TCP for: MsnMsgr (192.168.14.33:15871) 3045Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:56244
Feb 20 18:12:08 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:08 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#DeletePortMapping
Feb 20 18:12:08 fontarabie miniupnpd[5992]: DeletePortMapping: external port: 30451, protocol: TCP
Feb 20 18:12:08 fontarabie miniupnpd[5992]: removing redirect rule port 30451 TCP
Feb 20 18:12:13 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:1049 ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1
Feb 20 18:12:13 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:1052
Feb 20 18:12:13 fontarabie miniupnpd[5992]: HTTP REQUEST : GET /rootDesc.xml (HTTP/1.1)
Feb 20 18:12:13 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:1054 ST: upnp:rootdevice
Feb 20 18:12:13 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:1057
Feb 20 18:12:13 fontarabie miniupnpd[5992]: HTTP REQUEST : GET /rootDesc.xml (HTTP/1.1)
Feb 20 18:12:16 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:1049 ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1
Feb 20 18:12:16 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:1054 ST: upnp:rootdevice
Feb 20 18:12:19 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:1049 ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1
Feb 20 18:12:19 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:1054 ST: upnp:rootdevice
Feb 20 18:12:24 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:7885 ST: urn:schemas-upnp-org:service:WANIPConnection:1
Feb 20 18:12:24 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:7885 ST: urn:schemas-upnp-org:service:WANPPPConnection:1
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:65469
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP REQUEST : GET /rootDesc.xml (HTTP/1.1)
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:7435
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:24 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetStatusInfo
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:9913
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:24 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:21735
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:24 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:17687
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:24 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping
Feb 20 18:12:24 fontarabie miniupnpd[5992]: AddPortMapping: external port 47068 to 192.168.14.33:4670 protocol TCP for: MsnMsgr (192.168.14.33Feb 20 18:12:24 fontarabie miniupnpd[5992]: redirecting port 47068 to 192.168.14.33:4670 protocol TCP for: MsnMsgr (192.168.14.33:4670) 47068
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:45518
Feb 20 18:12:24 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:24 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#DeletePortMapping
Feb 20 18:12:24 fontarabie miniupnpd[5992]: DeletePortMapping: external port: 47068, protocol: TCP
Feb 20 18:12:24 fontarabie miniupnpd[5992]: removing redirect rule port 47068 TCP
Feb 20 18:12:33 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:14937
Feb 20 18:12:33 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:12:33 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress
Feb 20 18:13:08 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:1075 ST: upnp:rootdevice
Feb 20 18:13:08 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:1078
Feb 20 18:13:08 fontarabie miniupnpd[5992]: HTTP REQUEST : GET /rootDesc.xml (HTTP/1.1)
Feb 20 18:13:11 fontarabie miniupnpd[5992]: SSDP M-SEARCH from 192.168.14.33:1075 ST: upnp:rootdevice
Feb 20 18:13:22 fontarabie miniupnpd[5992]: HTTP connection from 192.168.14.33:50804
Feb 20 18:13:22 fontarabie miniupnpd[5992]: HTTP REQUEST : POST /ctl/IPConn (HTTP/1.1)
Feb 20 18:13:22 fontarabie miniupnpd[5992]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress

So windows XP does discover the IGD, use it but nothing is displayed in Network connections and Mark Gillespie tool finds nothing http://www.markgillespie.co.uk/
I don't understand what is that mess Sad
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Wed Feb 20, 2008 6:00 pm    Post subject: Reply with quote

Ok, so I am not the only one. Smile

Is there a "known good version" which has worked for you under the same circumstances in the past?

Yours is getting further than mine, however, in that the Windows machine appears to talk to the /ctl interface.

My other Windows machine is running Server 2003, which doesn't support UPNP at all.

This is another good UPNP test tool: http://www.noeld.com/programs.asp?cat=dstools#upnptest ... I cannot get miniupnp to show up at all. Linux-igd shows up just fine.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Feb 20, 2008 6:29 pm    Post subject: Reply with quote

I haven't linux igd here. Can you post a diff of the XML descriptions ?
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jeff



Joined: 12 Feb 2008
Posts: 18

PostPosted: Wed Feb 20, 2008 6:32 pm    Post subject: Reply with quote

I removed it already Very Happy

I will build it again and see if I can get it working.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Feb 20, 2008 6:35 pm    Post subject: Reply with quote

If its about the root XML description, there hasn't been so much changes :
Working file: upnpdescgen.c
head: 1.42
symbolic names:
tag_1_0: 1.42
tag_1_0-RC4 to RC13: 1.41
tag_1_0_RC3: 1.39
tag_1_0-RC2: 1.38

And I think the recent RCxx were working properly with win XP
_________________
Main miniUPnP author.
https://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 -> miniupnpd Bugs All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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.