This episode covers VPN client address management: Virtual IP via IKEv1 ModeConfig or IKEv2 Configuration Payload, the rightsourceip address pool, and dynamic allocation and accounting through RADIUS.

Every VPN client needs an IP address on the internal network — but where does that address come from? Episode 17 discusses address management: Virtual IP allocation through IKE's built-in mechanisms, the address pool on the server side, and full integration with RADIUS for dynamic allocation and accounting.
With properly managed addresses, you can enforce per-user access policies, audit who uses which address, and allocate dedicated subnets based on groups. This is the operational foundation for large-scale deployments.
Allocating addresses through IKE is called ModeConfig in IKEv1 and Configuration Payload (CP) in IKEv2. The server sends the IP address assigned to the client as part of the negotiation, along with other options such as DNS and address rotation time.
On the server side, the address pool is defined with rightsourceip. When a client receives an address from this pool, its interface is created and routing is set automatically by the IPsec daemon.
Libreswan allocates Virtual IPs with rightsourceip and enables ModeConfig with modecfgserver:
conn vpn-pool
type=tunnel
left=%any
leftsubnet=10.10.10.0/24
right=%any
rightaddresspool=192.168.42.10-192.168.42.250
modecfgserver=yes
modecfgdns1=8.8.8.8
modecfgdns2=1.1.1.1The rightaddresspool=192.168.42.10-192.168.42.250 value is the range of addresses to hand out. Choose a range that does not conflict with your LAN.
In strongSwan, the pool is defined in the pools block:
pools {
vpn_pool {
addrs = 192.168.42.10-192.168.42.250
dns = 8.8.8.8, 1.1.1.1
}
}
connections {
vpn-ikev2 {
pools = vpn_pool
...
}
}For enterprise environments, static or per-user allocation is done through RADIUS. The server requests address attributes from FreeRADIUS, which can decide based on user and group. A basic FreeRADIUS configuration:
budi Cleartext-Password := "rahasia-budi"
Framed-IP-Address = 192.168.42.50,
Framed-IP-Netmask = 255.255.255.255,
Framed-Protocol = PPPThe Framed-IP-Address attribute sets a fixed address for user budi. FreeRADIUS also accepts Accounting packets from the NAS, so you can record the duration and traffic volume of every session.
On the PPP side, pppd is connected to RADIUS with the radius module:
plugin radius.so
radius-config-file /etc/ppp/radius.conf
require-mschap-v2Meanwhile, IKEv2 with EAP-RADIUS connects strongSwan to FreeRADIUS via the eap-radius plugin. The combination of both gives a single source of truth for user credentials.
rightsourceip): enough for small-to-medium deployments without many policies.Verify the allocation after a client connects:
sudo ipsec statusall | grep -E "virtual|pool"
ip addr show ppp0ppp0 on the client side must show an address taken from the pool.
Info
Make sure the Virtual IP subnet does not overlap with the server's LAN subnet. Overlap makes routing ambiguous and can direct VPN traffic to the wrong network.
Episode 17 completed address management: Virtual IP via ModeConfig and Configuration Payload, address pools with rightaddresspool, and FreeRADIUS integration for per-user allocation and accounting.
Key takeaways:
rightaddresspool in Libreswan and the pools block in strongSwan define the pool.modecfgserver=yes enables ModeConfig in Libreswan.Framed-IP-Address.radius.so module connects pppd to RADIUS.In the next episode, episode 18, we will discuss mobile client support — how to configure L2TP/IPsec on iOS, Android, Windows, and macOS, creating centralized profiles, and troubleshooting connections from devices.