大网数据广告活动
服务器运维问答

How to restrict openvpn route at server side even if client side using no-pull

· 52CE 我爱测

I know that client side openvpn configuration can use route-nopull and write theirselves route. But this may cause some secure problem, for example when you don't want to let vpn user visit some node through vpn gate. So how to r…

问题原文

原帖链接 · Tintervenor · CC BY-SA 4.0

I know that client side openvpn configuration can use route-nopull and write theirselves route. But this may cause some secure problem, for example when you don't want to let vpn user visit some node through vpn gate.

So how to restrict route scope at server side even if vpn user modify their client configuration and write self-defined route?

已采纳解答

原帖链接 · A. Trevelyan · CC BY-SA 4.0

As far as I understand it, route scope is specified in the server.conf file, like this for example:

# Add route to Client routing table for the OpenVPN Server 
push "route 10.8.0.1 255.255.255.255" 
# Add route to Client routing table for the OpenVPN Subnet 
push "route 10.8.0.0 255.255.255.0" 

This tells your VPN gateway exactly what routes to push to connected clients.

If you're concerned about some malicious client configuring a static route at the client side to send additional traffic through the VPN tunnel, you cannot stop this, unless you have administrative control of their machine and can prohibit them from manipulating the routing table directly.

However, you can do though is ensure that your firewall on the VPN gateway is configured to only permit the traffic that you want to pass through. Assuming you're using just a regular linux box with the typical iptables/ufw as your VPN gateway, you would just need to make sure those are configured with specific rules identifying exactly what traffic should be allowed, and then everything else would be blocked, so even if a user does send some unexpected traffic over the tunnel, your gateway just drops it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-11-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。