0

I am configuring a network interface on my server, editing this file /etc/network/interfaces.d/50-cloud-init.cfg

I need to have a list of IP address configured which all are in the same ip-block. For now i'm writing every single ip address separately on the configuration file. I would like to know if it's possible to activate a whole block / range of ip in one shot ?

What i have inside for now s something like this :

auto lo
iface lo inet loopback
    dns-nameservers xxx.xxx.33.99

auto eno1
iface eno1 inet dhcp
    mtu 1500

auto eno1:0
iface eno1:0 inet static
address xx5.xx9.xx.0
netmask 255.255.255.255

auto eno1:1
iface eno1:1 inet static
address xx.xx.xx.1
netmask 255.255.255.255

auto eno1:2
iface eno1:2 inet static
address xx.xx.xx.2
netmask 255.255.255.255

auto eno1:3
iface eno1:3 inet static
address xx.xx.1xx.3
netmask 255.255.255.255

auto eno1:4
iface eno1:4 inet static
address xx.xx.xx.4
netmask 255.255.255.255

auto eno1:5
iface eno1:5 inet static
address xx.xx.xx.5
netmask 255.255.255.255


auto eno1:6
iface eno1:6 inet static
address xx6.xx.xx.6
netmask 255.255.255.255

auto eno1:7
iface eno1:7 inet static
address xx6.xx.xx.7
netmask 255.255.255.255
Poyoman
  • 141
  • 4
  • 1
    Not with the ancient network/interfaces config files. – Michael Hampton Mar 04 '21 at 18:24
  • 1
    Your example doesn't list any inet6 interfaces yet. What IPv6 details do you have (prefix and gateway) and how many IPv6 addresses were you thinking of bringing up? You can call scripts pre-up or post-up so I'd probably use that to add IPs by script. – grifferz Mar 06 '21 at 07:58
  • Yes sry my example is my current file without IPV6. I know my gateway, and i've been assigned a /64 IPV6 block. I don't know exactly how much IPV6 i will need, but something around 100 and 10k IP (one for each clients we will have for my project) – Poyoman Mar 08 '21 at 08:52

0 Answers0