Private IP automation

Hi everyone!

I am trying to have an automated way of creating and configuring my nodes and want them to communicate through the private network.

However, when I took a look at the API, I wasn't able to tell how I can get a private IP this way.

So I wanted to know if there is a way to enable the private IP of a node via some script rather than using the Linode Manager.

Thanks.

11 Replies

Since you need to reboot a linode for the new IP to take effect, that's not really going to work unless you have a third party box doing this through the API.

Is there a reason why you need to automate this? Why not just set up the private network on each machine and leave it at that?

The problem is that I plan to automatically create and configure some nodes that I will put behind a load-balancer on an as needed basis.

As the decision for creation and deletion of nodes will be triggered by a program, it would be really inconvenient to have to request the private IP manually.

This is on our dev roadmap, however I can't give you an ETA just yet. It will happen, however.

Thanks,

-Chris

Thanks for your answer.

I hope you can get this running as soon as possible :D

Perhaps this is not possible, but it would very interesting if the private IPs could, by default, work like the public ones: set to use DHCP by default.

In my case, I would like to spawn up a bunch of boxes (say, 10 of them) for just one day a month. But I don't want to have to go configure the private IPs just so I can get them to see the persistent database server that they'll be communicating with…

I know that this is a pretty old thread, but I'd definitely love it if the private IPs could also be assigned via DHCP (at least if you only have 1 of them on the specific Linode)…

At this point the API does seem to provide everything that would be needed to automate this without the DHCP assignment but it'd be sooo much easier for users to configure some type of automated scaling if the private IPs would be active immediately upon reboot via DHCP.

DHCP can only assign one IP per interface - so that'd be your public IP. No chance for it to do both.

But, we could work in an 'ip-config helper' that spruces up your network interface config files for you. It would be disable-able, of course.

-Chris

Thanks for the quick follow-up Chris, especially on an old thread. :-)

DHCP - Aren't the steps that we take manually (am doing exactly this right now for a new Linode, heh, ~60% done) just adding a second interface meaning that you could potentially have two configured by default and so still be able to use DHCP for the private? Upon taking a closer second look at the instructions (it's early & I tend to stay closer to the app level generally heh) it actually looks like the other IPs are configured on virtual interfaces instead, eh? I'm not familiar TBH, is this where the limitation comes in to play? I guess I would expect, perhaps naively, that some of the new virtualization stuff would support a configuration like thus but obviously this is a good bit out of my knowledge range…

IP-Config Helper - Could you elaborate on this a bit more perhaps? Would this be a binary or something that in essence is a remote system that would automatically make the appropriate configuration changes via Lish or similar direct access login? Really just interested in what you had in mind, at first glance it sounds like it could potentially be a very useful addition. I'd actually even be interested in hearing more about what you have in mind as far as this approach is concerned as it's something, depending on what you had in mind, that I might be interested in writing / helping to write or at least contributing to if possible (assuming you weren't thinking something more from the VM side / that I wouldn't have access to obviously)… :-)

One Linode = one interface, so no - we won't be having multiple interfaces and additional MAC entries, etc, etc. What you're doing when adding IPs is creating NIC aliases - completely different, and is somewhat deprecated. See 'man ip' for the new stuff…

They're on-boot helpers on the host that is bringing up your Linode. It mounts your filesystem, does stuff, unmounts and then boots it. This already happens with a few other things (console device, etc) which you can see clicking on your configuration profile.

If you're trying to achieve automation for now you're better off querying the API and then adding the (three?) lines to your network configuration file (/etc/network/interfaces for Debuntu, for example). Pretty straight forward.

http://www.linode.com/api/linode/linode.ip.addprivate

(boot your Linode)

http://www.linode.com/api/linode/linode.ip.list

-Chris

DHCP - Gotcha, makes sense, that would definitely get pretty messy and fast! :-)

OnBoot helpers - Ah, I see. Is the code for these available anywhere that I could take a look at (either on the Linodes themselves and/or via GitHub or similar) perhaps? I'd definitely be interested in seeing it added [or contributing it myself] especially since it seems like it'd be somewhat straight-forward to add. I'd also be curious if something similar could be added to auto-mount additional disk images that are attached to a Linode at boot time. Obviously the latter concern is pretty small, and is very easily automated around as-is, but seems like another semi-easy addition that would possibly be quite helpful & useful for much of the Linode user base.

API - Yep, that's the route I'm probably going to go down, appreciate the guidance & confirmation. We're already making some similar calls for automated deployment via Capistrano which is configured to dynamically lookup the 'server pool' and deploy the appropriate code / configs to each server in the pool based on its role. Will likely do something similar here as well. :-)

Thanks again for the [super fast] replies on such an old thread, very much appreciated!

FWIW, I'm continually impressed by Linode - basically nothing to complain about - you guys have really surpassed my expectations all around (and my hopes / expectations began quite high)!

Thank you!

ArthurDAntonioIII,

In case you don't know, intra-data center IPv6 traffic is free, just like traffic over IPv4 private IPs. And a node's (first) IPv6 address comes up automatically via SLAAC, similarly to how DHCP is used for your primary IPv4 address. So if all of your software supports IPv6, you can switch to it and avoid IPv4 private IPs and the configuration hassle.

Remember, this doesn't mean you have to force your users to use IPv6, or even expose it to them at all. I just mean using it for your backend traffic. (This assumes you aren't actually providing public services to other Linode customers over the private network, I guess.)

Edit: Copy editing.

Reply

Please enter an answer
Tips:

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] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct