S
S
Sergey2017-05-20 15:58:55
openvpn
Sergey, 2017-05-20 15:58:55

How to let only selected sites through vpn in OpenVPN?

ea9958ac640843b2be0fdce3934f1915.jpg
How to make it so that only some sites go through vpn and the rest are skipped?
Prescribed

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

;push "redirect-gateway def1 bypass-dhcp"all traffic went through 45.45.241.110
push "redirect-gateway def1 bypass-dhcp" all traffic went through 247.147.218.14
How to make not all traffic but only from certain sites?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2017-05-21
@spy_reality

I don't know if it's right or wrong, but I figured it out.
I wrote this in the client config

route-nopull

# vk.com
route 87.240.160.0 255.255.224.0
route 95.213.0.0 255.255.128.0
route 185.32.248.0 255.255.255.0
route 95.142.192.96 255.255.255.224 
route 95.142.192.128 255.255.255.128
route 95.142.193.0 255.255.255.0
route 95.142.194.0 255.255.254.0
route 95.142.196.0 255.255.252.0

# mail.ru
route 94.100.176.0 255.255.248.0
route 94.100.184.0 255.255.248.0 
route 128.140.168.0 255.255.252.0
route 185.5.136.0 255.255.254.0
route 195.218.168.0 255.255.255.0
route 217.69.128.0 255.255.240.0

# yandex.ru
route 5.255.255.0 255.255.255.0
route 87.250.247.0 255.255.255.0
route 213.180.192.0 255.255.224.0
route 178.154.131.0 255.255.255.0
route 87.250.251.0 255.255.255.0
route 93.158.134.0 255.255.255.0

and it worked as it should!

D
Dimonchik, 2017-05-20
@dimonchik2013

route add " + domain_ip + " via " + remote_ip + " dev " + interface

E
Erelecano Oioraen, 2017-05-21
@Erelecano

man openvpn
/push

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question