Changing the IP of a lightsail instance after installing it #14124
-
I would like to update my wireguard VPN server (using Lightsail), so I follow the recommendation and setting up a new server (although this means that I will have to send out the new configurations to all users). I need to attach a static IP to the VPN server. But as ansible is creating the lightsail instance, I can't add the static IP to it before installing. How can I do this, what would be the recommended way?
Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Unfortunately the Lightsail API does not provide Ansible the ability to assign a static IP address during instance creation. Using the It should be relatively easy to change the IP address after the fact with WireGuard, but I think it's impossible to do that with IPsec, which sounds like what you've encountered. If you don't need IPsec you can try to deploy with Another approach to to modify the Lightsail code to insert a delay to give you time to manually assign a static address, as discussed here. I've not tried that. |
Beta Was this translation helpful? Give feedback.
Unfortunately the Lightsail API does not provide Ansible the ability to assign a static IP address during instance creation.
Using the
local
provider is what I imagine most people do, just remember to open the necessary ports in the firewall. When creating the instance look for the option Change SSH key pair and use your own key.It should be relatively easy to change the IP address after the fact with WireGuard, but I think it's impossible to do that with IPsec, which sounds like what you've encountered. If you don't need IPsec you can try to deploy with
ipsec_enabled: false
inconfig.cfg
and maybe./algo update-users
would work.Another approach to to modify the Lightsail code to insert…