OpnVPN client static IP [SOLVED]

Started by bdario, December 01, 2021, 02:21:48 PM

Previous topic - Next topic
December 01, 2021, 02:21:48 PM Last Edit: December 01, 2021, 04:25:40 PM by bdario
Hello folks,
in OPNsense 21.7.5 I'm not able to force a static IP address to a VPN client.
The Tunnel Network configured in the vpn server is 10.10.10.0/28
I tried configuring  VPN / OpenVPN / Client Specific Overrides as follow:
- Servers: name of the OpenVPN servers (or blank)
- Common name: the name of the user as created in System / Access / Users (in this case the name is sandro.d)
- Advanced: ifconfig-push 10.10.10.10 255.255.255.240
When I connect the vpn client I expect to receive the address 10.10.10.10 but I always receive 10.10.10.2 or 10.10.10.3
Any suggestion?
Best regards
Dario

I solved the issue creating the file:
/var/etc/openvpn-csc/1/sandro.d
populated with the directive:
ifconfig-push 10.10.10.10 255.255.255.240

Looks like this doesn't work anymore - as soon as the client logs in, the file is removed.

Has anyone else an idea how to give a fixed IP to a client?

Already found the answer :

Miscellanious - Options: persist-remote-ip


Can you please describe where exactly I can find this setting "persist-remote-ip"?
Is it related to the Server instance or to client specific configuration?
I can't find it on my OpnSense 24.1.1 instance.

A little bit late but:

OpenVPN instances, Miscellaneous, Options: persist-remote-ip