on <A HREF="#Clustering">Clustering</A> for more information.
</LI>
+<LI><B>cluster_port</B> (int udp port)<BR>
+UDP cluster port (default: 32792). See the section on
+<A HREF="#Clustering">Clustering</A> for more information.
+</LI>
+
<LI><B>cluster_interface</B> (string)<BR>
Interface for cluster packets (default: eth0).
</LI>
will drop all routes (raising them again if all slaves disappear) and
subsequently handle only packets forwarded to it by the slaves.<P>
+*Configurable with <B>cluster_master_min_adv</B><P>
+
+Multiple clusters can be run on the same network by just using different
+multicast <B>cluster_address</B>. However, for a given host to be part
+of multiple clusters without mixing the clusters,
+<B>cluster_port</B> must be different for each cluster.<B>
+
<H2 ID="Routing">Routing</H2>
If you are running a single instance, you may simply statically route
the IP pools to the <B>bind_address</B> (l2tpns will send a gratuitous
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>cluster_port</literal> (udp port)</term>
+ <listitem>
+ <para>
+ UDP cluster port (default: 32792).
+ See <xref linkend="clustering"/> for more information.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><literal>cluster_interface</literal> (string)</term>
<listitem>
<para>
An <command>l2tpns</command> cluster consists of one* or more
servers configured with the same configuration, notably the
- multicast <literal>cluster_address</literal>.
+ multicast <literal>cluster_address</literal> and the
+ <literal>cluster_port</literal>
</para>
<para>*A stand-alone server is simply a degraded cluster.</para>
Initially servers come up as cluster slaves, and periodically
(every <literal>cluster_hb_interval</literal>/10 seconds) send
out ping packets containing the start time of the process to the
- multicast <literal>cluster_address</literal>.
+ multicast <literal>cluster_address</literal> on
+ <literal>cluster_port</literal>.
</para>
<para>
</para>
<para>*Configurable with <literal>cluster_master_min_adv</literal></para>
+
+ <para>
+ Multiple clusters can be run on the same network by just using different
+ multicast <literal>cluster_address</literal>. However, for a given host to
+ be part of multiple clusters without mixing the clusters,
+ <literal>cluster_port</literal> must be different for each cluster.
+ </para>
</sect1>
<sect1 id="routing">
.\" ========================================================================
.\"
.IX Title "STARTUP-CONFIG.5 1"
-.TH STARTUP-CONFIG.5 1 "2015-09-22" "perl v5.20.2" "User Contributed Perl Documentation"
+.TH STARTUP-CONFIG.5 1 "2017-05-26" "perl v5.20.2" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.IP "\fBcluster_address\fR (ip address)" 4
.IX Item "cluster_address (ip address)"
Multicast cluster address (default: 239.192.13.13). See the section on Clustering for more information.
+.IP "\fBBcluster_port\fR (int)" 4
+.IX Item "Bcluster_port (int)"
+\&\s-1UDP\s0 cluster port (default: 32792). See the section on Clustering for more information.
.IP "\fBcluster_interface\fR (string)" 4
.IX Item "cluster_interface (string)"
Interface for cluster packets (default: eth0).
Multicast cluster address (default: 239.192.13.13). See the section on Clustering for more information.
+=item B<Bcluster_port> (int)
+
+UDP cluster port (default: 32792). See the section on Clustering for more information.
+
=item B<cluster_interface> (string)
Interface for cluster packets (default: eth0).
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- addr.sin_port = htons(CLUSTERPORT);
+ addr.sin_port = htons(config->cluster_port);
addr.sin_addr.s_addr = INADDR_ANY;
setsockopt(cluster_sockfd, SOL_SOCKET, SO_REUSEADDR, &addr, sizeof(addr));
if (!config->cluster_address) return 0;
addr.sin_addr.s_addr = config->cluster_address;
- addr.sin_port = htons(CLUSTERPORT);
+ addr.sin_port = htons(config->cluster_port);
addr.sin_family = AF_INET;
LOG(5, 0, 0, "Cluster send data: %d bytes\n", datalen);
return -1;
addr.sin_addr.s_addr = peer;
- addr.sin_port = htons(CLUSTERPORT);
+ addr.sin_port = htons(config->cluster_port);
addr.sin_family = AF_INET;
LOG_HEX(5, "Peer send", data, size);
cli_print(cli, "My address : %s", fmtaddr(my_address, 0));
cli_print(cli, "VIP address : %s", fmtaddr(config->bind_address, 0));
cli_print(cli, "Multicast address: %s", fmtaddr(config->cluster_address, 0));
+ cli_print(cli, "UDP port : %u", config->cluster_port);
cli_print(cli, "Multicast i'face : %s", config->cluster_interface);
if (!config->cluster_iam_master) {
+l2tpns (2.2.1.2fdn3.20) unstable; urgency=low
+
+ * Add cluster_port parameter for Multiple clusters (See clustering section for more informationc).
+
+ -- Fernando Alves <fendo@sameswifi.fr> Fri, 26 May 2017 23:25:10 +0200
+
l2tpns (2.2.1.2fdn3.19) unstable; urgency=low
* New revision format.
# Cluster multicast address, interface
#set cluster_address 239.192.13.13
+#set cluster_port 32792
#set cluster_interface eth0
# Cluster multicast TTL
CONFIG("icmp_rate", icmp_rate, INT),
CONFIG("packet_limit", max_packets, INT),
CONFIG("cluster_address", cluster_address, IPv4),
+ CONFIG("cluster_port", cluster_port, INT),
CONFIG("cluster_interface", cluster_interface, STRING),
CONFIG("cluster_mcast_ttl", cluster_mcast_ttl, INT),
CONFIG("cluster_hb_interval", cluster_hb_interval, INT),
memcpy(config->old_plugins, config->plugins, sizeof(config->plugins));
if (!config->multi_read_count) config->multi_read_count = 10;
if (!config->cluster_address) config->cluster_address = inet_addr(DEFAULT_MCAST_ADDR);
+ if (!config->cluster_port) config->cluster_port = CLUSTERPORT;
if (!*config->cluster_interface)
strncpy(config->cluster_interface, DEFAULT_MCAST_INTERFACE, sizeof(config->cluster_interface) - 1);
char epdis_addr[20]; // MP Endpoint Discriminator address
in_addr_t cluster_address; // Multicast address of cluster.
+ unsigned short cluster_port; // UDP port of cluster.
// Send to this address to have everyone hear.
char cluster_interface[64]; // Which interface to listen for multicast on.
int cluster_iam_master; // Are we the cluster master???