Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Mar 2016 21:37:41 +0200
From:      Niklaas Baudet von Gersdorff <stdin@niklaas.eu>
To:        freebsd-questions@freebsd.org
Subject:   Re: Variables substitution in jail.conf
Message-ID:  <20160330193741.GD1256@box.niklaas.eu>
In-Reply-To: <859c4fbee2fd75910dcc4b85dd2c7f8e@gritton.org>
References:  <7fbd35d23c23fb734bc10643a06f2d78@gritton.org> <859c4fbee2fd75910dcc4b85dd2c7f8e@gritton.org>

next in thread | previous in thread | raw e-mail | index | archive | help
James Gritton [2016-03-30 12:57 -0600] :

> Sure, you've already got some custom variables in the jail definition,
> $id and $network.  You can also have some on the global side.
> Something like:
> 
>      $addr4 = "10.15.$network.$id";
>      $addr6 = "2a00:XXX:XXXX:XXXX:X::$network:$id";
>      ip4.addr = "lo1|$addr4";
>      ip6.addr = "vnet0|$addr6";
> 
>      www {
>          $id = 1;
>          $network = 1;
>          exec.poststart = "pfctl -t www -T add $addr4 $addr6"
>          exec.poststop = "pfctl -t www -T delete $addr4 $addr6"
>      }
> 
> I haven't tested that, so I'm not sure it's 100% correct, but something along
> those lines should work.

James, thanks. It's not my dollar-sign-day today. I forgot to add a $ in front
of the variables in the preamble. No wonder it wasn't working. I will try your
version. I'm sure it's going to work.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160330193741.GD1256>