如何使OpenVPN客户端忽略服务器推送的redirect-gateway指令

OpenVPN服务器经常会被配置成向客户端推送redirect-gateway指令,使客户端将缺省网关设置为OpenVPN服务器端的IP地址。

但有时我们不想将客户端系统的缺省网关设置为OpenVPN对端的IP地址,而只想让目的地址为服务器端网段的报文走VPN隧道。这时,我们可以在客户端配置文件中加入route-nopull参数,并配置服务器端网段的路由,例如:

route-nopull
route 10.8.0.0 255.255.0.0 vpn_gateway
route 172.16.1.0 255.255.255.0 vpn_gateway

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.