2

I'm looking if it's possible to give rights, to only allow the use of one network interface to a specific user on a Linux distribution.

My use case: I want, for my studies, testing the interconnection between about 30 servers, all listening on the same port. For now, I can only launch 7-8 VM and on them my server scripts due to physical material limitations. Even if I'm using a low resource consumption Linux distribution (like SliTaz). The scripts are requiring that I have multiple interfaces because they listening all on the same port.

What I think it can be possible to do, is duplicate an Ethernet interface on a single VM (30 times), create 30 different users, set for each user a different Ethernet interface and launch my server script on each user. Script will listen on each interface available, either a single interface available per user. My script is about 5Mo in RAM, so I don't have to launch 30*128Mo of VM and I can more easily create users, than duplicate VM, set MAC address and IPs on each VM.

I did see that it's possible to create multiple interfaces. How can I set rights on anetwork interface for a specific user? Or is there a better solution for this problem?

0

1 Answer 1

2

You should consider the possibility of using less resource-intensive virtualization options. The one I have in mind for your problem is the "network namespace", for which you find a simple yet sufficient introduction here.

With this minimalistic virtualization scheme, you endow each shell with exactly one (virtual!) NIC, no more no less. The overhead is the creation of a new shell per user, and you maintain the availability of all of your programs. You can then start different instances of the same program listening on the same port, of different interfaces.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .