【问题标题】:How to only allow samba through the vpn tunnel?如何只允许 samba 通过 vpn 隧道?
【发布时间】:2019-03-02 13:48:01
【问题描述】:

我已经设法使用 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】:
    push "redirect-gateway def1 bypass-dhcp"
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-13
      • 1970-01-01
      • 1970-01-01
      • 2015-10-08
      • 2019-09-14
      • 1970-01-01
      • 1970-01-01
      • 2016-09-29
      相关资源
      最近更新 更多