V
V
VITYA-XY12021-01-11 00:10:03
openvpn
VITYA-XY1, 2021-01-11 00:10:03

How to send traffic to only one domain through OpenVPN?

Now the server has this config:

push        "redirect-gateway def1 bypass-dhcp"
push        "dhcp-option DNS 8.8.8.8"
push        "dhcp-option DNS 8.8.4.4"


On the client like this:
client
proto                 udp
dev                   tun
remote                {{ public_ip_address }}
port                  {{ vpn_server_port }}

resolv-retry          infinite

remote-cert-tls       server
auth                  SHA256
cipher                AES-256-CBC

pull-filter           ignore "redirect-gateway def1 bypass-dhcp"
route                 10.0.0.0  255.0.0.0
route                 172.0.0.0 255.0.0.0

ignore-unknown-option block-outside-dns
block-outside-dns
verb                  4

persist-key
persist-tun
nobind


What needs to be added either on the client or on the server so that when accessing the example.com domain, the traffic goes through the VPN gateway?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Drno, 2021-01-11
@Drno

route add - domain - gateway
and do not forget to set the metric above the main connection

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question