Let me explain first the background of my question. I've got a router that currently route my packets from one of my computer on the lan to a vpn server using the OpenVPN client on the router.

-- Firewall up script
iptables -I FORWARD -i br0 -o tun11 -j ACCEPT
iptables -I FORWARD -i tun11 -o br0 -j ACCEPT
iptables -I INPUT -i tun11 -j REJECT
iptables -t nat -A POSTROUTING -o tun11 -j MASQUERADE

-- Wan up script
ip route flush table 200
ip route flush cache
ip rule add from lookup 200
VPN_GW=`ifconfig tun11 | awk '/inet addr/ {split ($2,A,":"); print A[2]}'`
ip route add table 200 default via $VPN_GW dev tun11

The problem with my vpn server is that it limit my download rate with it at 1MB/s.

What I would like to do is to create a second connection with another OpenVPN client on my router and then route the connections on vpn1 or vpn2 depending on the destination ip address. Since the things that I'm downloading are from P2P so they will be incoming from random ip addresses. Doubling my connection could allow me to potentially double my download speed.

The way I would solve this would be by checking the first number in the destination ipaddress and if its even, go to vpn1 otherwise go to vpn2.

I would like to know if this is possible with iptables (and an example if possible)?

Do you think this could lead to routing issues?

Better approach or thoughts?

  • 1
    Find out why your download is limited to 1MB/s before you consider such a complex setup. Creating additional connections won't necessarily provide you any speed gains if the limit is the result of the CPU maxing out on your router or that is the actual limit of your bandwidth. You don't want to end up with two connections that are limited to 0,5 MB/s each instead. – HBruijn Dec 20 '18 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.