如何configurationstrongswan(IPsec)只转发特定子网的stream量?

我只需要将stream量从客户端转发到VPN服务器,仅用于特定的子网,即10.10.10.0/24

例如,如果客户端发送请求到123.123.123.123那么他们将使用他们自己的互联网。 如果客户端向10.10.10.123发送请求,则他们将使用VPN连接。

是否可以configurationstrongswan? 目前来自客户端的所有stream量均通过VPN服务器进行代理。 这是我的strongswanconfiguration:

config setup uniqueids=no charondebug = ike 3, cfg 3 conn %default dpdaction=clear dpddelay=35s dpdtimeout=2000s keyexchange=ikev2 auto=add rekey=no reauth=no fragmentation=yes compress=yes ### left - local (server) side # filename of certificate chain located in /etc/strongswan/ipsec.d/certs/ leftcert=fullchain.pem leftsendcert=always leftsubnet=0.0.0.0/0,::/0 ### right - remote (client) side eap_identity=%identity rightsourceip=10.10.11.0/24,2a00:1450:400c:c05::/112 rightdns=8.8.8.8,2001:4860:4860::8888 conn ikev2-mschapv2 rightauth=eap-mschapv2 conn ikev2-mschapv2-apple rightauth=eap-mschapv2 leftid=mydomain.com 

我是VPNconfiguration的新手。
我只是试图将leftsubnet更改为10. 10.10.0/24 ,现在它工作。 只有stream量10. 10.10.0/24被转发到VPN服务器。

不幸的是,你不能。 您必须改为configuration客户端。

我所做的是在/etc/ppp/ip-up客户端创build一个脚本,如下所示:

/sbin/route add 172.31.0.0/16 $5

$5扩展到VPN网关的IP地址