# UPnP inside jail does not work, fine outside



## Sephiroth (Apr 23, 2010)

I had another thread with related questions here, but now that I've narrowed down the problem I think another thread with a better title is in order.

I've been on a quest to get a UPnP server working on my FreeBSD box. I'm using service jails, setup as per the Handbook, for everything on the box. I have not been able to get any UPnP server working until today, when I broke down and installed uShare in the main/non-jail server- and lo and behold it works perfectly.

This tells me that something libupnp is doing on initialization is being prevented in my jails, but I have no idea what that would be. Seems like it must be restriction of the jail environment; I already allow rawsockets in the jails and access to /dev in the jail I want to run the media server in. What else could be holding things up? I'm out of ideas, so I'm looking for things to check or investigate. Thanks!


----------



## pronate (Nov 27, 2010)

*UPNP/DLNA within a Jail*

I had the same problem and discovered that it was because my jail's network interface did not have the correct broadcast address set.

Compare the broadcast address of you host interface with that of the alias associated with your jail. You can use [cmd=]ifconfig <interface> alias <jail-address> broadcast <broadcast-address>[/cmd] to correct your jail's broadcast address. Don't forget to make a corresponding change in rc.conf.local.

I hope this helps.

Cheers.


----------



## Sephiroth (Dec 10, 2010)

I just tried your advice. ifconfig inside the jail reported originally an IP of 192.168.13.35/32, with a broadcast address of 192.168.13.35. I reconfigured it in the host machine rc.conf to


```
ifconfig_em0_alias4="inet 192.168.13.35/24 broadcast 192.168.13.255
```

After trying a few variations of the subnet mask. I restarted the networking system with


```
/etc/rc.d/netif restart && /etc/rc.d/routing restart
```

And now it seems to be correct, ifconfig inside the jail reports what I would consider a proper address. However, the netif restart reports problems (ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address), but everything seems to be great according to ifconfig after it's done.

This fixed some stuff. For instance, I can get MediaTomb to run, past the point of initializing UPnP, where it used to fail. So that's good, we're on the right track. Thanks!

However, I still can't see the server via a UPnP video client. Something is still screwy. The mediatomb docs say you may need to run this command:


```
#route add -net 239.0.0.0 netmask 255.0.0.0 eth1
# ifconfig eth1 allmulti
```

But the allmulti part crashes my network interface, badly. I'm not sure where I would even run that. Any ideas?


----------



## woodsb02 (Nov 29, 2014)

Whilst this is a very old thread, I wanted to make sure anyone reading it knows the answer about this ALLMULTI thing.

ALLMULTI is the Linux equivalent of FreeBSD's MULTICAST flag. Refer the this forum thread: Thread 13270


----------

