nmcli: limit number of active connections

Jeppe

Is it possible to set a max number of clients on an ethernet-interface created with nmcli?

Example: I would like max 2 devices to get a successful connection, even if I add a network-switch and connect 10 devices.

Marcus Müller

That's not how Ethernet works; there's no "connections" in ethernet; that's a concept from two layers higher.

So, you could try to make a firewall behave in a way that limits specific kind of activity, e.g. the ability to send TCP/IP packets, to a certain number of IP addresses. This would probably mean writing a daemon or BPF script beyond my experience in the Linux networking stack, to monitor the number of clients.

But: What is the number of clients?

  • IP addresses? Do you mean IPv4 or IPv6? Everyone can just pick as many IP addresses as they like for themselves, and matter of fact, a lot of system services rely on temporary or auto-configured or default addresses. This is neither a good protection (I could steal the IP address of someone who currently has "allowance"), nor is it even superficially save against denial of service (2 lines of shell code give me a 10000 IP addresses on my interface, good night, neighbor!).
  • Ethernet MAC addresses? Same problem as IP, these can be picked arbitrarily, and especially in environment with moving equipment/wireless access, these are often randomized
  • Established TCP/IP connections to the service: now we're talking. Your service is itself in control of this, and could simply reject connections under circumstances that seem to be clear only to the service itself!

In all honesty, this sounds like an application-level problem you're trying to solve at some deeper layer in the network. But the deeper layers of the network were never meant for access control. Simply don't. Whatever the service is your clients access, make it have authentication and a notion of a session – and simply reject if the maximum number of sessions is exhausted.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Troubleshooting the websocket limit in Azure, active connections

Limit number of simultaneous connections to same user account

Spring Boot - Limit on number of connections created

How to limit the number of simultaneous connections in Twisted

Limit number of connections per second in Apache HttpClient

Limit number of connections to instances with AWS ELB

Number of active connections on the server reached to max

How to get number of idle and "active" connections in Go?

Active Azure Sql Connections are over the connection pool limit

How to limit the number of active Spring WebClient calls

Use channel to limit the number of active go routines

How to limit the number of active streams in RxJava merge()?

Is there way to limit number of active instance of particular orchestration?

Limit max number of connections coming from a specific IP address

How to limit the number of connections to a socket and trigger timeout on client (Python)

How do I limit the number of connections Jetty will accept?

IPtables : Limit number of new ssh connections per minute

IPtables : Limit number of new ssh connections per minute

Does running under local IIS limit the number of Signalr connections

How to get the number of apache's HttpClient active connections?

Is it possible to get number of active connections with Pusher from API

Mysqlnd active connections number is too big. Is this normal?

Azure Sql request limit reached although the number of connections is well below the resource limit

check with nmcli device wifi if there's an active connection

Does limiting the maximum number of concurrent connections also limit the number of concurrent requests?

Limit connections to server

Unknown limit for Websocket connections

Correctly limit IP connections

how do I attach devices to connections using nmcli?