SSL VPN 分配 IP 的方式
SSL VPN 分配 IP 的方式
网络需求
如果在“SSL - VPN 配置”(config vpn ssl settings)中与“SSL - VPN 门户”(config vpn ssl web portal)中同时引用了两个不同的地址池,那么对应 Portal 用户的 FortiClient 拨号后获取的 IP 地址应该是“SSL - VPN 配置”还是“SSL - VPN 门户”引用的地址池中的呢?
SSL VPN Tunnel 模式分配 IP 的模式有两种:
- 默认配置下,FortiClient 拨号后获取的 IP 为“SSL - VPN 门户”引用的地址池中的 IP。且分配 IP 的方式为
first-available,即永远使用用户对应 Portal 引用的地址池中可用的最小地址来分配 IP。 - 如果想要使用轮询(
round-robin)方式,当已经从地址池分配过一个 IP 后,即使该 IP 已经释放,也使用该 IP 后的可用 IP 进行分配(类似于 PPPoE 的 IP 分配方式)。config vpn ssl settings
配置方法
FortiGate # config vpn ssl settings
FortiGate (settings) # set tunnel-addr-assigned-method ?
first-available Assign the first available address from the pools. //默认最小可用优先方式,使用config vpn ssl web portal中引用的地址池//
round-robin Assign the available address from the pool with a round robin fashion. //轮询方式,使用config vpn ssl settings中引用的地址池//配置步骤
config vpn ssl settings配置,引用地址池为sslvpn_pool,用户组VPN对应的 Portal 为full-access,使用默认选项first-available作为 IP 分配方式(相关用户、策略配置略)。config vpn ssl settings set servercert "Fortinet_Factory" set tunnel-ip-pools "sslvpn_pool" set source-interface "wan1" set source-address "all" set source-address6 "all" set default-portal "web-access" config authentication-rule edit 2 set groups "VPN" set portal "full-access" next end set tunnel-addr-assigned-method first-available //默认配置// end config firewall address edit "sslvpn_pool" set type iprange set start-ip 3.3.3.1 set end-ip 3.3.3.100 next endconfig vpn ssl web portal配置,引用地址池为SSLVPN_TUNNEL_ADDR1。config vpn ssl web portal edit "full-access" set tunnel-mode enable set ip-pools "SSLVPN_TUNNEL_ADDR1" next end config firewall address edit "SSLVPN_TUNNEL_ADDR1" set type iprange set start-ip 10.212.134.200 set end-ip 10.212.134.210 next end
结果验证
FortiClient 使用用户组 VPN 中的用户连接 FortiGate 的 SSL VPN,连接成功后,获取的 IP 为
config vpn ssl web portal引用的地址池SSLVPN_TUNNEL_ADDR1中的 IP 10.212.134.200。
断开 FortiClient 的 SSL VPN 连接,再次连接 FortiGate 的 SSL VPN,会获取到地址池
SSLVPN_TUNNEL_ADDR1最小可用的地址 10.212.134.200,与步骤 1 中获取的地址一样(该地址释放后没有其他客户端获取)。
在
config vpn ssl settings中修改 IP 分配方式为round-robin。config vpn ssl settings set tunnel-addr-assigned-method round-robin end再次使用 FortiClient 连接 FortiGate 的 SSL VPN,获取的 IP 为
config vpn ssl settings引用的地址池sslvpn_pool中的 IP 3.3.3.1。
断开 FortiClient 的 SSL VPN 连接,再次连接 FortiGate 的 SSL VPN,会获取到地址池
sslvpn_pool的下一个可用 IP 3.3.3.2(即使上一个 IP 3.3.3.1 已经释放)。