You can assign different network configuration to a process using linux network namespaces. In theory it should be possible to configure PAM* to set each user in its own separate network namespace, but it is likely simpler to launch the application in question in its own namespace instead.
A common setup might describe creating a Linux bridge interface to connect the namespaces to network. A bit simpler setup can be archived using ipvlan (included in kernel versions 3.19 and above) or macvlan device (for wireless you can't use macvlan). Linux kernel documentation has a detailed example for setting up ipvlan in network namespace.
Following the example in the documentation:
Create a network namespace ns0
ip netns add ns0
Create ipvlan slave on eth0 (master device)
ip link add link eth0 ipvl0 type ipvlan mode l2
Assign slaves to the network namespace ns0
ip link set dev ipvl0 netns ns0
Configure the slave device in network namespace ns0
ip netns exec ns0 ip link set dev ipvl0 up
ip netns exec ns0 ip link set dev lo up
ip netns exec ns0 ip -4 addr add 127.0.0.1 dev lo
ip netns exec ns0 ip -4 addr add $IPADDR dev ipvl0
ip netns exec ns0 ip -4 route add default via $ROUTER dev ipvl0
Provide host and router addresses in
Run your application in network namespace using
ip netns exec ns0 <command>
To run the command as different user, use the usual
su <user> -c -- <command>.
* EDIT: From theory to practice: I've written a simple PAM module to demonstrate how to change the network namespace per user. You need to configure a network namepsace with
ip netns like above and map specific users to specific a namespaces. Afterwards all user processes will be in their configured namespace instead of the default one. The code is hosted on github. Use at your own peril.