Answer the question
In order to leave comments, you need to log in
How to fix very slow local traffic routing when VPN is connected?
Good afternoon!
I've run into a problem that I can't solve and would like some advice.
There is a Raspberry Pi 4 acting as a VPN gateway. At the same time, the task is to pass all the traffic of LAN clients (10.10.10.0/24) that use Malinka through the VPN, and Malinka's own traffic through the provider.
To solve the problem of routing your own traffic, after connecting the VPN, a routing table and one rule are added:
ip route add table 100 10.10.10.0/24 dev eth0 src 10.10.10.100
ip route add table 100 default via 10.10.10.1
ip rule add iif lo lookup 100 prio 201
Hosted by XXX [0.39 km]: 3.467 ms
Testing download speed................................................................................
Download: 594.71 Mbit/s
Testing upload speed......................................................................................................
Upload: 172.22 Mbit/s
Hosted by XXX [0.39 km]: 239.691 ms
Testing download speed................................................................................
Download: 44.03 Mbit/s
Testing upload speed......................................................................................................
Upload: 11.64 Mbit/s
Hosted by YYY [9.68 km]: 37.024 ms
Testing download speed................................................................................
Download: 139.88 Mbit/s
Testing upload speed......................................................................................................
Upload: 144.09 Mbit/s
# ip rule
0: from all lookup local
201: from all iif lo lookup 100
32763: from all lookup main suppress_prefixlength 0
32764: not from all fwmark 0xca6c lookup 51820
32765: from all to <IP ноды VPN> lookup main
32766: from all lookup main
32767: from all lookup default
# iptables -S
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT ACCEPT
-N DOCKER
-N DOCKER-ISOLATION-STAGE-1
-N DOCKER-ISOLATION-STAGE-2
-N DOCKER-USER
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -s 10.10.10.0/24 -i eth0 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 8555 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 8444 -j ACCEPT
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-ISOLATION-STAGE-1
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -o docker0 -j DOCKER
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
-A FORWARD -i eth0 -o nordlynx -j ACCEPT
-A FORWARD -i nordlynx -o eth0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A DOCKER -d 172.17.0.2/32 ! -i docker0 -o docker0 -p tcp -m tcp --dport 9000 -j ACCEPT
-A DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2
-A DOCKER-ISOLATION-STAGE-1 -j RETURN
-A DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP
-A DOCKER-ISOLATION-STAGE-2 -j RETURN
-A DOCKER-USER -j RETURN
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question