ethrbunny has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone tried using Net::UPnP to communicate from XP to a dd-wrt based router?

I tried to RTFM but I didn't find much beyond the sample code. I'd be curious to know if anyone has made progress using this module.

Replies are listed 'Best First'.
Re: UPnP - port forward through a router?
by jettero (Monsignor) on Oct 09, 2007 at 13:06 UTC

    Wow. Out of curiosity, I clicked through the docs a little. If you ever figure this out, please consider writing a mini-tutorial for the tutorial section or as a meditation. There's a lot of stuff to look at in that dist.

    Personally, I'm curious about using this stuff to write a UPnP server that has a few more features than igd.

    Is it the case that dd-wrt doesn't do UPnP and you wish to add it with perl? or you wish to access the UPnP that dd-wrt has from XP? Either way, I'd be somewhat surprised if it wasn't built into both.

    -Paul

      Is it the case that dd-wrt doesn't do UPnP and you wish to add it with perl? or you wish to access the UPnP that dd-wrt has from XP? Either way, I'd be somewhat surprised if it wasn't built into both.

      From the dd-wrt docs it appears that UPnP is built in. Im trying to figure out the logistics of getting from a perl script out through the XP firewall and then out through the router. For some reason I think this is do-able. It may be folly though.

      Here's a bit from the dd-wrt docs: http://www.dd-wrt.com/wiki/index.php/Port_Forwarding

        There might be a way to ask XP to ask dd-wrt to DNAT the port on your behalf... Otherwise, it appears Net::UPnP is designed to do what you're looking to do. It's just a matter of navigating that documentation.

        It seems you want to make a control point, somehow locate the devices, and then issue a postaction. I'm fuzzy on the details, but I bet it looks something like this:

        use Net::UPnP::ControlPoint; my $obj = Net::UPnP::ControlPoint->new(); my @dev_list = $obj->search(st =>'????', mx => 3); my $service = $dev->getservicebyname('?????'); $service->postaction('????', { ??? => ???});

        -Paul