How I Run FreeBSD Jails
Here is a quick rundown of how I run FreeBSD jails.
Something I should have mentioned was the pf rules for forwarding traffic from the jail out to the internet. This would go in the /etc/pf.conf file:
NET_JAIL="192.168.100.0/24"
...
nat on $ext_if from $NET_JAIL to any -> ($ext_if:0)
# This assumes $ext_if is setup in the pf.conf file as well.
Here are the commands to get setup:
# setup lo1 on startup
sysrc cloned_interfaces+="lo1"
# setup zfs datasets
zfs create -o mountpoint=/usr/jails zroot/jails
zfs create zroot/jails/basejail
# install a base system
bsdinstall jail /usr/jails/basejail
# snapshot and clone
zfs snapshot zroot/jails/basejail@start
zfs clone zroot/jails/basejail@start zroot/jails/newjail
Jail configuration example:
newjail {
host.hostname = "newjail";
mount.devfs;
exec.clean;
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
path = "/usr/jails/newjail";
ip4.addr = "lo1|192.168.100.100/24";
}
For custom hosting and development:
-
2:39
Super Server Hero
1 year agopfSense: Using Jails
29 -
21:22
RoboNuggie
9 months agoFIFTY FreeBSD Commands you *SHOULD* know!
281 -
10:28
Solve Computer Science
9 months agoHow to run a self hosted AI
8 -
3:32
Ribalinux
8 months ago $0.01 earnedGhostBSD 23.10.1 overview | A simple, elegant desktop BSD Operating System
811 -
11:55
RoboNuggie
5 months agoRoboBSD v.01 - OOTB Raspberry Pi FreeBSD
4 -
0:41
AHMEDKAZEKA97
2 years agoFREE FULL COURSE Complete Linux Course + Bash Scripting – DevOps Path
378 -
8:07
The Intellectual Wilderness
1 year agoErlang: Easy and fast creation of web service with Cowboy and ZX
19 -
3:35
Ribalinux
4 months agoGhostBSD 24.01.1 overview | A simple, elegant desktop BSD Operating System
45 -
2:13
Home Steady Tribe
1 year agoHow to bake Tezos?
23 -
4:48
Ribalinux
10 months agosiduction 23.1 overview | the community based OS
23