Answer the question
In order to leave comments, you need to log in
How to configure traffic direction depending on whether VPN is up or not?
The task is to direct traffic in one way if the VPN is up and in another way if the VPN is disabled.
Does anyone have experience setting this up in iptables?
Maybe with the owner module?
Answer the question
In order to leave comments, you need to log in
Hello,
The owner criterion only works in OUTPUT, while VPN setup usually requires FORWARD. In general, the task is very vague, either you need to split the traffic, or you need to monitor the rise of the VPN and then somehow forward something there ... More specifically, it would be necessary ...
Do you have a router or workstation/member server? Let's take the situation with the host-client.
Change the default route after the vpn tunnel is up. In some clients, you can immediately register this in the config, or write a separate script with ip route add, which will be launched when the vpn tunnel starts. You can either change default gw, or set access to the network 0.0.0.0/0 through the VPN tunnel interface as the first line.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question