By Goran Blažič
Connected Tutorial(This question is a follow-up to this tutorial):
How to Set Up an IKEv2 VPN Server with StrongSwan on Ubuntu 20.04First, love the tutorial, thank you very much. I’d like to always assign the same IP to specific clients, is this possible?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
So, following up on previous comments and reading the Strongswan docs on Responder Configuration in a bit more detail, it sounds you can configure clients with static IPs using this setting on the server:
rightsourceip=%config
Along with this setting on the client based on the Initiator Configuration option that I mentioned previously:
leftsourceip=<your desired static ip here>
The commentary on the responder section states that:
Alternatively, the responder may define the following to let the client choose an address. This is not recommended if the client is not completely trusted.
Since it sounds like you trust all your clients, try specifying a static IP in the client’s leftsourceip
setting. The rightsourceip=%config
should ensure that Strongswan will accept the client’s request.
Do note that you’ll need to keep track of which client has which static IP, since Strongswan won’t be keeping track of which is assigned or duplicated.
Hello,
In general, the moment you create a Droplet, you will be assigned an Static IPv4 address automatically. Similarly, when you destroy the Droplet, the IP address will be disassociated and will join the IP pool table. There is no way you can have one more Static IP address to the Droplet or assign/retain the same Static IP on our platform. Really sorry for the inconvenience!
However, you can use the provision of Floating IP on our platform. This allows you to assign one more IPv4 address and can also be moved between Droplets in same account. Refer to below links, which provides some insights on Floating IP:
https://www.digitalocean.com/docs/networking/floating-ips/ https://www.digitalocean.com/docs/networking/floating-ips/how-to/
You can also start using IPv6, request you to refer to below links:
https://www.digitalocean.com/docs/networking/ipv6/ https://www.digitalocean.com/docs/networking/ipv6/how-to/
Hope this helps!
Regards, Sri Charan
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.