Im looking for a way to have applications started from different accounts automatically bind to a specific network interface. For example: applications started on accountA bind to eth0 and applications started from accountB bind to eth1. Is there any way I can accomplish this? I hope this is easier to understand.
I would like to do this because im looking to share a dedicated server with someone. It would be beneficial if we could have account specific ip's so we could both run services requiring the same port without the hassle of trying to bind every application.
Linux – Automatically binding applications to a network interface based on the account they are started with
linuxnetworkinguser-accounts
Related Topic
- Samba – Joining Samba to Active Directory with local user authentication
- Linux – Specifying a preferred route when there are multiple links to same network
- Linux – bridge network between two linux servers
- Linux – eth0 and eth1 both assigned same IP on boot
- Linux – Two NICs, one with static ip and one DHCP. IP Policy routing
- Windows – Share desktop and documents folders among multiple Windows accounts
- Linux – In Linux, how can I automatically assign an IPv6 address to an interface based upon its IPv4 address at boot time
Best Answer
First you have to configure all interfaces with their own routing tables (look at /etc/iproute2/rt_tables). Then you need to mark traffic based on UID. Use ipt_owner module for that. Then add routing rules for these marks (fwmark). This is good start for such exercise: Linux Advanced Routing & Traffic Control HOWTO