Необходимо завернуть весь трафик кроме локального в туннель openvpn.
Конфиг сервера
dev tap0
proto tcp-server
mode server
comp-lzo
log-append /var/log/openvpn.log
daemon
ifconfig-pool 192.168.250.2 192.168.250.254
ifconfig 192.168.250.1 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"
tls-server
dh keys/server/dh2048.pem
ca keys/server/ca.crt
cert keys/server/server.crt
key keys/server/server.key
cipher AES-256-CBC
port $port_number
user nobody
group nogroup
persist-tun
persist-key
log-append /var/log/openvpn.log
verb 2
конфиг клиента
client
proto tcp-client
dev tap
ca ca.crt
dh dh2048.pem
cert pterodaktil.crt
key pterodaktil.key
remote $remote_ip $remote port
cipher AES-256-CBC
user nobody
group nogroup
verb 6
log-append /var/log/openvpn.log
pull
mute 20
keepalive 10 120
comp-lzo
persist-key
persist-tun
resolv-retry infinite
nobind
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.28.2 0.0.0.0 UG 0 0 0 eth0
192.168.28.0 * 255.255.255.0 U 0 0 0 eth0
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.28.2 0.0.0.0 UG 0 0 0 eth0
192.168.28.0 * 255.255.255.0 U 0 0 0 eth0
192.168.250.0 * 255.255.255.0 U 0 0 0 tap0
sudo cast tazhate