UPnP inside jail does not work, fine outside

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!
 
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.
 
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

Code:
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

Code:
/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:

Code:
#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?
 
I used vnet instead of ip4.addr in jail.conf and it worked fine inside jail.

% cat /jails/jellyfin/etc/rc.conf
ifconfig_e0b_jellyfin="inet 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255"



# cat /etc/jail.conf.d/jellyfin.conf
## jellyfin jail config

exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
exec.clean;
mount.devfs;
mount.fstab = "/jails/jellyfin.fstab";
path = "/jails/jellyfin";

## jail
jellyfin {
host.hostname = "jellyfin.home.lan";
allow.raw_sockets = 1;
allow.mlock = 1;
vnet;
vnet.interface = "e0b_jellyfin"; # vnet interface(s)
exec.prestart += "jib addm jellyfin re0";
exec.poststop += "jib destroy jellyfin";
devfs_ruleset="5"; #devfs ruleset for this jail
}
 
Back
Top