S
S
Sergey Sashkin2019-01-10 12:00:42
linux
Sergey Sashkin, 2019-01-10 12:00:42

How to assign a Floating IP in Digital Ocean to a Droplet (instance) that is more than 5 years old?

Hello guys
, I have a droplet DO assigned it a floating ip (in the control panel) but since it is more than 5 years old,
according to the instructions , you need to assign an internal address to it.
he recognizes the commands

curl -s 169.254.169.254/metadata/v1/interfaces/public/0/an...
with /netmask and /gateway substitution and is written with a
command in the terminal
sudo ip addr add 198.51.100.0/16 dev eth0


The question is that I did all this, but I did not get the IP that I see in the control panel.
Tell me what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sashkin, 2019-01-10
@LexPex

Solution:
find the internal IP

curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address
находим маску 
curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/netmask
и гетвей
curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/gateway

and register on the host
sudo ip addr add "найденный айпи/найденная маска подесети" dev eth0
route add -net "найденный айпи/найденная маска подесети"  gw  "найденный шлюз" dev eth0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question