S
S
sbh2018-04-07 16:50:03
VPN
sbh, 2018-04-07 16:50:03

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

2 answer(s)
M
Moris Haos, 2018-04-07
@morihaos

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 ...

K
krosh, 2018-04-10
@krosh

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 question

Ask a Question

731 491 924 answers to any question