如何只允许samba通过vpn隧道?

问题描述 投票:-1回答:1

我已经设法用ufw设置openvpn服务器,一切似乎都有效,但我希望客户端在连接到vpn时仍然可以通过本地网关浏览互联网。我希望samba只有流量通过vpn。我怎样才能做到这一点?是否有可能请帮助:(

我有什么东西可以添加到client.conf中,这可以实现吗?

我的配置

* server.conf *

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"
push "dhcp-option DNS 1.1.1.1"
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

* client.conf *

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
linux opensuse openvpn ufw
1个回答
-1
投票
push "redirect-gateway def1 bypass-dhcp"

从server.conf注释上面的行就可以了。

© www.soinside.com 2019 - 2024. All rights reserved.