Is there a way to make only one specific network interface (e.g. eth3) available to a process so that no other interfaces are visible?
2 Answers
There is a unix saying everything is a file. If your program gets filesystem access, it can at least see all devices (if access rights are set so, which they probably are).
The easy solution could be virtualization, like using KVM or User Mode Linux.
In the last years firejail way gain a popularity.
Example: firejail --net=eth0 firefox
which means limit firefox to eth0 interface.
Website and github link with firegail source code: https://firejail.wordpress.com/ https://github.com/netblue30/firejail
In my ubuntu 22.04 I can install with just sudo apt install firejail
-
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.– Community BotApr 10, 2023 at 14:27