Professional Documents
Culture Documents
Virtually-Networked
FreeBSD Jails
Shawn Webb
shwebb@wayfair.com
Who Am I
Whats Covered
Quick history
1. Jails, virtual networking, and ZFS
History of Jails
History of ZFS
Gotchas
1. No pf or ipf support
2. Must use IPFW
# Kernel Config
options VIMAGE
options IPFIREWALL
options IPDIVERT
# rc.conf NAT
gateway_enable=YES
firewall_enable=YES
firewall_type=OPEN # Change!
natd_enable=YES
natd_interface=em0 # Change!
natd_flags=
Create bridge
epair devices
1. Pair of two ifconfig-able devices
(epair[n]{a,b})
2. Two ends of an ethernet cable
3. Plug one end into bridge
4. Plug other end into jail
# Initial installation
D=/jails/template
zfs create omountpoint=/jails
tank/jails
zfs create tank/jails/template
cd /usr/src
make installworld DESTDIR=$D
make distribution DESTDIR=$D
portsnap p $D/usr/ports fetch extract
# Set default route, DNS resolution
echo nameserver 4.4.4.4 > \
$D/etc/resolv.conf
# Set up
ifconfig
ifconfig
ifconfig
ifconfig
ifconfig
temporary vnet
bridge0 create
bridge0 inet 192.168.2.1
epair0 create
bridge0 addm epair0
epair0 up
10
11
So Many Commands!
12
Making it Easy
13
Demo
14
Future Work
Complete virtualization
1. Certain resources still shared (i.e. 127.0.0.1)
15