summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2008-09-24 15:18:27 +0000
committerru <ru@FreeBSD.org>2008-09-24 15:18:27 +0000
commit821d9baa1ce9dda48595b145423f58a40529bc7d (patch)
tree14b50a82c2da0bc90cab68cf10a52d019479b9c7
parent7993f2b8351de976133f9d13d4d0ca2c74818ac8 (diff)
downloadFreeBSD-src-821d9baa1ce9dda48595b145423f58a40529bc7d.zip
FreeBSD-src-821d9baa1ce9dda48595b145423f58a40529bc7d.tar.gz
Allow a jail's IP alias to be created with an arbitrary netmask.
MFC after: 3 days
-rwxr-xr-xetc/rc.d/jail4
-rw-r--r--share/man/man5/rc.conf.58
2 files changed, 10 insertions, 2 deletions
diff --git a/etc/rc.d/jail b/etc/rc.d/jail
index 87eab69..851bf3c 100755
--- a/etc/rc.d/jail
+++ b/etc/rc.d/jail
@@ -39,6 +39,7 @@ init_variables()
_procdir="${_rootdir}/proc"
eval _hostname=\"\$jail_${_j}_hostname\"
eval _ip=\"\$jail_${_j}_ip\"
+ eval _netmask=\"\${jail_${_j}_netmask:-255.255.255.255}\"
eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\"
eval _exec=\"\$jail_${_j}_exec\"
eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\"
@@ -93,6 +94,7 @@ init_variables()
debug "$_j mount enable: $_mount"
debug "$_j hostname: $_hostname"
debug "$_j ip: $_ip"
+ debug "$_j netmask: $_netmask"
debug "$_j interface: $_interface"
debug "$_j fib: $_fib"
debug "$_j root: $_rootdir"
@@ -297,7 +299,7 @@ jail_start()
continue;
fi
if [ -n "${_interface}" ]; then
- ifconfig ${_interface} alias ${_ip} netmask 255.255.255.255
+ ifconfig ${_interface} alias ${_ip} netmask ${_netmask}
fi
if [ -n "${_fib}" ]; then
_setfib="setfib -F '${_fib}'"
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 8f22f02..a664b8f 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 16, 2008
+.Dd September 24, 2008
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -3450,6 +3450,12 @@ 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 _netmask
+.Pq Vt str
+Set to
+.Li 255.255.255.255
+by default.
+This is the IP netmask to use when setting IP address alias.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _fib
.Pq Vt str
Unset by default.
OpenPOWER on IntegriCloud