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 

upnpc client can not find the server

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



Joined: 05 Dec 2013
Posts: 8
Location: china

PostPosted: Thu Dec 12, 2013 12:10 pm    Post subject: upnpc client can not find the server Reply with quote

Dear,

Any body can help me?
I have two devices, one installed upnp server(I don't know which server it installed)(name it Device A), and another run the miniupnpc client(name it Device B).
And now, device B's WAN interface connect to device A's one LAN interface, device B WAN interface get IP from device A's DHCP server.
The B's WAN ip is 192.168.0.101, A's LAN ip is 192.168.0.1. And i run ./upnpc -m eth0.1 -s on device B, but I can not get the valid IGD UPnP device.
# ./upnpc -m eth0.1 -s
upnpc : miniupnpc library test client. (c) 2005-2013 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
No IGD UPnP Device found on the network !

What should i do?

BTW, if device B's WAN interface config a fixed IP within the same subnet with device A's LAN ip, it works. So it's a bug?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Fri Dec 13, 2013 9:56 am    Post subject: Reply with quote

please copy paste the ouput of "ifconfig" command on device B

you should also try # ./upnpc -m 192.168.0.101 -s
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
nicky



Joined: 05 Dec 2013
Posts: 8
Location: china

PostPosted: Sat Dec 14, 2013 2:51 am    Post subject: Reply with quote

Here is the difference below.

1. Get ip via DHCP server.

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:12:AB:FE:D8:89
inet6 addr: fe80::212:abff:fefe:d889/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:20334 errors:0 dropped:0 overruns:0 frame:0
TX packets:2021 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2116481 (2.0 MiB) TX bytes:1390973 (1.3 MiB)
Interrupt:1

eth0.1 Link encap:Ethernet HWaddr 00:12:AB:FE:D8:89
inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::212:abff:fefe:d889/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:2002 errors:0 dropped:0 overruns:0 frame:0
TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:107096 (104.5 KiB) TX bytes:26892 (26.2 KiB)

eth0.2 Link encap:Ethernet HWaddr 00:12:AB:FE:D8:89
inet addr:192.168.11.89 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::212:abff:fefe:d889/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:17942 errors:0 dropped:0 overruns:0 frame:0
TX packets:1923 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1693303 (1.6 MiB) TX bytes:1363613 (1.2 MiB)

eth1 Link encap:Ethernet HWaddr 00:1A:1B:1C:1D:1E
inet6 addr: fe80::21a:1bff:fe1c:1d1e/64 Scope:Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:920 errors:0 dropped:0 overruns:0 frame:0
TX packets:462 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26168 (25.5 KiB) TX bytes:47946 (46.8 KiB)
Interrupt:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1232 (1.2 KiB) TX bytes:1232 (1.2 KiB)

# ./upnpc -m eth0.1 -s
upnpc : miniupnpc library test client. (c) 2005-2013 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
No IGD UPnP Device found on the network !
# ./upnpc -m 192.168.0.101 -s
upnpc : miniupnpc library test client. (c) 2005-2013 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
No IGD UPnP Device found on the network !
#
-------------------------------------------------------------------------------------
2. Use fixed IP address.
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:12:AB:FE:D8:89
inet6 addr: fe80::212:abff:fefe:d889/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:3064 errors:0 dropped:0 overruns:0 frame:0
TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:310006 (302.7 KiB) TX bytes:8477 (8.2 KiB)
Interrupt:1

eth0.1 Link encap:Ethernet HWaddr 00:12:AB:FE:D8:89
inet addr:192.168.0.115 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::212:abff:fefe:d889/64 Scope:Link
UP BROADCAST RUNNING MTU:1400 Metric:1
RX packets:511 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:28749 (28.0 KiB) TX bytes:1488 (1.4 KiB)

eth0.2 Link encap:Ethernet HWaddr 00:12:AB:FE:D8:89
inet addr:192.168.11.89 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::212:abff:fefe:d889/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:1867 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:190623 (186.1 KiB) TX bytes:6521 (6.3 KiB)

eth1 Link encap:Ethernet HWaddr 00:1A:1B:1C:1D:1E
inet6 addr: fe80::21a:1bff:fe1c:1d1e/64 Scope:Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:648 errors:0 dropped:0 overruns:0 frame:0
TX packets:326 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17478 (17.0 KiB) TX bytes:33802 (33.0 KiB)
Interrupt:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:116 (116.0 B) TX bytes:116 (116.0 B)

# ./upnpc -m eth0.1 -s
upnpc : miniupnpc library test client. (c) 2005-2013 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.0.1:10087/rootDesc.xml
st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.0.1:10087/ctl/IPConn
Local LAN ip address : 192.168.0.115
Connection Type : IP_Routed
Status : Connected, uptime=140161s, LastConnectionError : ERROR_NONE
Time started : Wed Dec 11 05:45:17 2013
MaxBitRateDown : 100000000 bps (100.0 Mbps) MaxBitRateUp 100000000 bps (100.0 Mbps)
ExternalIPAddress = 172.16.102.103
Bytes: Sent: 224710 Recv: 1388490
Packets: Sent: 800 Recv: 15112
# ./upnpc -m 192.168.0.115 -s
upnpc : miniupnpc library test client. (c) 2005-2013 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.0.1:10087/rootDesc.xml
st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.0.1:10087/ctl/IPConn
Local LAN ip address : 192.168.0.115
Connection Type : IP_Routed
Status : Connected, uptime=140175s, LastConnectionError : ERROR_NONE
Time started : Wed Dec 11 05:45:17 2013
MaxBitRateDown : 100000000 bps (100.0 Mbps) MaxBitRateUp 100000000 bps (100.0 Mbps)
ExternalIPAddress = 172.16.102.103
Bytes: Sent: 226311 Recv: 1425940
Packets: Sent: 820 Recv: 15566
#
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Mon Dec 16, 2013 4:32 pm    Post subject: Reply with quote

I have noticed that mtu is different between your DHCP and fixed IP configuration.
I don't think that matters for UDP traffic.

it's like setsockopt(.., IPPROTO_IP, IP_MULTICAST_IF, ...) doesn't work on your machine when the interface ip was obtained by DHCP.
but it does not return any error...

it is really strange. Or maybe multicast is disabled on the interface because of a bug in dhclient ?
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
nicky



Joined: 05 Dec 2013
Posts: 8
Location: china

PostPosted: Tue Dec 17, 2013 4:15 am    Post subject: Reply with quote

#!/bin/sh

# udhcpc script edited by Tim Riker <Tim@Rikers.org>

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/flash/bin:/flash/sbin

[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1

if [ -f "/flash/scripts/network.cfg" ]; then
. /flash/scripts/network.cfg
else
echo "can not fount /flash/scripts/network.cfg"
exit 1
fi

RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"

case "$1" in
deconfig)
ifconfig $interface 0.0.0.0
;;

renew|bound)
ifconfig $interface $ip $BROADCAST $NETMASK

