A server stack is the collection of software that forms the operational infrastructure on a given machine. In a computing context, a stack is an ordered pile. A server stack is one type of solution stack — an ordered selection of software that makes it possible to complete a particular task. Like in this post about Automatically binding applications to a network interface based on the account they are started with was one problem in server stack that need for a solution. Below are some tips in manage your linux server when you find problem about linux, networking, user-accounts, , .
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.
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