#1
|
|||
|
|||
![]()
Hi,
does anybody tried to setup 2 simultaneous tunnels on Linux using tun0 & tun1 interfaces? I know I should add two additional routing tables assigned to each network interface to handle the traffic, but don't know what routes should be there to bypass enp0s3 connection. |
#2
|
||||
|
||||
![]()
@apaq: I recommend much easier setup and use vm/docker and connect to vpn in there and open/serve a socks/http proxy. That way you don't have to mess with routing and just setup multiple socks/http proxies in JDownloader. There are ready 2 use docker images for that
Without that you have to define what dest IP should take which route/device. With said way you can use both/multiple connections simultaneously
__________________
JD-Dev & Server-Admin |
#3
|
||||
|
||||
![]()
When you have two network interfaces for your two openvpn connections, you need to add routes for the websites you want to connect to for each tun interface. So if you want to have youtube to be handled by tun1 you would have to add routes for all youtube ip addresses to go through tun1. That's very tedious and only really reasonable if you have only one or two hosters you want to route for.
An easier approach would be to start up a proxy server (like tinyproxy for example) for each interface and have that proxy server only use one interface. For example, configure proxyserver1 to use tun1 and be listening on port 8888, and proxyserver2 to use tun2 and listen on port 8889. Then you can setup jdownloader to use those proxy servers very easily in the connection manager and setup load balancing or white/blacklist for hosters for each proxyserver/tun-device and conveniently manage the connections. A few years ago I wrote a script that setup tinyproxy instances for multiple openvpn connections, see github.com/FarBeyondDriven/multi-openvpn-tinyproxy you may not be able to use it directly, but it can surely give you some hints to set things up properly.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#4
|
||||
|
||||
![]()
@FBD: Very nice
![]()
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
![]()
thanks @FBD for guidance I will try to understand your approach, however it's more advanced than I though. If there is easier way like @Jiaz suggested I would go for it first.
@Jiaz can you send some step-by-step solution or example how to do that? |
#6
|
||||
|
||||
![]()
@apag: search for "docker vpn proxy" or "socks docker vpn" and similiar. for example
github.com/ducmthai/vpn-as-a-container or github.com/kizzx2/docker-openvpn-client-socks and many more
__________________
JD-Dev & Server-Admin |
#7
|
|||
|
|||
![]()
meanwhile I checked @FBD's script but when running openvpn I got the error
Options error: --up script fails with '/home/john/Downloads/vpnroutes': Permission denied (errno=13) |
#8
|
||||
|
||||
![]()
@apaq: I do recommend to stick to ready2use docker images when not familiar with openvpn/network/routing stuff
__________________
JD-Dev & Server-Admin |
#9
|
||||
|
||||
![]() Quote:
If that all is a bit over your head, maybe a docker approach would be easier.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#10
|
|||
|
|||
![]()
thanks @FBD, I was determined
![]() ![]() |
#11
|
||||
|
||||
![]()
Nice to hear, thanks for the feedback.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#12
|
|||
|
|||
![]()
@FBD Is there a way to maintain active connection after closing terminal? Normally by doing this connection is lost.
|
#13
|
||||
|
||||
![]()
@apaq: eg run those commands in screen, so you can open new screen, run command, and then detach from it
__________________
JD-Dev & Server-Admin |
#14
|
||||
|
||||
![]()
How to Use "screen" on Linux
To keep a process running after closing your terminal, you can use the screen command. Here is a short guide: Step 1: Start a new screen session Code:
screen -S mysession Step 2: Run your command inside the screen For example: Code:
python3 myscript.py Press: Code:
Ctrl + A, then D Step 4: Reattach to the screen session (optional) If you want to go back into the session: Code:
screen -r mysession Even if you close your terminal window, the screen session will continue running in the background. List all screen sessions Code:
screen -ls Inside the screen session, type: Code:
exit Code:
screen -X -S mysession quit
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#15
|
|||
|
|||
![]()
thanks for guidance @Jiaz and @pspzockerscene for more details. Now everything works in a sleek manner.
![]() |
#16
|
||||
|
||||
![]()
@apaq: You're welcome but all thanks to FBD
__________________
JD-Dev & Server-Admin |
#17
|
|||
|
|||
![]()
that's right, @FBD made impressive job, all credit to him.
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|