Answer the question
In order to leave comments, you need to log in
How to configure traffic redirection from the main inet interface to the tap interface?
I'm trying to configure not the most popular VPN solution govpn through tap interfaces.
Configured on the server:
ip tuntap add dev tap10 mode tap
ip addr add 172.16.0.1/24 dev tap10
ip link set up dev tap10
ip tuntap add dev tap10 mode tap
ip addr add 172.16.0.2/24 dev tap10
ip link set up dev tap10
ip route add 0/1 via 172.16.0.1
ip route add 128/1 via 172.16.0.1
default via <ip на tun0> dev tun0 proto static metric 50
default via <ip на wlp3s0> dev wlp3s0 proto static metric 750
Answer the question
In order to leave comments, you need to log in
Before wrapping the default gateway through your tap interface, you first need to add a route to your VPN server through your eth (or whatever you have) network interface and assign the smallest metric to it. After that, add a default gateway through the tap interface and give it a larger metric.
Here is part of my routing table
$ ip route
default via 10.22.0.5 dev tun0
10.22.0.1 via 10.22.0.5 dev tun0
10.22.0.5 dev tun0 proto kernel scope link src 10.22.0.6
80.232.124.241 via 172.16.35.1 dev eth0
172.16.35.0/24 dev eth0 proto kernel scope link src 172.16.35.254 metric 100
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question