I've been trying for the last few days to accomplish the following task:
I need to create a multi user environment for more than 5 users simultaneously and each user needs it's own different ip, but it can't be through SOCKS proxy, it must be something like VPN that affect all applications open on that user session. Users will use often the same application.
In my tests, I managed to get the multi user working with multiple RDP logins at Windows and also using Ubuntu with xrdp.
WINDOWS: I tried using OpenVPN, created multiple TAP interfaces to connect to multiple different vpn at the sime time, but it doesn't work: every user session get the IP from first connection. Also tried to use ForceBindIP to force the applications to one of the TAP interfaces, but the result was the same. Tried creating one different L2TP connection in each user, all users got the same IP too.
UBUNTU: With xrdp it wasn't different, used openvpn to connect to multiple vpn, and every user got the same ip all the same.
Is there anyway I can properly hook each user to only one interface, so everyone has a different ip address? Virtual machine isn't an option.
Thanks!
EDIT:
Followed @Enrico Bassetti tips. This is the output:
Output of ip route show:
default via 10.41.10.5 dev tun0 proto static metric 50
default via 10.15.10.5 dev tun1 proto static metric 51
default via 192.168.0.1 dev ens33 proto static metric 100
10.15.10.1 via 10.15.10.5 dev tun1 proto static metric 50
10.15.10.5 dev tun1 proto kernel scope link src 10.15.10.6 metric 50
10.41.10.1 via 10.41.10.5 dev tun0 proto static metric 50
10.41.10.5 dev tun0 proto kernel scope link src 10.41.10.6 metric 50
108.61.122.87 via 192.168.0.1 dev ens33 proto static metric 100
169.254.0.0/16 dev ens33 scope link metric 1000
192.40.95.8 via 192.168.0.1 dev ens33 proto static metric 100
192.168.0.0/24 dev ens33 proto kernel scope link src 192.168.0.124 metric 100
Output of ip addr show:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:22:68:98 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.124/24 brd 192.168.0.255 scope global dynamic ens33
valid_lft 79226sec preferred_lft 79226sec
inet6 fe80::35de:fa5c:36f9:ef75/64 scope link
valid_lft forever preferred_lft forever
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none
inet 10.41.10.6 peer 10.41.10.5/32 brd 10.41.10.6 scope global tun0
valid_lft forever preferred_lft forever
inet6 fe80::7673:9948:3a19:4893/64 scope link flags 800
valid_lft forever preferred_lft forever
6: tun1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none
inet 10.15.10.6 peer 10.15.10.5/32 brd 10.15.10.6 scope global tun1
valid_lft forever preferred_lft forever
inet6 fe80::1e6e:7618:8b1e:5e9d/64 scope link flags 800
valid_lft forever preferred_lft forever
EDIT2:
$ sudo ip rule
0: from all lookup local
32764: from all fwmark 0x3e9 lookup 1001
32765: from all fwmark 0x3e8 lookup 1000
32766: from all lookup main
32767: from all lookup default
$ sudo ip route
default via 10.33.10.5 dev tun0 proto static metric 50
default via 10.49.10.5 dev tun1 proto static metric 51
default via 192.168.0.1 dev ens33 proto static metric 100
10.33.10.1 via 10.33.10.5 dev tun0 proto static metric 50
10.33.10.5 dev tun0 proto kernel scope link src 10.33.10.6 metric 50
10.49.10.1 via 10.49.10.5 dev tun1 proto static metric 50
10.49.10.5 dev tun1 proto kernel scope link src 10.49.10.6 metric 50
108.61.122.224 via 192.168.0.1 dev ens33 proto static metric 100
169.254.0.0/16 dev ens33 scope link metric 1000
192.40.95.4 via 192.168.0.1 dev ens33 proto static metric 100
192.168.0.0/24 dev ens33 proto kernel scope link src 192.168.0.124 metric 100
$ sudo ip route show table 1000
default via 10.33.10.5 dev tun0
$ sudo ip route show table 1001
default via 10.49.10.5 dev tun1
$ sudo iptables -vnL OUTPUT
Chain OUTPUT (policy ACCEPT 34103 packets, 59M bytes)
pkts bytes target prot opt in out source destination
3238 241K MARK all -- * * 0.0.0.0/0 0.0.0.0/0 owner UID match 1000 MARK set 0x3e8
15180 55M MARK all -- * * 0.0.0.0/0 0.0.0.0/0 owner UID match 1001 MARK set 0x3e9