Auto change IP

Has anyone used the API to automatically change the IP of a linode? I know it’s possible by creating a new linode, swapping IP then deleting the new linode.

I was looking for any tips, guards or issues to look out for. Has anyone attempted this with the API and a script?

My application needs to check connectivity to an IP, and if it fails, then switch IP on the linode. I want this to be automatic, so need to check for as many false positives or possible errors as possible.

2 Replies

The problem is what you want to do is what people who are bad actors want to do.

ie if a bad actor was using a website or api against the webite's TOS, and the website blocked the bad actor's ip address, the bad actor could keep using the website against their TOS if they could get a new ip address.

But now other linodians who get your old ip address can't use that website or api.

I would suggest opening a support ticket with linode and check what you want to do isn't against linodes TOS. You don't want your linode account blocked.

Actually it’s about inbound access being blocked. But by pinging some IP address this can be checked as it will stop responding to pings.

But anyway I get your point, it could be used for bad things too.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct