Virtual IP » History » Version 7
h1. Virtual IP
IKEv1 and IKEv2 both know the concept of _virtual IPs_. This means that the initiator (or even the responder) requests an additional IP address from the peer to use as inner IPsec tunnel address.
In IKEv1, virtual IPs are exchanged using the _mode config_ extension. IKEv2 has full support for virtual IPs in the core standard using _configuration payloads_.
The feature set is similar to that in IKEv2, but not all features are supported. If the virtual IP is not assigned by the responder with _rightsourceip_ you may need to use the _rightsubnetwithin_ directive (see "this example":http://www.strongswan.org/uml/testresults/ikev1/virtual-ip/).
strongSwan currently implements one scenario with configuration payloads, payload, where an IP address is assigned to the initiator. The opposite is possible by the protocol, but is an a uncommon setup and therefore not supported.
h3. Initiator Configuration
The client needs an additional parameter called the _leftsourceip_.
_%config_ means to request an address from the responder and is an alias for the IKEv1 specific _%modecfg_. But you may specify an address explicitly by setting:
This will include _10.3.0.5_ into the configuration payload request. However, the responder may return a different an other address, or may not return one at all.
The client can't request other attributes, but it may process the DNS attributes. Received DNS servers are written to the beginning of _/etc/resolv.conf_, or an other file specified with the _--with-resolve-conf_ configure directive.
You should not include the _leftsubnet_ option, as the subnet may not match your received virtual IP. Without the _leftsubnet_ option, the subnet is narrowed to your assigned virtual IP automatically.
h3. Responder Configuration
The responder configuration uses the _rightsourceip_ option:
This will serve the IP _10.3.0.6_ to the client, even if the initiator requested another address. Additionally, the responder may define:
to let the client choose an address. This is not recommended if you do not trust the client completely.
The IKEv2 daemon charon supports address pools since version strongswan 4.2.1. You may define an address pool in CIDR notation, e.g.
to serve addresses from that pool. You may also use an external pool implemented as a plugin where you can specify a pool name to select addresses from. The definition
queries registered plugins for an IP from a pool named _poolname_. This can also be the name of another connection in [[IpsecConf|ipsec.conf]] which defines a pool in CIDR notation with _rightsourceip_, as a pool with that connection's name is created implicitly.
The [[IpsecPool|ipsec pool]] utility (available since 4.4.1) allows to easily manage IP address pools and other attributes, like DNS servers, stored in an SQL database (using the *attr-sql* plugin).
With the *dhcp* plugin (available since 4.4.0) the responder can request virtual IP addresses for clients from a DHCP server using broadcasts, or a designated server specified with the @charon.plugins.dhcp.server@ option in [[StrongswanConf|strongswan.conf]].
DNS/WINS server information is additionally served to clients if the DHCP server provides such information.
The plugin is used in ipsec.conf configurations by setting
The *farp* plugin might also be of use when using the *dhcp* plugin. It allows the responder to fake ARP responses for
virtual IP addresses handed out to clients. This lets a road-warrior act as a client on the local LAN of the responder.