Source string Read only

(itstool) path: note/para
101/1010
Context English State
<acronym>CARP</acronym> functionality can be controlled via several <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> variables documented in the <citerefentry><refentrytitle>carp</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual pages. Other actions can be triggered from <acronym>CARP</acronym> events by using <citerefentry><refentrytitle>devd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Using <acronym>CARP</acronym> on FreeBSD 9 and Earlier
The configuration for these versions of FreeBSD is similar to the one described in the previous section, except that a <acronym>CARP</acronym> device must first be created and referred to in the configuration.
Enable boot-time support for <acronym>CARP</acronym> by loading the <filename>if_carp.ko</filename> kernel module in <filename>/boot/loader.conf</filename>:
if_carp_load="YES"
Next, on each host, create a <acronym>CARP</acronym> device:
<prompt>#</prompt> <userinput>ifconfig carp0 create</userinput>
Set the hostname, management <acronym>IP</acronym> address, the shared <acronym>IP</acronym> address, and <acronym>VHID</acronym> by adding the required lines to <filename>/etc/rc.conf</filename>. Since a virtual <acronym>CARP</acronym> device is used instead of an alias, the actual subnet mask of <literal>/24</literal> is used instead of <literal>/32</literal>. Here are the entries for <systemitem>hosta.example.org</systemitem>:
hostname="<replaceable>hosta.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.3</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0"
ifconfig_carp0="vhid <replaceable>1</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.50/24</replaceable>"
On <systemitem>hostb.example.org</systemitem>:
hostname="<replaceable>hostb.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.4</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0"
ifconfig_carp0="vhid <replaceable>2</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.51/24</replaceable>"
The third machine, <systemitem>hostc.example.org</systemitem>, is configured to handle failover from either of the master hosts:
hostname="<replaceable>hostc.example.org</replaceable>"
ifconfig_<replaceable>fxp0</replaceable>="inet <replaceable>192.168.1.5</replaceable> netmask <replaceable>255.255.255.0</replaceable>"
cloned_interfaces="carp0 carp1"
ifconfig_carp0="vhid <replaceable>1</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.50/24</replaceable>"
ifconfig_carp1="vhid <replaceable>2</replaceable> advskew <replaceable>100</replaceable> pass <replaceable>testpass</replaceable> <replaceable>192.168.1.51/24</replaceable>"
Preemption is disabled in the <filename>GENERIC</filename> FreeBSD kernel. If preemption has been enabled with a custom kernel, <systemitem>hostc.example.org</systemitem> may not release the <acronym>IP</acronym> address back to the original content server. The administrator can force the backup server to return the <acronym>IP</acronym> address to the master with the command:
<prompt>#</prompt> <userinput>ifconfig carp0 down &amp;&amp; ifconfig carp0 up</userinput>
This should be done on the <filename>carp</filename> interface which corresponds to the correct host.
VLANs
<primary><acronym>VLANs</acronym></primary>
<primary>Virtual LANs</primary>
<acronym>VLANs</acronym> are a way of virtually dividing up a network into many different subnetworks, also referred to as segmenting. Each segment will have its own broadcast domain and be isolated from other <acronym>VLANs</acronym>.
On FreeBSD, <acronym>VLANs</acronym> must be supported by the network card driver. To see which drivers support vlans, refer to the <citerefentry><refentrytitle>vlan</refentrytitle><manvolnum>4</manvolnum></citerefentry> manual page.
When configuring a <acronym>VLAN</acronym>, a couple pieces of information must be known. First, which network interface? Second, what is the <acronym>VLAN</acronym> tag?
To configure <acronym>VLANs</acronym> at run time, with a <acronym>NIC</acronym> of <literal>em0</literal> and a <acronym>VLAN</acronym> tag of <systemitem>5</systemitem> the command would look like this:
<prompt>#</prompt> <userinput>ifconfig <replaceable>em0.5</replaceable> create vlan <replaceable>5</replaceable> vlandev <replaceable>em0</replaceable> inet 192.168.20.20/24</userinput>
See how the interface name includes the <acronym>NIC</acronym> driver name and the <acronym>VLAN</acronym> tag, separated by a period? This is a best practice to make maintaining the <acronym>VLAN</acronym> configuration easy when many <acronym>VLANs</acronym> are present on a machine.
To configure <acronym>VLANs</acronym> at boot time, <filename>/etc/rc.conf</filename> must be updated. To duplicate the configuration above, the following will need to be added:
vlans_<replaceable>em0</replaceable>="<replaceable>5</replaceable>"
ifconfig_<replaceable>em0</replaceable>_<replaceable>5</replaceable>="inet 192.168.20.20/24"
Additional <acronym>VLANs</acronym> may be added, by simply adding the tag to the <literal>vlans_<replaceable>em0</replaceable></literal> field and adding an additional line configuring the network on that <acronym>VLAN</acronym> tag's interface.
It is useful to assign a symbolic name to an interface so that when the associated hardware is changed, only a few configuration variables need to be updated. For example, security cameras need to be run over VLAN 1 on <literal>em0</literal>. Later, if the <literal>em0</literal> card is replaced with a card that uses the <citerefentry><refentrytitle>ixgb</refentrytitle><manvolnum>4</manvolnum></citerefentry> driver, all references to <literal>em0.1</literal> will not have to change to <literal>ixgb0.1</literal>.
To configure <acronym>VLAN</acronym> <systemitem>5</systemitem>, on the <acronym>NIC</acronym> <literal>em0</literal>, assign the interface name <literal>cameras</literal>, and assign the interface an IP address of <systemitem class="ipaddress"><replaceable>192.168.20.20</replaceable></systemitem> with a <systemitem class="netmask">24</systemitem>-bit prefix, use this command:
<prompt>#</prompt> <userinput>ifconfig <replaceable>em0.5</replaceable> create vlan <replaceable>5</replaceable> vlandev <replaceable>em0</replaceable> name <replaceable>cameras</replaceable> inet <replaceable>192.168.20.20/24</replaceable></userinput>

Loading…

No matching activity found.

Browse all component changes

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: note/para
Flags
read-only
Source string location
book.translate.xml:65535
String age
a year ago
Source string age
a year ago
Translation file
books/handbook.pot, string 11310