Question

Create a droplet using snapshot (VestaCP show the old ip addr interface)

Create a droplet using snapshot (VestaCP show the old ip addr interface) .

As a new droplet, we will have a new ip address interface but it seems my vestacp or linux will contain ip address for interface as an old one then how to change this completely (debian linux ? , vestacp config file ? , phpmysql ? , nginx ? , mysql ? , wordpress )

Sorry I am really new to linux and these cli platform…

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

When you create a new droplet from your snapshot the IP address settings in Linux are updated but VestaCP stores this information separately. A command is included for you to update the IP address. After creating your new droplet you can run

v-add-sys-ip <*>your.ip.address <*>

Using droplet meta-data and user-data you can automate this process. On the create page, when using your VestaCP image, check the user-data checkbox and paste the following in the box:

#!/bin/sh
myip=`ifconfig eth0 | grep inet | grep -v "inet6" | grep -v "127.0.0.1" | sed 's/:/ /g' | awk '{print $3}'`;
v-add-sys-ip $myip;

This script will use droplet meta-data to get your new droplet’s IP address and run the command on the first boot. I don’t have a VestaCP image to test this with so I’d recommend testing with yours before using this method in production.