FreeBSD Jail Add Multiple IPv4 / IPv6 Address

www.laut‮ut‬ri.com
FreeBSD Jail Add Multiple IPv4 / IPv6 Address

To add multiple IPv4 or IPv6 addresses to a FreeBSD jail, you will need to do the following:

  1. Edit the /etc/jail.conf file and add the following lines for each additional IPv4 or IPv6 address:
ip4.addr += <IPv4 address>/<prefix length>
ip6.addr += <IPv6 address>/<prefix length>

Replace <IPv4 address> with the IPv4 address, such as 192.168.1.100, and replace <prefix length> with the prefix length value, such as 24. Replace <IPv6 address> with the IPv6 address, such as 2001:db8::1, and replace <prefix length> with the prefix length value, such as 64.

For example, to add the IPv4 address 192.168.1.100 with a prefix length of 24 and the IPv6 address 2001:db8::1 with a prefix length of 64 to a jail, you can add the following lines to the /etc/jail.conf file:

ip4.addr += 192.168.1.100/24
ip6.addr += 2001:db8::1/64
  1. Restart the jail by running the following command:
# service jail restart <jailname>

Replace <jailname> with the name of the jail.

This will add the additional IPv4 or IPv6 addresses to the jail.

For more information about configuring IPv4 and IPv6 addresses for a FreeBSD jail, you can refer to the FreeBSD documentation and the jail man page by running man jail on the command line.

Created Time:2017-10-28 20:40:35  Author:lautturi