Is it possible to configure Netplan with Static IP range? Or do you need to specify each IP like in old ifupdown configuration.

Basically I want to do something similar to RedHat:


The old way is doing this way: https://serverfault.com/questions/27160/how-to-add-multiple-24-network-ips-in-ubuntu

iface eth0 inet static
  up ip addr add dev eth0
  up ip addr add dev eth0
  up ip addr add dev eth0
  up ip addr add dev eth0

Would I need to just specify each IP like bellow or is there a simpler way to specify a range?

# This file is generated from information provided by 
# the datasource. Changes to it will not persist across an instance. 
# To disable cloud-init's network configuration capabilities, write a file 
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: 
# network: {config: disabled} 

    renderer: networkd 
            addresses: [,, ... , ]  
                addresses: [,]  
            dhcp4: no 
    version: 2 

No, this is not possible through netplan. You could conceivably generate your netplan yaml from a script that you run elsewhere, to expand your range into the list of addresses required by netplan instead of having to maintain this list manually. But netplan does not itself have the concept of assigning a range of IP addresses to an interface (nor do I think we would likely add such a feature, as I don't believe this is a common configuration).

  • I do appreciate your answer. Thanks. But if Redhat easily supports this configuration, then I wouldn't think it is a super uncommon configuration. – squirtgun Apr 7 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.