W
W
wanomgn2017-03-13 19:06:15
linux
wanomgn, 2017-03-13 19:06:15

How to make a different route for a separate application?

Good afternoon.
Ubuntu. Several outgoing vpn connections are up.
It is necessary that a certain application make all its connections through the desired vpn connection. Where the application goes is not known in advance.
Where to dig?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Burov, 2017-03-13
@wanomgn

you need linux network namespace
blog.scottlowe.org/2013/09/04/introducing-linux-ne...
https://www.opennet.ru/tips/2683_linux_namespace_g...

A
Axian Ltd., 2017-03-13
@AxianLTD

In its container...

A
Anton Anton, 2017-03-13
@Fragster

You can try to mark packets according to the owner criterion and apply different routing tables for them.
I tried it myself for a very long time, it seemed to work. There is a little on the link tiebing.blogspot.ru/2015/12/linux-routing-based-on... well, in the search for iptables mark and ip route mark
The problem is in determining the correct owner, in some cases you can do it by uid, in in some cases, you need to write a script that adds and removes pid in chains

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question