if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface ; do
:
done

for i in $router ; do
route add default gw $i dev $interface
done
fi

echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF

if [ $USE_PEERDNS = "on" ];then
for i in $dns ; do
echo "adding dns $i"
echo "nameserver $i" >> $RESOLV_CONF
done
else
echo "nameserver $WAN_DNS1" >> $RESOLV_CONF
echo "nameserver $WAN_DNS2" >> $RESOLV_CONF
fi
;;
esac

exit 0

-------------------------------------------------------------------------------------

this is my udhcpc script.

Have you ever meet the problem, how to fix it?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Tue Dec 17, 2013 8:27 am    Post subject: Reply with quote

I have never heard of such problem...
check you multicast configuration :
Code:
# netstat -g -n

Also check routes :
Code:
# route -n

you may found a difference between your dhcp and fixed ip configurations...

It very unlikely a problem in miniupnpc as DHPC or fixed address just doesn't matter for miniupnpc, but it has something to do with your network configuration tools/scrips and maybe some kernel options.
I cannot help you much for that.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
nicky



Joined: 05 Dec 2013
Posts: 8
Location: china

PostPosted: Wed Dec 18, 2013 7:27 am    Post subject: Reply with quote

I built with DEBUG, it seems receive data timeout.
And I compared netstat and route under DHCP and fix mode, there is no differences, i think will lead the problem.
BTW, have you test it under DHCP mode, i really lost my way.
Back to top
View user's profile Send private message
nicky



Joined: 05 Dec 2013
Posts: 8
Location: china

PostPosted: Wed Dec 18, 2013 7:59 am    Post subject: Reply with quote

I capture the packets via wireshark, and the M-SEARCH and HTTP 200 OK both appeared. The flow is OK. So why the upnpc client can not receive the 200 OK reply data? Does some code issues cause the problem? Can you check it?

Files:
http://pan.baidu.com/disk/home
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Dec 18, 2013 8:52 am    Post subject: Reply with quote

nicky wrote:
BTW, have you test it under DHCP mode, i really lost my way.

I test miniupnpc always with DHCP. I think I almost never tested with a fixed IP address.

The standard setup is to use DHCP.
_________________
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 -> 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.