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已经释放)。