network: bridge: add support for configuring locked ports (#36150)
"Recently" (as of 5.18) the Linux kernel gained the ability of locking bridge ports to restrict network access to authenticated hosts only. This is implemented by disabling automated learning and dropping incoming traffic from unknown hosts. User space is then expected to add fdb entries for authenticated hosts. Once a fdb entry exist, traffic for that host will be forwarded as expected. This was later extended with "Mac Authentication Bypass", where the locking was extended to fdb entries. In this mode the kernel adds fdb entries again automatically, but they are locked by default. To properly configure this, add two network options and one netdev option: * `LinkLocalLearning=` to prevent the kernel from creating unlocked entries based on link-local traffic, which would bypass any authentication. Needed when enabling learning on a locked port. * `Locked=` to allow setting a bridge port to locked. * `MACAuthenticationBypass=` to allow enabling Mac Authentication Bypass on a port. Requires learning to be enabled on the port as well (and consequently `LinkLocalLearning` disabled on the bridge). An authenticator (e.g. hostapd) is still needed to do the actual authentication, the kernel only provides the access control.
This commit is contained in:
@@ -485,6 +485,8 @@ static const struct NLAPolicy rtnl_bridge_port_policies[] = {
|
||||
[IFLA_BRPORT_MRP_IN_OPEN] = BUILD_POLICY(U8),
|
||||
[IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT] = BUILD_POLICY(U32),
|
||||
[IFLA_BRPORT_MCAST_EHT_HOSTS_CNT] = BUILD_POLICY(U32),
|
||||
[IFLA_BRPORT_LOCKED] = BUILD_POLICY(U8),
|
||||
[IFLA_BRPORT_MAB] = BUILD_POLICY(U8),
|
||||
};
|
||||
|
||||
static const NLAPolicySetUnionElement rtnl_link_info_slave_data_policy_set_union_elements[] = {
|
||||
|
||||
Reference in New Issue
Block a user