I have managed to setup openvpn with ufw, all seems to work, but I want clients to still browse the internet via their local gateway while connected to the vpn. I only want samba traffic to go through the vpn. How can I do this? Is it even possible please help
I there something I can add to the client.conf which allow for this happen?
How to only allow samba through the vpn tunnel?
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 4
- Joined: Sat Mar 02, 2019 12:34 pm
-
- OpenVpn Newbie
- Posts: 4
- Joined: Sat Mar 02, 2019 12:34 pm
Re: How to only allow samba through the vpn tunnel?
My configs
*** server.conf ***
*** client.conf ***
*** server.conf ***
Code: Select all
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-CBC
comp-lzo
max-clients 100
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
log /var/log/openvpn.log
log-append /var/log/openvpn.log
verb 3
explicit-exit-notify 1
Code: Select all
client
dev tun
proto udp
remote vpn.server 1194
resolv-retry infinite
nobind
user nobody
group nobody
persist-key
persist-tun
remote-cert-tls server
tls-auth ta.key 1
cipher AES-256-CBC
comp-lzo
verb 3
-
- OpenVpn Newbie
- Posts: 4
- Joined: Sat Mar 02, 2019 12:34 pm
Re: How to only allow samba through the vpn tunnel?
Code: Select all
route www.google.com 255.255.255.255 net_gateway
-
- OpenVpn Newbie
- Posts: 4
- Joined: Sat Mar 02, 2019 12:34 pm
Re: How to only allow samba through the vpn tunnel?
Code: Select all
push "redirect-gateway def1 bypass-dhcp"