[英]How to only allow samba through the vpn tunnel?
我已经设法使用 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
* 客户端.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
push "redirect-gateway def1 bypass-dhcp"
从 server.conf 注释上面的行就成功了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.