summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2009-01-07 15:31:46 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2009-01-07 15:31:46 +0000
commit7848e60158d04f4ce8a4b96be3df1dfa8a0d6e53 (patch)
tree2aaafe68c423dd4c07d747a95da2836630db7c8c
parent1500fd8ce2b29e60abecbaa47ed3018a6f7d779a (diff)
Notes
-rw-r--r--etc/defaults/rc.conf1
-rw-r--r--etc/rc.d/jail9
-rw-r--r--share/man/man5/rc.conf.57
3 files changed, 15 insertions, 2 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index d03fa4f3b5de..86649d5939f3 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -622,6 +622,7 @@ jail_sysvipc_allow="NO" # Allow SystemV IPC use from within a jail
#jail_example_hostname="default.domain.com" # Jail's hostname
#jail_example_ip="192.168.0.10" # Jail's IP number
#jail_example_interface="" # Interface to create the IP alias on
+#jail_example_fib="0" # routing table for setfib(1)
#jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting
#jail_example_exec_afterstart0="/bin/sh command" # command to execute after the one for
# starting the jail. More than one can be
diff --git a/etc/rc.d/jail b/etc/rc.d/jail
index d35f3f70f139..87eab69ab834 100644
--- a/etc/rc.d/jail
+++ b/etc/rc.d/jail
@@ -83,6 +83,7 @@ init_variables()
[ -z "${_flags}" ] && _flags="-l -U root"
eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\"
[ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log"
+ eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\"
# Debugging aid
#
@@ -93,6 +94,7 @@ init_variables()
debug "$_j hostname: $_hostname"
debug "$_j ip: $_ip"
debug "$_j interface: $_interface"
+ debug "$_j fib: $_fib"
debug "$_j root: $_rootdir"
debug "$_j devdir: $_devdir"
debug "$_j fdescdir: $_fdescdir"
@@ -297,6 +299,11 @@ jail_start()
if [ -n "${_interface}" ]; then
ifconfig ${_interface} alias ${_ip} netmask 255.255.255.255
fi
+ if [ -n "${_fib}" ]; then
+ _setfib="setfib -F '${_fib}'"
+ else
+ _setfib=""
+ fi
if checkyesno _mount; then
info "Mounting fstab for jail ${_jail} (${_fstab})"
if [ ! -f "${_fstab}" ]; then
@@ -350,7 +357,7 @@ jail_start()
fi
fi
_tmp_jail=${_tmp_dir}/jail.$$
- eval jail ${_flags} -i ${_rootdir} ${_hostname} \
+ eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \
${_ip} ${_exec_start} > ${_tmp_jail} 2>&1
if [ "$?" -eq 0 ] ; then
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index e5bce371c0d6..114a4c521e22 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 6, 2008
+.Dd September 16, 2008
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -3412,6 +3412,11 @@ These are flags to pass to
Unset by default.
When set, sets the interface to use when setting IP address alias.
Note that the alias is created at jail startup and removed at jail shutdown.
+.It Va jail_ Ns Ao Ar jname Ac Ns Va _fib
+.Pq Vt str
+Unset by default.
+When set, the jail is started with the specified routing table via
+.Xr setfib 1 .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _fstab
.Pq Vt str
Set to