Plex within a FreeBSD jail
For downloading metadata plex uses 127.0.0.1
therefore the
jail needs to have a loopback interface.
Create a lo1
interface, add to rc.conf
:
cloned_interfaces="lo1"
Add first the loopback IP in the jail.conf
:
plex {
ip4.addr = lo1|127.0.2.1;
ip4.addr += igb0|172.16.8.2;
path = "/fabrik/jail/plex";
}
This will add as the main IP 127.0.2.1
.
Inside a jail, access to the loopback address 127.0.0.1 is redirected to the first IP address assigned to the jail. To make the jail loopback correspond with the new lo1 interface, that interface must be specified first in the list of interfaces and IP addresses given when creating a new jail.
Edit /etc/hosts
in the jail so that localhost uses IP 127.0.2.1
:
127.0.2.1 localhost localhost.your.domain
🔗Claiming your server
You claim/configure your new plex server, you need to run it on a private network, and later just redirect / forward the port so that It can be reached from plex.tv/web.
rdr on $ext_if proto tcp from any to any port 32400 -> 172.16.8.2 port 32400