FreeBSD: IPv6 Configuration Set Prefixlen Value

ww‮ruttual.w‬i.com
FreeBSD: IPv6 Configuration Set Prefixlen Value

In IPv6, the prefix length value is used to specify the number of bits in the network prefix of an IPv6 address. The prefix length value is used to determine the network portion of the address and the host portion of the address.

To set the prefix length value for an IPv6 address on a FreeBSD system, you will need to do the following:

  1. Edit the /etc/rc.conf file and add the following line:
ifconfig_<interface>_ipv6="<IPv6 address>/<prefix length>"

Replace <interface> with the network interface name, such as em0, and 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 set the IPv6 address 2001:db8::1 with a prefix length of 64 for the em0 interface, you can add the following line to the /etc/rc.conf file:

ifconfig_em0_ipv6="2001:db8::1/64"
  1. Restart the network interface by running the following command:
# service netif restart <interface>

Replace <interface> with the network interface name, such as em0.

This will configure the IPv6 address and prefix length value for the specified network interface.

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

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