JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 04.03.2025, 11:16
apaq apaq is offline
Baby Loader
 
Join Date: May 2023
Posts: 7
Default JDownloader with 2 OpenVPN connections

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.
Reply With Quote
  #2  
Old 04.03.2025, 11:22
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,288
Default

@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
Reply With Quote
  #3  
Old 04.03.2025, 11:31
FBD's Avatar
FBD FBD is offline
Fibre Channel User
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 117
Default

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
Reply With Quote
  #4  
Old 04.03.2025, 13:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,288
Default

@FBD: Very nice With that "multiple routing tables" approach, same should be possible without additional proxies and setup JDownloader to use those interfaces directly?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 04.03.2025, 13:16
apaq apaq is offline
Baby Loader
 
Join Date: May 2023
Posts: 7
Default

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?
Reply With Quote
  #6  
Old 04.03.2025, 13:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,288
Default

@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
Reply With Quote
  #7  
Old 04.03.2025, 23:19
apaq apaq is offline
Baby Loader
 
Join Date: May 2023
Posts: 7
Default

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)
Reply With Quote
  #8  
Old 05.03.2025, 09:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,288
Default

@apaq: I do recommend to stick to ready2use docker images when not familiar with openvpn/network/routing stuff
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 05.03.2025, 20:50
FBD's Avatar
FBD FBD is offline
Fibre Channel User
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 117
Default

Quote:
Originally Posted by apaq View Post
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)
That error means that openvpn (which invokes that script when the connection is "--up") does not have permissions to execute it. You have to make it executable (u+x).

If that all is a bit over your head, maybe a docker approach would be easier.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader
Reply With Quote
  #10  
Old 06.03.2025, 00:25
apaq apaq is offline
Baby Loader
 
Join Date: May 2023
Posts: 7
Default

thanks @FBD, I was determined and followed your precious tips. Finally both connections were succesfully established, your script works very well!
Reply With Quote
  #11  
Old 06.03.2025, 09:25
FBD's Avatar
FBD FBD is offline
Fibre Channel User
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 117
Thumbs up

Quote:
Originally Posted by apaq View Post
thanks @FBD, I was determined and followed your precious tips. Finally both connections were succesfully established, your script works very well!
Nice to hear, thanks for the feedback.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader
Reply With Quote
  #12  
Old 06.03.2025, 13:50
apaq apaq is offline
Baby Loader
 
Join Date: May 2023
Posts: 7
Default

@FBD Is there a way to maintain active connection after closing terminal? Normally by doing this connection is lost.
Reply With Quote
  #13  
Old 06.03.2025, 14:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,288
Default

@apaq: eg run those commands in screen, so you can open new screen, run command, and then detach from it
__________________
JD-Dev & Server-Admin
Reply With Quote
  #14  
Old 06.03.2025, 14:29
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,731
Default

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
This creates a screen session named "mysession".

Step 2: Run your command inside the screen
For example:
Code:
python3 myscript.py
Step 3: Detach from the screen session
Press:
Code:
Ctrl + A, then D
This will detach the session and bring you back to the regular terminal.

Step 4: Reattach to the screen session (optional)
If you want to go back into the session:
Code:
screen -r mysession
Important Tip
Even if you close your terminal window, the screen session will continue running in the background.

List all screen sessions
Code:
screen -ls
End a screen session
Inside the screen session, type:
Code:
exit
Or, from outside the screen:
Code:
screen -X -S mysession quit
This way, your process will keep running even if you disconnect from SSH or close the terminal window.
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #15  
Old 06.03.2025, 20:12
apaq apaq is offline
Baby Loader
 
Join Date: May 2023
Posts: 7
Default

thanks for guidance @Jiaz and @pspzockerscene for more details. Now everything works in a sleek manner.
Reply With Quote
  #16  
Old 07.03.2025, 09:59
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,288
Default

@apaq: You're welcome but all thanks to FBD
__________________
JD-Dev & Server-Admin
Reply With Quote
  #17  
Old 07.03.2025, 11:27
apaq apaq is offline
Baby Loader
 
Join Date: May 2023
Posts: 7
Default

that's right, @FBD made impressive job, all credit to him.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 08:09.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.