Different Netmasks for jails

Roger Gujord roger at gujord.com
Thu Jun 28 10:16:06 UTC 2007


Hi,
I'm about to set up jails for a production environment  and I stumbled 
across a problem with different netmasks for my jails.
How can I have a netmask like 255.255.255.128 for one jail and a netmask 
like 255.255.255.240 for another jail without creating static aliases at 
hosts boot-time in /etc/rc.conf ?
I would like the /etc/rc.d/jail to create the network aliases according 
to the jails respective network mask. I see that /etc/rc.d/jail sets the 
netmask to 255.255.255.255 for all network aliases.

Thanx! :-)
--Roger

This is my rc.conf:
-------------------------------------------------------------------------------

defaultrouter="192.168.1.49"
hostname="myhost.mydomain.com"
ifconfig_bge0="inet 192.168.1.1  netmask 255.255.255.128"

# FreeBSD jail:
jail_enable="YES"
jail_set_hostname_allow="YES"
jail_interface="bge0"
jail_devfs_enable="YES"
jail_devfs_ruleset="devfsrules_jail"
jail_procfs_enable="YES"
jail_socket_unixiproute_only="YES"

# Space separated list of names of jails:
jail_list="jailhosta jailhostb"

# Jail: jailhosta.mydomain.com (the netmask for this jail should be 
255.255.255.128)
jail_jailhosta_hostname="jailhosta.mydomain.com"
jail_jailhosta_ip="192.168.1.2"
jail_jailhosta_rootdir="/usr/jails/jailhosta.mydomain.com"

# Jail: jailhostb.mydomain.com (the netmask for this jail should be 
255.255.255.240)
jail_jailhostb_hostname="jailhostb.mydomain.com"
jail_jailhostb_ip="192.168.1.54"
jail_jailhostb_rootdir="/usr/jails/jailhostb.mydomain.com"



More information about the freebsd-jail mailing list