mba*_*off 35 networking routing openvpn
当我通过 Internet 建立到我们公司 OpenVPN 服务器的 OpenVPN 客户端连接时,它会推送几个静态路由。不幸的是,这些路由在我的本地网络环境中破坏了一些连接,因为它们与我自己的路由相冲突。我如何拒绝这些路线?
Cri*_*gie 43
时代在变,从 2017 年(OpenVPN 2.4)开始,这可以通过
pull-filter accept "route 192.168."
pull-filter ignore "route 172."
pull-filter accept "route 1"
pull-filter ignore "route "
Run Code Online (Sandbox Code Playgroud)
这(人为的示例)将允许学习以 192.168 开头的路由,忽略所有 172. 路由,允许其他路由到 1.anything,然后忽略所有其他路由。
要忽略,redirect-gateway您可以:
pull-filter ignore redirect-gateway
Run Code Online (Sandbox Code Playgroud)
这些命令会添加到您的客户端配置文件中。
同样,您可以使用关键字reject告诉 VPN 服务器它不被接受。不确定这个的用途。
最后,您也可以过滤其他配置选项。我用它来忽略提供的 DNS 服务器,因为 DNS 由本地服务器为我处理。
mba*_*off 29
经过对openvpn手册的广泛研究,我找到了我的问题的答案:
如果您不希望路线自动执行,而是由您自己的工具处理,请使用以下选项:
Run Code Online (Sandbox Code Playgroud)--route-noexec Don't add or remove routes automatically. Instead pass routes to --route-up script using environmental variables.
如果您接受服务器推送的除路由之外的所有内容,请使用以下选项:
Run Code Online (Sandbox Code Playgroud)--route-nopull When used with --client or --pull, accept options pushed by server EXCEPT for routes. When used on the client, this option effectively bars the server from adding routes to the client's routing table, however note that this option still allows the server to set the TCP/IP properties of the client's TUN/TAP interface.
| 归档时间: |
|
| 查看次数: |
49227 次 |
| 最近记录: |