mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 02:20:12 +01:00
Add a way to configure MLAG NFT rules for SLB bonding. OVS supports "bonding-slb" (source load balancing, [1]). This is basically setting "mode=balance-xor" and "xmit_hash_policy=vlan+srcmac", which requires no special switch configuration (like LACP). For that to work, we need to filter out packets that the switch sends back on the other port, for which we configure some NFT rules. The rules are taken from mlag.sh at [2] or [3]. See-also: https://bugzilla.redhat.com/show_bug.cgi?id=1724795 [1] https://docs.openvswitch.org/en/latest/topics/bonding/#slb-bondin [2] https://gitlab.com/egarver/virtual-networking [3] https://gitlab.com/jtoppins_redhat/bond-slb-nft
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2004 - 2016 Red Hat, Inc.
|
|
* Copyright (C) 2005 - 2008 Novell, Inc.
|
|
*/
|
|
|
|
#ifndef __NM_FIREWALL_UTILS_H__
|
|
#define __NM_FIREWALL_UTILS_H__
|
|
|
|
typedef enum {
|
|
NM_FIREWALL_BACKEND_UNKNOWN,
|
|
NM_FIREWALL_BACKEND_NONE,
|
|
NM_FIREWALL_BACKEND_IPTABLES,
|
|
NM_FIREWALL_BACKEND_NFTABLES,
|
|
} NMFirewallBackend;
|
|
|
|
NMFirewallBackend nm_firewall_utils_get_backend(void);
|
|
|
|
/*****************************************************************************/
|
|
|
|
typedef struct _NMFirewallConfig NMFirewallConfig;
|
|
|
|
NMFirewallConfig *nm_firewall_config_new_shared(const char *ip_iface, in_addr_t addr, guint8 plen);
|
|
|
|
void nm_firewall_config_free(NMFirewallConfig *self);
|
|
|
|
void nm_firewall_config_apply_sync(NMFirewallConfig *self, gboolean up);
|
|
|
|
/*****************************************************************************/
|
|
|
|
void nm_firewall_nft_call(GBytes *stdin_buf,
|
|
GCancellable *cancellable,
|
|
GAsyncReadyCallback callback,
|
|
gpointer callback_user_data);
|
|
|
|
gboolean nm_firewall_nft_call_finish(GAsyncResult *result, GError **error);
|
|
|
|
GBytes *nm_firewall_nft_stdio_mlag(gboolean up,
|
|
const char *bond_ifname,
|
|
const char *const *bond_ifnames_down,
|
|
const char *const *active_members,
|
|
const char *const *previous_members);
|
|
|
|
#endif /* __NM_FIREWALL_UTILS_H__ */
|