Agus Priyadi and Mafia.Or.ID

blog all about (brains colocations)

FreeBSD Jail Multiple IP

Posted by mafiaid on 14 August 2007

FreeBSD

www.digitaldaemon.com

FreeBSD www.freebsd.org has a subsystem called jails. Although jails are a subsystem for virtualization there are a couple of things the current jail subsystem does not do or allow. One of these things is multiple IP addresses being assigned to a jail. There are several patches available on the internet:

DragonFlyBSD www.dragonflybsd.org recently seems to have included support for multiple IP addresses per jail.
http://leaf.dragonflybsd.org/mailarchive/users/2006-11/msg00064.html

Since running jais with multiple IP addresses is a very nice feature to have to share hardware but separate netblocks and the patch mentioned as “Multiple Ip’s on FreeBSD 6.1-p3 jail” does not patch without errors on FreeBSD 6.2-STABLE this patch has been taken to create a new patch that should patch against FreeBSD 6.2.

FreeBSD_6.2-STABLE-mijail.patch

To apply the patch:
cd /usr
patch < ~/FreeBSD_6.2-STABLE-mijail.patch

Install patched header files:
cp /usr/src/sys/netinet/in_pcb.h /usr/include/netinet/
cp /usr/src/sys/sys/jail.h /usr/include/sys/

Remake the kernel and reboot.

Rebuild and install jail:
cd /usr/src/usr.sbin/jail/
make clean && make depend && make && make install

Rebuild and install jls:
cd /usr/src/usr.sbin/jls/
make clean && make depend && make && make install

Credit goes to the many people that have worked on this patch and have moved it from version to version.

FreeBSD

www.digitaldaemon.com

2 Responses to “FreeBSD Jail Multiple IP”

  1. Niklas CA said

    [root@services /usr/src/usr.sbin/jail]# make clean && make depend && make install
    rm -f jail jail.o jail.8.gz jail.8.cat.gz
    install -s -o root -g wheel -m 555 jail /usr/sbin
    install: jail: No such file or directory
    *** Error code 71

    Stop in /usr/src/usr.sbin/jail.

    FreeBSD services.shells.hu 6.3-RELEASE-p2 FreeBSD 6.3-RELEASE-p2 #1: Tue May 6 09:32:18 UTC 2008 root@services.shells.hu:/usr/src/sys/i386/compile/shells i386

    I changed the src to 6.3 instead of 6.2, in the patch.

    Regards, Niklas CA.

  2. Alexwebmaster said

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: